ros_controllers icon indicating copy to clipboard operation
ros_controllers copied to clipboard

JointTrajectoryController: goal time tolerance is only enforced during the last segment of the trajectory

Open alain-m opened this issue 5 years ago • 1 comments

Reading how state/time tolerances are checked at https://github.com/ros-controls/ros_controllers/blob/12a70baee38bf198ad434ad704b353621b23c61a/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller_impl.h#L399-L456 it seems that goal_time_tolerance is only used on the last segment of the trajectory - inside else if (segment_it == --curr_traj[i].end()) -. The goal documentation at http://docs.ros.org/diamondback/api/control_msgs/html/msg/FollowJointTrajectoryGoal.html specifies:

# To report success, the joints must be within goal_tolerance of the
# final trajectory value.  The goal must be achieved by time the
# trajectory ends plus goal_time_tolerance.  (goal_time_tolerance
# allows some leeway in time, so that the trajectory goal can still
# succeed even if the joints reach the goal some time after the
# precise end time of the trajectory).
#
# If the joints are not within goal_tolerance after "trajectory finish
# time" + goal_time_tolerance, the goal aborts with error_code set to
# GOAL_TOLERANCE_VIOLATED

which is correct, but a little unclear in the case where the goal time tolerance is exceed prior to the last segment of the trajectory (e.g the execution hangs because of a hardware failure) then the goal does not get aborted and it will continue to hang indefinitely (unless a timeout was specified for the actionlib goal). It seems like a more user-friendly behaviour would be to either:

  • support individual time tolerances for each segment, and/or
  • enforce the (global) goal_time_tolerance on all segments, and not just the last one

alain-m avatar May 04 '20 08:05 alain-m

FYI @ddengster

bmagyar avatar May 05 '20 08:05 bmagyar