Skip to content
Snippets Groups Projects
Commit 44f3f88f authored by armar-user's avatar armar-user
Browse files

fix: TrajectoryFollowingController: returing twist in local frame

parent ee2f1ee9
No related branches found
No related tags found
1 merge request!25RT controller and simplification
......@@ -203,7 +203,17 @@ namespace armarx::navigation::traj_ctrl
ARMARX_VERBOSE << deactivateSpam(1) << "Twist limited " << twistLimited.linear.transpose();
ARMARX_VERBOSE << deactivateSpam(1) << "Twist angular " << twistLimited.angular.transpose();
return TrajectoryControllerResult{.twist = twistLimited,
// convert to the robot's base frame
const core::Pose global_T_robot(robot->getGlobalPose());
const auto& twistGlobal = twistLimited;
core::Twist twistLocal;
twistLocal.linear = global_T_robot.linear().inverse() * twistGlobal.linear;
// TODO if not in 2D, then this must be changed!
twistLocal.angular = twistGlobal.angular;
return TrajectoryControllerResult{.twist = twistLocal,
.dropPoint = projectedPose.projection};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment