Skip to content

Commit 190ef9a

Browse files
authored
Merge pull request #2566 from nim65s/register
python: register Model
2 parents 6c8b80a + ce0a6ac commit 190ef9a

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1717
- Fix aba explicit template instantiation ([#2541](https://github.com/stack-of-tasks/pinocchio/pull/2541))
1818
- Fix mjcf parsing of keyframe qpos with newlines ([#2535](https://github.com/stack-of-tasks/pinocchio/pull/2535))
1919
- Fix sites parsing for MJCF format ([#2548](https://github.com/stack-of-tasks/pinocchio/pull/2548))
20+
- Fix register `std::shared_ptr<{,Geometry}{Model,Data}>` in bindings ([#2566](https://github.com/stack-of-tasks/pinocchio/pull/2566))
2021
- Removed useless uses of `PINOCCHIO_WITH_CXX11_SUPPORT` ([#2564](https://github.com/stack-of-tasks/pinocchio/pull/2564))
2122

2223

include/pinocchio/bindings/python/multibody/data.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ namespace pinocchio
262262
.def(bp::self != bp::self)
263263
#endif
264264
;
265+
266+
bp::register_ptr_to_python<std::shared_ptr<Data>>();
265267
}
266268

267269
/* --- Expose --------------------------------------------------------- */

include/pinocchio/bindings/python/multibody/geometry-data.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ namespace pinocchio
142142
.def(bp::self != bp::self)
143143

144144
;
145+
146+
bp::register_ptr_to_python<std::shared_ptr<GeometryData>>();
145147
}
146148

147149
/* --- Expose --------------------------------------------------------- */

include/pinocchio/bindings/python/multibody/geometry-model.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ namespace pinocchio
108108

109109
.def(bp::self == bp::self)
110110
.def(bp::self != bp::self);
111+
112+
bp::register_ptr_to_python<std::shared_ptr<GeometryModel>>();
111113
}
112114

113115
static GeometryData createData(const GeometryModel & geomModel)

include/pinocchio/bindings/python/multibody/model.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ namespace pinocchio
232232

233233
.PINOCCHIO_ADD_STATIC_PROPERTY_READONLY_BYVALUE(
234234
Model, gravity981, "Default gravity field value on the Earth.");
235+
236+
bp::register_ptr_to_python<std::shared_ptr<Model>>();
235237
}
236238

237239
static JointIndex addJoint0(

0 commit comments

Comments
 (0)