13 #ifndef OPENHRP_WORLD_H_INCLUDED 14 #define OPENHRP_WORLD_H_INCLUDED 18 #include <boost/shared_ptr.hpp> 19 #include <boost/intrusive_ptr.hpp> 26 class CollisionSequence;
44 unsigned int numBodies() {
return bodyInfoArray.size(); }
66 return bodyInfoArray[index].forwardDynamics;
74 int bodyIndex(
const std::string& name);
92 void clearCollisionPairs();
98 void setTimeStep(
double dt);
110 void setCurrentTime(
double tm);
122 void setGravityAcceleration(
const Vector3& g);
135 void enableSensors(
bool on);
140 void setEulerMethod();
145 void setRungeKuttaMethod();
150 virtual void initialize();
155 virtual void calcNextState();
163 std::pair<int,bool> getIndexOfLinkPairs(
Link* link1,
Link* link2);
179 void updateRangeSensors();
210 World() : constraintForceSolver(*this) { }
213 WorldBase::initialize();
214 constraintForceSolver.initialize();
217 virtual void calcNextState(OpenHRP::CollisionSequence& corbaCollisionSequence) {
218 constraintForceSolver.solve(corbaCollisionSequence);
219 WorldBase::calcNextState();
int numRegisteredLinkPairs
LinkPairKeyToIndexMap linkPairKeyToIndexMap
boost::shared_ptr< ForwardDynamics > ForwardDynamicsPtr
ForwardDynamicsPtr forwardDynamics
virtual void initialize()
initialize this world. This must be called after all bodies are registered.
const Vector3 & getGravityAcceleration()
get gravity acceleration
bool operator<(const EchoSample &, const EchoSample &)
png_infop png_charpp name
std::map< LinkPairKey, int > LinkPairKeyToIndexMap
boost::shared_ptr< Body > BodyPtr
std::map< BodyPtr, int > BodyToIndexMap
ForwardDynamicsPtr forwardDynamics(int index)
get forward dynamics computation method for body
double currentTime(void) const
get current time
BodyToIndexMap bodyToIndexMap
NameToIndexMap nameToBodyIndexMap
virtual void calcNextState(OpenHRP::CollisionSequence &corbaCollisionSequence)
TConstraintForceSolver constraintForceSolver
std::map< std::string, int > NameToIndexMap
unsigned int numBodies()
get the number of bodies in this world
double timeStep(void) const
get time step
std::vector< BodyInfo > bodyInfoArray