Skip to content

Commit

Permalink
Merge pull request #2566 from nim65s/register
Browse files Browse the repository at this point in the history
python: register Model
  • Loading branch information
jcarpent authored Jan 30, 2025
2 parents 6c8b80a + ce0a6ac commit 190ef9a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix aba explicit template instantiation ([#2541](https://github.com/stack-of-tasks/pinocchio/pull/2541))
- Fix mjcf parsing of keyframe qpos with newlines ([#2535](https://github.com/stack-of-tasks/pinocchio/pull/2535))
- Fix sites parsing for MJCF format ([#2548](https://github.com/stack-of-tasks/pinocchio/pull/2548))
- Fix register `std::shared_ptr<{,Geometry}{Model,Data}>` in bindings ([#2566](https://github.com/stack-of-tasks/pinocchio/pull/2566))
- Removed useless uses of `PINOCCHIO_WITH_CXX11_SUPPORT` ([#2564](https://github.com/stack-of-tasks/pinocchio/pull/2564))


Expand Down
2 changes: 2 additions & 0 deletions include/pinocchio/bindings/python/multibody/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ namespace pinocchio
.def(bp::self != bp::self)
#endif
;

bp::register_ptr_to_python<std::shared_ptr<Data>>();
}

/* --- Expose --------------------------------------------------------- */
Expand Down
2 changes: 2 additions & 0 deletions include/pinocchio/bindings/python/multibody/geometry-data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ namespace pinocchio
.def(bp::self != bp::self)

;

bp::register_ptr_to_python<std::shared_ptr<GeometryData>>();
}

/* --- Expose --------------------------------------------------------- */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ namespace pinocchio

.def(bp::self == bp::self)
.def(bp::self != bp::self);

bp::register_ptr_to_python<std::shared_ptr<GeometryModel>>();
}

static GeometryData createData(const GeometryModel & geomModel)
Expand Down
2 changes: 2 additions & 0 deletions include/pinocchio/bindings/python/multibody/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ namespace pinocchio

.PINOCCHIO_ADD_STATIC_PROPERTY_READONLY_BYVALUE(
Model, gravity981, "Default gravity field value on the Earth.");

bp::register_ptr_to_python<std::shared_ptr<Model>>();
}

static JointIndex addJoint0(
Expand Down

0 comments on commit 190ef9a

Please sign in to comment.