Skip to content

Commit

Permalink
Use time in error_string
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Jan 15, 2024
1 parent b2aab25 commit edccbcc
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,18 +367,19 @@ controller_interface::return_type JointTrajectoryController::update(
}
else if (!within_goal_time)
{
std::string error_string = "Aborted due goal_time_tolerance exceeding by " +
std::to_string(time_difference) + " seconds";

auto result = std::make_shared<FollowJTrajAction::Result>();
result->set__error_code(FollowJTrajAction::Result::GOAL_TOLERANCE_VIOLATED);
result->set__error_string("Aborted due goal_time_tolerance");
result->set__error_string(error_string);
active_goal->setAborted(result);
// TODO(matthew-reynolds): Need a lock-free write here
// See https://github.com/ros-controls/ros2_controllers/issues/168
rt_active_goal_.writeFromNonRT(RealtimeGoalHandlePtr());
rt_has_pending_goal_.writeFromNonRT(false);

RCLCPP_WARN(
get_node()->get_logger(), "Aborted due goal_time_tolerance exceeding by %f seconds",
time_difference);
RCLCPP_WARN(get_node()->get_logger(), error_string.c_str());

traj_msg_external_point_ptr_.reset();
traj_msg_external_point_ptr_.initRT(set_hold_position());
Expand Down

0 comments on commit edccbcc

Please sign in to comment.