12 #ifndef NEW_DYNAMICSSIMULATOR_IMPL_HEADER 13 #define NEW_DYNAMICSSIMULATOR_IMPL_HEADER 19 #include <boost/scoped_ptr.hpp> 22 #include <hrpCorba/ModelLoader.hh> 23 #include <hrpCorba/CollisionDetector.hh> 24 #include <hrpCorba/DynamicsSimulator.hh> 34 virtual public PortableServer::RefCountServantBase
43 CollisionDetector_var collisionDetector;
45 CollisionSequence_var collisions;
46 LinkPairSequence_var collidingLinkPairs;
48 CharacterPositionSequence_var allCharacterPositions;
49 bool needToUpdatePositions;
51 SensorStateSequence_var allCharacterSensorStates;
52 bool needToUpdateSensorStates;
59 bool timeMeasureFinished;
61 void _setupCharacterData();
62 void _updateCharacterPositions();
63 void _updateSensorStates();
65 void registerCollisionPair2CD(
66 const std::string &,
const std::string &,
67 const std::string &,
const std::string &);
78 virtual void registerCharacter(
83 CORBA::Double timeStep,
84 OpenHRP::DynamicsSimulator::IntegrateMethod integrateOpt,
85 OpenHRP::DynamicsSimulator::SensorOption sensorOpt);
87 virtual void registerCollisionCheckPair(
92 CORBA::Double staticFriction,
93 CORBA::Double slipFriction,
94 const DblSequence6& K,
95 const DblSequence6&
C,
96 const double culling_thresh,
97 const double restitution);
99 virtual void registerIntersectionCheckPair(
104 const double tolerance);
106 virtual void registerExtraJoint
108 const char* charName1,
109 const char* linkName1,
110 const char* charName2,
111 const char* linkName2,
112 const DblSequence3& link1LocalPos,
113 const DblSequence3& link2LocalPos,
114 const ExtraJointType jointType,
115 const DblSequence3& jointAxis,
116 const char* extraJointName);
119 virtual void getExtraJointConstraintForce(
120 const char* characterName,
121 const char* extraJointName,
122 DblSequence6_out contactForce);
124 virtual void getCharacterSensorValues(
125 const char* characterName,
126 const char* sensorName,
127 DblSequence_out values);
129 virtual void initSimulation();
131 virtual void stepSimulation();
133 virtual void setCharacterLinkData(
134 const char* characterName,
136 OpenHRP::DynamicsSimulator::LinkDataType
type,
137 const DblSequence&
data);
139 virtual void getCharacterLinkData(
140 const char* characterName,
142 OpenHRP::DynamicsSimulator::LinkDataType
type,
143 DblSequence_out rdata);
145 virtual void getCharacterAllLinkData(
146 const char* characterName,
147 OpenHRP::DynamicsSimulator::LinkDataType
type,
148 DblSequence_out wdata);
150 virtual void setCharacterAllLinkData(
151 const char* characterName,
152 OpenHRP::DynamicsSimulator::LinkDataType
type,
153 const DblSequence& wdata);
155 virtual void setGVector(
const DblSequence3& wdata);
157 virtual void getGVector(DblSequence3_out wdata);
159 virtual void setCharacterAllJointModes(
160 const char* characterName,
161 OpenHRP::DynamicsSimulator::JointDriveMode jointMode);
164 virtual CORBA::Boolean calcCharacterInverseKinematics(
165 const char* characterName,
166 const char* baseLink,
167 const char* targetLink,
168 const LinkPosition& target);
170 virtual void calcCharacterForwardKinematics(
171 const char* characterName);
173 virtual void calcWorldForwardKinematics();
177 virtual void getCharacterSensorState(
const char* characterName, SensorState_out sstate);
179 virtual CORBA::Boolean getCharacterCollidingPairs(
180 const char* characterName,
181 LinkPairSequence_out pairs);
183 virtual void calcCharacterJacobian(
184 const char* characterName,
185 const char* baseLink,
186 const char* targetLink,
187 DblSequence_out jacobian);
189 virtual bool checkCollision(
bool checkAll);
191 virtual LinkPairSequence *checkIntersection(CORBA::Boolean checkAll);
193 virtual DistanceSequence *checkDistance();
228 DynamicsSimulator_ptr
create();
png_infop png_charp png_int_32 png_int_32 int * type
png_infop png_charpp name
void getWorldState(WorldState &state, WorldBase &world)
bool isFirstSimulationLoop
local int destroy(gz_stream *s)
static BodyCustomizerHandle create(BodyHandle bodyHandle, const char *modelName)