Go to the documentation of this file.
6 #ifndef CNOID_BODY_DYWORLD_H
7 #define CNOID_BODY_DYWORLD_H
13 #include "exportdecl.h"
25 DyBody* body(
const std::string& name)
const;
26 const std::vector<DyBodyPtr>&
bodies() {
return bodies_; }
34 const std::vector<DySubBodyPtr>&
subBodies() {
return subBodies_; }
45 void clearCollisionPairs();
46 void setTimeStep(
double dt);
47 double timeStep(
void)
const {
return timeStep_; }
48 void setCurrentTime(
double tm);
54 void setGravityAcceleration(
const Vector3& g);
63 void enableSensors(
bool on);
65 void setOldAccelSensorCalcMode(
bool on);
70 void setEulerMethod();
75 void setRungeKuttaMethod();
80 virtual void initialize();
82 void setVirtualJointForces();
87 virtual void calcNextState();
97 std::pair<int,bool> getIndexOfLinkPairs(
DyLink* link1,
DyLink* link2);
99 std::vector<ExtraJoint>&
extraJoints() {
return extraJoints_; }
107 std::vector<DyBodyPtr> bodies_;
108 std::vector<DySubBodyPtr> subBodies_;
109 std::vector<DyBodyPtr> bodiesWithVirtualJointForces_;
110 std::map<std::string, DyBodyPtr> nameToBodyMap;
113 bool sensorsAreEnabled;
114 bool isOldAccelSensorCalcMode;
116 bool hasHighGainDynamics_;
121 bool operator<(
const LinkPairKey& pair2)
const;
123 std::map<LinkPairKey, int> linkPairKeyToIndexMap;
125 int numRegisteredLinkPairs;
127 std::vector<ExtraJoint> extraJoints_;
129 void extractInternalBodies(Link* link);
int numBodies() const
Definition: DyWorld.h:23
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
virtual void initialize()
initialize this world. This must be called after all bodies are registered.
Definition: DyWorld.h:139
const std::vector< DyBodyPtr > & bodies()
Definition: DyWorld.h:26
virtual void calcNextState()
compute forward dynamics and update current state
Definition: DyWorld.h:144
virtual void initialize()
initialize this world. This must be called after all bodies are registered.
Definition: DyWorld.cpp:74
std::vector< ExtraJoint > & extraJoints()
Definition: DyWorld.h:99
int numSubBodies() const
This function returns the number of bodies used in the internal calculation in this world.
Definition: DyWorld.h:32
double timeStep(void) const
Definition: DyWorld.h:47
Definition: AbstractSceneLoader.h:11
DyWorld()
Definition: DyWorld.h:137
bool hasHighGainDynamics() const
Definition: DyWorld.h:43
virtual void calcNextState()
compute forward dynamics and update current state
Definition: DyWorld.cpp:100
double currentTime(void) const
Definition: DyWorld.h:49
DySubBody * subBody(int index)
Definition: DyWorld.h:33
void clearExtraJoints()
Definition: DyWorld.h:100
DyBody * body(int index)
Definition: DyWorld.h:24
const std::vector< DySubBodyPtr > & subBodies()
Definition: DyWorld.h:34
void setVirtualJointForces()
Definition: DyWorld.cpp:92
Definition: DyWorld.h:132
bool operator<(ref_ptr< T > const &a, ref_ptr< T > const &b)
Definition: Referenced.h:241
const Vector3 & gravityAcceleration() const
Definition: DyWorld.h:56
TConstraintForceSolver constraintForceSolver
Definition: DyWorld.h:135
void addExtraJoint(ExtraJoint &extraJoint)
Definition: DyWorld.h:101