From 61a3ee0d7b436882df64ed2e214ab8a4121cbcd1 Mon Sep 17 00:00:00 2001 From: bpapaspyros Date: Thu, 17 Oct 2024 13:27:01 +0200 Subject: [PATCH] feat: add the corresponding python binding --- python/source/robot_model/bind_model.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/source/robot_model/bind_model.cpp b/python/source/robot_model/bind_model.cpp index 8feb02e00..0a1e1704d 100644 --- a/python/source/robot_model/bind_model.cpp +++ b/python/source/robot_model/bind_model.cpp @@ -115,6 +115,13 @@ void model(py::module_& m) { c.def("in_range", [](Model& self, const JointState& joint_state) -> bool { return self.in_range(joint_state); }, "Check if the joint state variables (positions, velocities & torques) are inside the limits provided by the model", "joint_state"_a); + c.def( + "clamp_in_range", + [](Model& self, const JointState& joint_state, const JointStateVariable& state_variable_type) -> JointState { + return self.clamp_in_range(joint_state, state_variable_type); + }, + "Clamp the joint state variables (positions, velocities & torques) according to the limits provided by the model", + "joint_state"_a, "state_variable_type"_a); c.def("clamp_in_range", [](Model& self, const JointState& joint_state) -> JointState { return self.clamp_in_range(joint_state); }, "Clamp the joint state variables (positions, velocities & torques) according to the limits provided by the model", "joint_state"_a); }