ros-controls / ros_controllers

Generic robotic controllers to accompany ros_control
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
547 stars 524 forks source link

JointTrajectoryController - spline interpolation strategy #626

Closed fzoric8 closed 6 months ago

fzoric8 commented 6 months ago

Hi,

I'm wondering if it is possible to specify different interpolation method for the JointTrajectoryControler.

Here in the 1.1. Trajectory representation section, multiple spline interpolation strategies are specified, but I'm not sure is it possible to change it from Quintic to Linear and how to do so. There's no parameter specification in the wki.

As far as I'm able to see, Quintic interpolation is default in the .cpp source, but for my specific use-case I would need Linear spline interpolation.

So if there's a way to change spline interpolation strategy for the joint_trajectory_controller please let me know.

Thanks!

dcconner commented 6 months ago

If you only specify positions it does linear interpolation. To do cubic you need to specify both position and velocity, and quintic needs position, velocity, and acceleration at each knot point. It uses the appropriate interpolation based on the data provided.

This means that you need to be careful in specifying data at knot points because the quintic interpolation can generate some wild curves to satisfy the constraints at the knot points. The advantage is you can guarantee bounded jerk with continuous accelerations.

fzoric8 commented 6 months ago

Nice, thanks for the quick answer!