| 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 | |
| 220 | protected: |
| 221 | std::unique_ptr<Controller> mController; |
nothing calls this directly
no test coverage detected