Skip to content

Commit

Permalink
Implemented CartesianPose.changeEndEffectorFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSchneider42 committed May 27, 2024
1 parent 215de7d commit 4f86361
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/franky/cartesian_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ class CartesianState {
return {transform * pose_, transform * velocity_};
}

[[nodiscard]] CartesianState changeEndEffectorFrame(const Affine &transform) const {
auto offset_world_frame = pose_.end_effector_pose() * transform.translation();
return {pose_.changeEndEffectorFrame(transform), velocity_.changeEndEffectorFrame(offset_world_frame)};
}

[[nodiscard]] inline RobotPose pose() const {
return pose_;
}
Expand Down
1 change: 1 addition & 0 deletions python/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ PYBIND11_MODULE(_franky, m) {
.def(py::init<const RobotPose &, const RobotVelocity &>(), "pose"_a,"velocity"_a)
.def(py::init<const CartesianState &>()) // Copy constructor
.def("transform_with", &CartesianState::transformWith, "transform"_a)
.def("change_end_effector_frame", &CartesianState::changeEndEffectorFrame, "transform"_a)
.def_property_readonly("pose", &CartesianState::pose)
.def_property_readonly("velocity", &CartesianState::velocity)
.def("__rmul__",
Expand Down

0 comments on commit 4f86361

Please sign in to comment.