Recomputes the forward dynamics without advancing the simulation.
(self)
| 333 | self.forward() |
| 334 | |
| 335 | def forward(self): |
| 336 | """Recomputes the forward dynamics without advancing the simulation.""" |
| 337 | # Note: `mj_forward` differs from `mj_step1` in that it also recomputes |
| 338 | # quantities that depend on acceleration (and therefore on the state of the |
| 339 | # controls). For example `mj_forward` updates accelerometer and gyro |
| 340 | # readings, whereas `mj_step1` does not. |
| 341 | # http://www.mujoco.org/book/programming.html#siForward |
| 342 | with self.check_invalid_state(): |
| 343 | mujoco.mj_forward(self.model.ptr, self.data.ptr) |
| 344 | |
| 345 | @contextlib.contextmanager |
| 346 | def check_invalid_state(self): |