Classes | Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
hrp::WorldBase Class Reference

#include <World.h>

Inheritance diagram for hrp::WorldBase:
Inheritance graph
[legend]

List of all members.

Classes

struct  BodyInfo
struct  LinkPairKey

Public Member Functions

int addBody (BodyPtr body)
 add body to this world
BodyPtr body (int index)
 get body by index
BodyPtr body (const std::string &name)
 get body by name
int bodyIndex (const std::string &name)
 get index of body by name
virtual void calcNextState ()
 compute forward dynamics and update current state
void clearBodies ()
 clear bodies in this world
void clearCollisionPairs ()
 clear collision pairs
double currentTime (void) const
 get current time
void enableSensors (bool on)
 enable/disable sensor simulation
ForwardDynamicsPtr forwardDynamics (int index)
 get forward dynamics computation method for body
const Vector3getGravityAcceleration ()
 get gravity acceleration
std::pair< int, bool > getIndexOfLinkPairs (Link *link1, Link *link2)
 get index of link pairs
virtual void initialize ()
 initialize this world. This must be called after all bodies are registered.
unsigned int numBodies ()
 get the number of bodies in this world
void setCurrentTime (double tm)
 set current time
void setEulerMethod ()
 choose euler method for integration
void setGravityAcceleration (const Vector3 &g)
 set gravity acceleration
void setRungeKuttaMethod ()
 choose runge-kutta method for integration
void setTimeStep (double dt)
 set time step
double timeStep (void) const
 get time step
 WorldBase ()
virtual ~WorldBase ()

Protected Attributes

std::vector< BodyInfobodyInfoArray
double currentTime_
bool sensorsAreEnabled
double timeStep_

Private Types

typedef std::map< BodyPtr, intBodyToIndexMap
typedef std::map< LinkPairKey,
int
LinkPairKeyToIndexMap
typedef std::map< std::string,
int
NameToIndexMap

Private Member Functions

void updateRangeSensor (RangeSensor *sensor)
void updateRangeSensors ()

Private Attributes

BodyToIndexMap bodyToIndexMap
Vector3 g
bool isEulerMethod
LinkPairKeyToIndexMap linkPairKeyToIndexMap
NameToIndexMap nameToBodyIndexMap
int numRegisteredLinkPairs

Detailed Description

Definition at line 34 of file hrplib/hrpModel/World.h.


Member Typedef Documentation

typedef std::map<BodyPtr, int> hrp::WorldBase::BodyToIndexMap [private]

Definition at line 185 of file hrplib/hrpModel/World.h.

Definition at line 193 of file hrplib/hrpModel/World.h.

typedef std::map<std::string, int> hrp::WorldBase::NameToIndexMap [private]

Definition at line 182 of file hrplib/hrpModel/World.h.


Constructor & Destructor Documentation

Definition at line 30 of file hrplib/hrpModel/World.cpp.

WorldBase::~WorldBase ( ) [virtual]

Definition at line 43 of file hrplib/hrpModel/World.cpp.


Member Function Documentation

add body to this world

Parameters:
body
Returns:
index of the body
Note:
This must be called before initialize() is called.

Definition at line 153 of file hrplib/hrpModel/World.cpp.

get body by index

Parameters:
indexof the body
Returns:
body

Definition at line 56 of file hrplib/hrpModel/World.cpp.

BodyPtr WorldBase::body ( const std::string &  name)

get body by name

Parameters:
nameof the body
Returns:
body

Definition at line 65 of file hrplib/hrpModel/World.cpp.

int WorldBase::bodyIndex ( const std::string &  name)

get index of body by name

Parameters:
nameof the body
Returns:
index of the body

Definition at line 49 of file hrplib/hrpModel/World.cpp.

compute forward dynamics and update current state

Definition at line 135 of file hrplib/hrpModel/World.cpp.

clear bodies in this world

Definition at line 166 of file hrplib/hrpModel/World.cpp.

clear collision pairs

Definition at line 173 of file hrplib/hrpModel/World.cpp.

double hrp::WorldBase::currentTime ( void  ) const [inline]

get current time

Returns:
current time[s]

Definition at line 116 of file hrplib/hrpModel/World.h.

enable/disable sensor simulation

Parameters:
ontrue to enable, false to disable
Note:
This must be called before initialize() is called.

Definition at line 93 of file hrplib/hrpModel/World.cpp.

get forward dynamics computation method for body

Parameters:
indexindex of the body
Returns:
forward dynamics computation method

Definition at line 65 of file hrplib/hrpModel/World.h.

get gravity acceleration

Returns:
gravity accleration

Definition at line 128 of file hrplib/hrpModel/World.h.

std::pair< int, bool > WorldBase::getIndexOfLinkPairs ( Link link1,
Link link2 
)

get index of link pairs

Parameters:
link1link1
link2link2
Returns:
pair of index and flag. The flag is true if the pair was already registered, false othewise.

Definition at line 192 of file hrplib/hrpModel/World.cpp.

void WorldBase::initialize ( void  ) [virtual]

initialize this world. This must be called after all bodies are registered.

Reimplemented in hrp::World< TConstraintForceSolver >, hrp::World< hrp::ConstraintForceSolver >, and ODE_World.

Definition at line 99 of file hrplib/hrpModel/World.cpp.

unsigned int hrp::WorldBase::numBodies ( ) [inline]

get the number of bodies in this world

Returns:
the number of bodies

Definition at line 44 of file hrplib/hrpModel/World.h.

set current time

Parameters:
tmcurrent time[s]

Definition at line 81 of file hrplib/hrpModel/World.cpp.

choose euler method for integration

Definition at line 180 of file hrplib/hrpModel/World.cpp.

set gravity acceleration

Parameters:
ggravity acceleration[m/s^2]

Definition at line 87 of file hrplib/hrpModel/World.cpp.

choose runge-kutta method for integration

Definition at line 186 of file hrplib/hrpModel/World.cpp.

void WorldBase::setTimeStep ( double  dt)

set time step

Parameters:
dttime step[s]

Definition at line 75 of file hrplib/hrpModel/World.cpp.

double hrp::WorldBase::timeStep ( void  ) const [inline]

get time step

Returns:
time step[s]

Definition at line 104 of file hrplib/hrpModel/World.h.

Definition at line 248 of file hrplib/hrpModel/World.cpp.

Definition at line 234 of file hrplib/hrpModel/World.cpp.


Member Data Documentation

std::vector<BodyInfo> hrp::WorldBase::bodyInfoArray [protected]

Definition at line 174 of file hrplib/hrpModel/World.h.

Definition at line 186 of file hrplib/hrpModel/World.h.

double hrp::WorldBase::currentTime_ [protected]

Definition at line 167 of file hrplib/hrpModel/World.h.

Definition at line 198 of file hrplib/hrpModel/World.h.

Definition at line 200 of file hrplib/hrpModel/World.h.

Definition at line 194 of file hrplib/hrpModel/World.h.

Definition at line 183 of file hrplib/hrpModel/World.h.

Definition at line 196 of file hrplib/hrpModel/World.h.

Definition at line 176 of file hrplib/hrpModel/World.h.

double hrp::WorldBase::timeStep_ [protected]

Definition at line 168 of file hrplib/hrpModel/World.h.


The documentation for this class was generated from the following files:


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:22