Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 6d6ce3d

Browse files
authored
Throttle some warnings. (#1231)
Throttle planner and controller warnings. Avoids high frequency outputs to terminal. This is specially valuable in the following contexts: * long term experiments, in which terminal outputs' are saved for later analysis (without throttling they will take several GB of disk space). * or simply, the active monitoring of a running system.
1 parent f13af47 commit 6d6ce3d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

global_planner/src/planner_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ bool GlobalPlanner::makePlan(const geometry_msgs::PoseStamped& start, const geom
250250
double start_x, start_y, goal_x, goal_y;
251251

252252
if (!costmap_->worldToMap(wx, wy, start_x_i, start_y_i)) {
253-
ROS_WARN(
253+
ROS_WARN_THROTTLE(1.0,
254254
"The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?");
255255
return false;
256256
}

navfn/src/navfn_ros.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ namespace navfn {
226226

227227
unsigned int mx, my;
228228
if(!costmap_->worldToMap(wx, wy, mx, my)){
229-
ROS_WARN("The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?");
229+
ROS_WARN_THROTTLE(1.0, "The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?");
230230
return false;
231231
}
232232

0 commit comments

Comments
 (0)