Skip to content

Commit

Permalink
feat: add the corresponding python binding
Browse files Browse the repository at this point in the history
  • Loading branch information
bpapaspyros committed Oct 17, 2024
1 parent 02f10ab commit 4165ad0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/source/robot_model/bind_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4165ad0

Please sign in to comment.