Support body.find_all("joint") in bindings.
PiperOrigin-RevId: 703071822 Change-Id: I6457ca0561c794447cc06aab29dcd0aac82c49a0
This commit is contained in:
committed by
Copybara-Service
parent
a729acb4fa
commit
41968f1527
@@ -493,6 +493,8 @@ PYBIND11_MODULE(_specs, m) {
|
||||
objtype = mjOBJ_GEOM;
|
||||
} else if (name == "site") {
|
||||
objtype = mjOBJ_SITE;
|
||||
} else if (name == "joint") {
|
||||
objtype = mjOBJ_JOINT;
|
||||
} else if (name == "light") {
|
||||
objtype = mjOBJ_LIGHT;
|
||||
} else if (name == "camera") {
|
||||
@@ -500,7 +502,7 @@ PYBIND11_MODULE(_specs, m) {
|
||||
} else {
|
||||
throw pybind11::value_error(
|
||||
"body.find_all supports the types: body, frame, geom, site, "
|
||||
"light, camera.");
|
||||
"joint, light, camera.");
|
||||
}
|
||||
return FindAllImpl(self, objtype, true);
|
||||
},
|
||||
|
||||
@@ -667,7 +667,7 @@ class SpecsTest(absltest.TestCase):
|
||||
self.assertEqual(
|
||||
str(cm.exception),
|
||||
'body.find_all supports the types: body, frame, geom, site,'
|
||||
' light, camera.',
|
||||
' joint, light, camera.',
|
||||
)
|
||||
body4 = spec.worldbody.find_all('body')[3]
|
||||
body4.name = 'body4_new'
|
||||
|
||||
Reference in New Issue
Block a user