@@ -92,7 +92,7 @@ bool Nav2Interface<ActionT>::sendCancelWaitForResponse(
9292 // Wait for cancel response with timeout (ROS2 recommended approach)
9393 const int timeout_seconds = 5 ;
9494 int elapsed_seconds = 0 ;
95- while (cancel_future.wait_for (std::chrono::seconds (1 )) != std::future_status::ready) {
95+ while (cancel_future.wait_for (std::chrono::seconds (1 )) != std::future_status::ready && rclcpp::ok () ) {
9696 elapsed_seconds++;
9797 LOG_WARN (" Waiting for cancel response (" << elapsed_seconds << " /" << timeout_seconds << " seconds)" );
9898
@@ -106,7 +106,7 @@ bool Nav2Interface<ActionT>::sendCancelWaitForResponse(
106106
107107 // Wait until the cancel request has been accepted or an error occurs.
108108 auto result = cancel_future.get ();
109- LOG_WARN (" Got cancel response" );
109+ LOG_INFO (" Got cancel response" );
110110 if (!result) {
111111 LOG_ERROR (" The future response is null" );
112112 return false ;
@@ -123,7 +123,7 @@ void Nav2Interface<ActionT>::cancelAllGoals()
123123 action_msgs::srv::CancelGoal::Response response;
124124 if (sendCancelWaitForResponse (response)) {
125125 if (response.return_code == action_msgs::srv::CancelGoal::Response::ERROR_NONE) {
126- LOG_ERROR (" Cancellation request accepted by nav2 server. Will cancel the goal." );
126+ LOG_INFO (" Cancellation request accepted by nav2 server. Will cancel the goal." );
127127 nav2_goal_state_ = NavGoalStatus::CANCELLING;
128128 } else if (response.return_code == action_msgs::srv::CancelGoal::Response::ERROR_REJECTED) {
129129 LOG_INFO (" Cancellation request rejected by Nav2 action server, not cancelling goal" );
0 commit comments