Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion python/src/gz/sim/Joint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,22 @@ void defineSimJoint(py::object module)
py::arg("ecm"),
py::arg("limits"),
"Set the effort limits on a joint axis.")
.def("set_position_imits", &gz::sim::Joint::SetPositionLimits,
.def("set_position_imits",
[](pybind11::object &self, EntityComponentManager &_ecm,
const std::vector<math::Vector2d> &_limits)
{
auto warnings = pybind11::module::import("warnings");
auto builtins = pybind11::module::import("builtins");
warnings.attr("warn")(
"set_position_imits() is deprecated, use set_position_limits() instead.",
builtins.attr("DeprecationWarning"));

return self.attr("set_position_limits")(_ecm, _limits);
},
py::arg("ecm"),
py::arg("limits"),
"Set the position limits on a joint axis.")
.def("set_position_limits", &gz::sim::Joint::SetPositionLimits,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be deprecating this instead of removing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azeey opinions here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we should deprecate the old function and add the new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azeey this is wrong in older versions, what should we do?

py::arg("ecm"),
py::arg("limits"),
"Set the position limits on a joint axis.")
Expand Down
Loading