ros_controllers icon indicating copy to clipboard operation
ros_controllers copied to clipboard

Does JointTrajectoryController assume that joints are rotational?

Open alain-m opened this issue 6 years ago • 3 comments

Does JointTrajectoryController assume that joints are rotational - continuous, revolute - instead of linear - prismatic -? I cannot find any such assumption documented on the wiki or in the code, but maybe I missed something. I see the angle_wraparound_ member, apparently used to differentiate continuous from revolute joints. The calculation for the state_joint_error_ on position at https://github.com/ros-controls/ros_controllers/blob/melodic-devel/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller_impl.h#L390 and that for the state_error on position at https://github.com/ros-controls/ros_controllers/blob/melodic-devel/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller_impl.h#L394 use angles::shortest_angular_distance which will always give you a result in [-pi;pi]. It would be confusing to find that the position error on my linear joint mysteriously doesn't want to go beyond [-3.14meters;3.14meters], although a linear joint with such a length is probably not very common...

alain-m avatar Oct 17 '19 21:10 alain-m

I think you are quite right about this. Did you come around to solve it in the end or still building your 3+ meters long linear joint? :)

bmagyar avatar Jan 10 '20 08:01 bmagyar

I don't have a 3+m long linear joint so I was never really affected by this, just wanted to point it out for the next guy :)

alain-m avatar Jan 10 '20 15:01 alain-m

As "the next guy", thank you so much for this comment @alain-m. This was really giving me a headache until I found this!

steinmn avatar Mar 25 '22 14:03 steinmn