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;
|
objtype = mjOBJ_GEOM;
|
||||||
} else if (name == "site") {
|
} else if (name == "site") {
|
||||||
objtype = mjOBJ_SITE;
|
objtype = mjOBJ_SITE;
|
||||||
|
} else if (name == "joint") {
|
||||||
|
objtype = mjOBJ_JOINT;
|
||||||
} else if (name == "light") {
|
} else if (name == "light") {
|
||||||
objtype = mjOBJ_LIGHT;
|
objtype = mjOBJ_LIGHT;
|
||||||
} else if (name == "camera") {
|
} else if (name == "camera") {
|
||||||
@@ -500,7 +502,7 @@ PYBIND11_MODULE(_specs, m) {
|
|||||||
} else {
|
} else {
|
||||||
throw pybind11::value_error(
|
throw pybind11::value_error(
|
||||||
"body.find_all supports the types: body, frame, geom, site, "
|
"body.find_all supports the types: body, frame, geom, site, "
|
||||||
"light, camera.");
|
"joint, light, camera.");
|
||||||
}
|
}
|
||||||
return FindAllImpl(self, objtype, true);
|
return FindAllImpl(self, objtype, true);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ class SpecsTest(absltest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
str(cm.exception),
|
str(cm.exception),
|
||||||
'body.find_all supports the types: body, frame, geom, site,'
|
'body.find_all supports the types: body, frame, geom, site,'
|
||||||
' light, camera.',
|
' joint, light, camera.',
|
||||||
)
|
)
|
||||||
body4 = spec.worldbody.find_all('body')[3]
|
body4 = spec.worldbody.find_all('body')[3]
|
||||||
body4.name = 'body4_new'
|
body4.name = 'body4_new'
|
||||||
|
|||||||
Reference in New Issue
Block a user