ros-controls / ros_controllers

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

Pass effort through joint_trajectory_controller. #326

Open liarokapisv opened 6 years ago

liarokapisv commented 6 years ago

We would like to have a controller acting the same as position_controllers/JointTrajectoryController that would also forward effort values via a PosEff interface adaptor. The effort values do not need interpolation and could simply stay constant between TrajectoryPoints. Is this currently possible without rewriting a big part of the controller ? If not would it be possible to have a sketch of the required changes?

bmagyar commented 6 years ago

I take it you are aware of how the hardware interfaces are a template parameter in the controller implementation. Doesn't any of the current ones suit your needs?

I don't have the capacity to come up with new implementations at the moment but pull requests are welcome :)

liarokapisv commented 6 years ago

Yes I am aware of that. I believe that only changes the adaptor's behaviour when mapping the position/velocity/acceleration to the interface. The problem is that we need a PosVelEff interface and while writing a new adaptor for a new interface isn't hard in general, the controller apparently does not do anything with the trajectory message's effort values so I can't use them in the adaptor. What I propose is adding effort to the QuinticSplineSegment's state and simple do a linear interpolation, it is a natural addition to the controller's features.

I can make the changes myself but I am not completely sure of all the changes that need to happen to support this feature. On the top of my head I think the following changes are necessary:

Change QuanticSplineSegment to support effort sampling. Change JointTrajectorySegment to read the messages' effort values. Change initJointTrajectory Appropriately change JointTrajectoryController's methods.

What do you think? Is this feature useful for the generic trajectory controller?

amjack0 commented 3 years ago

Is there any update on this ?