ros2_controllers icon indicating copy to clipboard operation
ros2_controllers copied to clipboard

[JTC] Make goal_time_tolerance overwrite default value only if explicitly set

Open fmauch opened this issue 1 year ago • 0 comments

Since #716 we process the tolerances set from the action goal. This was done as described in https://github.com/ros-controls/control_msgs/blob/65814d985aa29bed0adfaed5f2ebd8cf26266056/control_msgs/action/FollowJointTrajectory.action#L6-L10 and https://github.com/ros-controls/control_msgs/blob/65814d985aa29bed0adfaed5f2ebd8cf26266056/control_msgs/msg/JointTolerance.msg#L7-L10.

However, the goal_time_tolerance was always overwritten with the value from the action goal. This actually changed the JTC's default behavior if

  • a goal_time_tolerance != 0 was set in the controller config and
  • no goal_time_tolerance or explicitly a 0.0 was given in the action goal.

In this, case, the controller would wait indefinitely until the robot reached the final target independent of the goal_time_tolerance configured inside the controller's default values.

This PR makes it such as

  • If a goal_time_tolerance of 0.0 is given in the action (which is the default if left empty), the value from the controller config will be used
  • If a goal_time_tolerance of -1.0 is given the controller will wait at the end of the trajectory until the error gets lower than the goal_tolerance for each joint.
  • If a goal_time_tolerance > 0.0 is given, the goal_time_tolerance from the action goal will be used.
  • Any other negative value for goal_time_tolerance will make the controller fall back to its configured tolerances completely.

fmauch avatar Jul 05 '24 13:07 fmauch