MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / testReset

Method testReset

dm_control/mujoco/engine_test.py:466–480  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

464 self._physics.reload_from_xml_path(MODEL_PATH)
465
466 def testReset(self):
467 self._physics.reset()
468 self.assertEqual(self._physics.data.qpos[1], 0)
469 keyframe_id = 0
470 self._physics.reset(keyframe_id=keyframe_id)
471 self.assertEqual(self._physics.data.qpos[1],
472 self._physics.model.key_qpos[keyframe_id, 1])
473 out_of_range = [-1, 3]
474 max_valid = self._physics.model.nkey - 1
475 for actual in out_of_range:
476 with self.assertRaisesWithLiteralMatch(
477 ValueError,
478 engine._KEYFRAME_ID_OUT_OF_RANGE.format(
479 max_valid=max_valid, actual=actual)):
480 self._physics.reset(keyframe_id=actual)
481
482 def testLoadAndReloadFromStringWithAssets(self):
483 physics = engine.Physics.from_xml_string(

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected