Classes | Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
hrp::WorldBase Class Reference

#include <World.h>

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

Classes

struct  BodyInfo
 
struct  LinkPairKey
 

Public Member Functions

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

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

◆ BodyToIndexMap

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

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

◆ LinkPairKeyToIndexMap

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

◆ NameToIndexMap

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

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

Constructor & Destructor Documentation

◆ WorldBase()

WorldBase::WorldBase ( )

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

◆ ~WorldBase()

WorldBase::~WorldBase ( )
virtual

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

Member Function Documentation

◆ addBody()

int WorldBase::addBody ( BodyPtr  body)

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.

◆ body() [1/2]

BodyPtr WorldBase::body ( int  index)

get body by index

Parameters
indexof the body
Returns
body

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

◆ body() [2/2]

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.

◆ bodyIndex()

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.

◆ calcNextState()

void WorldBase::calcNextState ( )
virtual

compute forward dynamics and update current state

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

◆ clearBodies()

void WorldBase::clearBodies ( )

clear bodies in this world

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

◆ clearCollisionPairs()

void WorldBase::clearCollisionPairs ( )

clear collision pairs

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

◆ currentTime()

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

get current time

Returns
current time[s]

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

◆ enableSensors()

void WorldBase::enableSensors ( bool  on)

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.

◆ forwardDynamics()

ForwardDynamicsPtr hrp::WorldBase::forwardDynamics ( int  index)
inline

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.

◆ getGravityAcceleration()

const Vector3& hrp::WorldBase::getGravityAcceleration ( )
inline

get gravity acceleration

Returns
gravity accleration

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

◆ getIndexOfLinkPairs()

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.

◆ initialize()

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.

◆ numBodies()

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.

◆ setCurrentTime()

void WorldBase::setCurrentTime ( double  tm)

set current time

Parameters
tmcurrent time[s]

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

◆ setEulerMethod()

void WorldBase::setEulerMethod ( )

choose euler method for integration

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

◆ setGravityAcceleration()

void WorldBase::setGravityAcceleration ( const Vector3 g)

set gravity acceleration

Parameters
ggravity acceleration[m/s^2]

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

◆ setRungeKuttaMethod()

void WorldBase::setRungeKuttaMethod ( )

choose runge-kutta method for integration

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

◆ setTimeStep()

void WorldBase::setTimeStep ( double  dt)

set time step

Parameters
dttime step[s]

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

◆ timeStep()

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

get time step

Returns
time step[s]

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

◆ updateRangeSensor()

void WorldBase::updateRangeSensor ( RangeSensor sensor)
private

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

◆ updateRangeSensors()

void WorldBase::updateRangeSensors ( )
private

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

Member Data Documentation

◆ bodyInfoArray

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

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

◆ bodyToIndexMap

BodyToIndexMap hrp::WorldBase::bodyToIndexMap
private

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

◆ currentTime_

double hrp::WorldBase::currentTime_
protected

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

◆ g

Vector3 hrp::WorldBase::g
private

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

◆ isEulerMethod

bool hrp::WorldBase::isEulerMethod
private

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

◆ linkPairKeyToIndexMap

LinkPairKeyToIndexMap hrp::WorldBase::linkPairKeyToIndexMap
private

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

◆ nameToBodyIndexMap

NameToIndexMap hrp::WorldBase::nameToBodyIndexMap
private

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

◆ numRegisteredLinkPairs

int hrp::WorldBase::numRegisteredLinkPairs
private

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

◆ sensorsAreEnabled

bool hrp::WorldBase::sensorsAreEnabled
protected

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

◆ timeStep_

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 Sep 8 2022 02:24:09