Skip to content

Commit

Permalink
Address review comment by making a log throttle
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayman committed Mar 19, 2024
1 parent b7db19e commit 197eb53
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nav2_controller/src/controller_server.cpp
Expand Up @@ -452,7 +452,6 @@ void ControllerServer::computeControl()

last_valid_cmd_time_ = now();
rclcpp::WallRate loop_rate(controller_frequency_);
bool cancelling = false;
while (rclcpp::ok()) {
if (action_server_ == nullptr || !action_server_->is_server_active()) {
RCLCPP_DEBUG(get_logger(), "Action server unavailable or inactive. Stopping.");
Expand All @@ -466,10 +465,9 @@ void ControllerServer::computeControl()
publishZeroVelocity();
return;
} else {
if (!cancelling) {
RCLCPP_INFO(get_logger(), "Goal was canceled. Trying to stop the robot.");
cancelling = true;
}
RCLCPP_INFO_THROTTLE(
get_logger(),
*get_clock(), 1000, "Goal was canceled. Trying to stop the robot.");
}
}

Expand Down

0 comments on commit 197eb53

Please sign in to comment.