MCPcopy Create free account
hub / github.com/dartsim/dart / timeStepping

Method timeStepping

tutorials/tutorial_biped/main.cpp:182–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 }
181
182 void timeStepping() override
183 {
184 mController->clearForces();
185
186 // Lesson 3
187 mController->addSPDForces();
188
189 // Lesson 4
190 mController->addAnkleStrategyForces();
191
192 // Lesson 6
193 mController->setWheelCommands();
194
195 // Apply body forces based on user input, and color the body shape red
196 if (mForceCountDown > 0) {
197 BodyNode* bn = mWorld->getSkeleton("biped")->getBodyNode("h_abdomen");
198 bn->setColor(dart::Color::Red());
199
200 if (mPositiveSign)
201 bn->addExtForce(
202 default_force * Eigen::Vector3d::UnitX(),
203 bn->getCOM(),
204 false,
205 false);
206 else
207 bn->addExtForce(
208 -default_force * Eigen::Vector3d::UnitX(),
209 bn->getCOM(),
210 false,
211 false);
212
213 --mForceCountDown;
214 }
215
216 // Step the simulation forward
217 SimWindow::timeStepping();
218 }
219
220protected:
221 std::unique_ptr<Controller> mController;

Callers

nothing calls this directly

Calls 9

clearForcesMethod · 0.45
addSPDForcesMethod · 0.45
setWheelCommandsMethod · 0.45
getBodyNodeMethod · 0.45
getSkeletonMethod · 0.45
setColorMethod · 0.45
addExtForceMethod · 0.45
getCOMMethod · 0.45

Tested by

no test coverage detected