diff --git a/python/mujoco/specs.cc b/python/mujoco/specs.cc index 3a834ff3..64afef62 100644 --- a/python/mujoco/specs.cc +++ b/python/mujoco/specs.cc @@ -261,7 +261,7 @@ py::list FindAllImpl(raw::MjsBody& body, mjtObj objtype, bool recursive) { // this should never happen throw pybind11::value_error( "body.find_all supports the types: body, frame, geom, site, " - "light, camera."); + "joint, light, camera."); break; } el = mjs_nextChild(&body, el, recursive); diff --git a/python/mujoco/specs_test.py b/python/mujoco/specs_test.py index f0c3bb6c..bfefd71f 100644 --- a/python/mujoco/specs_test.py +++ b/python/mujoco/specs_test.py @@ -636,6 +636,8 @@ class SpecsTest(absltest.TestCase): + + @@ -649,6 +651,8 @@ class SpecsTest(absltest.TestCase): self.assertLen(spec.sites, 5) self.assertLen(spec.worldbody.find_all('body'), 4) self.assertLen(spec.worldbody.find_all('site'), 5) + self.assertLen(spec.worldbody.find_all('joint'), 1) + self.assertLen(spec.worldbody.find_all('geom'), 1) self.assertEqual(spec.bodies[1].name, 'body1') self.assertEqual(spec.bodies[2].name, 'body2') self.assertEqual(spec.bodies[3].name, 'body3')