Add spec find_sensor, find_actuator functions.
PiperOrigin-RevId: 703054696 Change-Id: Ie384f1a31de3ecd9b22b7f4be43234d452e7bb88
This commit is contained in:
committed by
Copybara-Service
parent
f882f4b065
commit
a729acb4fa
@@ -350,6 +350,20 @@ PYBIND11_MODULE(_specs, m) {
|
||||
return mjs_asSite(mjs_findElement(self.ptr, mjOBJ_SITE, name.c_str()));
|
||||
},
|
||||
py::return_value_policy::reference_internal);
|
||||
mjSpec.def(
|
||||
"find_actuator",
|
||||
[](MjSpec& self, std::string& name) -> raw::MjsActuator* {
|
||||
return mjs_asActuator(
|
||||
mjs_findElement(self.ptr, mjOBJ_ACTUATOR, name.c_str()));
|
||||
},
|
||||
py::return_value_policy::reference_internal);
|
||||
mjSpec.def(
|
||||
"find_sensor",
|
||||
[](MjSpec& self, std::string& name) -> raw::MjsSensor* {
|
||||
return mjs_asSensor(
|
||||
mjs_findElement(self.ptr, mjOBJ_SENSOR, name.c_str()));
|
||||
},
|
||||
py::return_value_policy::reference_internal);
|
||||
mjSpec.def(
|
||||
"find_default",
|
||||
[](MjSpec& self, std::string& classname) -> const raw::MjsDefault* {
|
||||
|
||||
Reference in New Issue
Block a user