MjSpecs.copy should return an MjSpec rather than a raw::MjSpec*
raw::MjSpec* is not a good python object. PiperOrigin-RevId: 690564198 Change-Id: I3a5dd525a3a9acc67bb0e598dd508572dc4c687f
This commit is contained in:
committed by
Copybara-Service
parent
d8494fef3b
commit
ca45041049
@@ -323,10 +323,9 @@ PYBIND11_MODULE(_specs, m) {
|
||||
return mjmodel_mjdata_from_spec_ptr(reinterpret_cast<uintptr_t>(self.ptr),
|
||||
m, d);
|
||||
});
|
||||
mjSpec.def(
|
||||
"copy",
|
||||
[](const MjSpec& self) -> raw::MjSpec* { return mj_copySpec(self.ptr); },
|
||||
py::return_value_policy::reference_internal);
|
||||
mjSpec.def("copy", [](const MjSpec& self) -> MjSpec {
|
||||
return MjSpec(mj_copySpec(self.ptr));
|
||||
});
|
||||
mjSpec.def_property_readonly(
|
||||
"worldbody",
|
||||
[](MjSpec& self) -> raw::MjsBody* {
|
||||
|
||||
Reference in New Issue
Block a user