Skip to content

Commit e0b5ba0

Browse files
DLuredvinaa
authored andcommitted
Better Costmap Error Message (ros-navigation#2884)
* Better Costmap Error Message * PR Feedback
1 parent 1a4b1c8 commit e0b5ba0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

nav2_costmap_2d/plugins/obstacle_layer.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,12 @@ ObstacleLayer::raytraceFreespace(
571571
if (!worldToMap(ox, oy, x0, y0)) {
572572
RCLCPP_WARN(
573573
logger_,
574-
"Sensor origin at (%.2f, %.2f) is out of map bounds. The costmap cannot raytrace for it.",
575-
ox, oy);
574+
"Sensor origin at (%.2f, %.2f) is out of map bounds (%.2f, %.2f) to (%.2f, %.2f). "
575+
"The costmap cannot raytrace for it.",
576+
ox, oy,
577+
origin_x_, origin_y_,
578+
origin_x_ + getSizeInMetersX(), origin_y_ + getSizeInMetersY(),
579+
);
576580
return;
577581
}
578582

nav2_costmap_2d/plugins/voxel_layer.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,12 @@ void VoxelLayer::raytraceFreespace(
275275
if (!worldToMap3DFloat(ox, oy, oz, sensor_x, sensor_y, sensor_z)) {
276276
RCLCPP_WARN(
277277
logger_,
278-
"Sensor origin: (%.2f, %.2f, %.2f), out of map bounds. The costmap can't raytrace for it.",
279-
ox, oy, oz);
278+
"Sensor origin at (%.2f, %.2f %.2f) is out of map bounds (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f). "
279+
"The costmap cannot raytrace for it.",
280+
ox, oy, oz,
281+
ox + getSizeInMetersX(), oy + getSizeInMetersY(), oz + getSizeInMetersZ(),
282+
origin_x_, origin_y_, origin_z_);
283+
280284
return;
281285
}
282286

0 commit comments

Comments
 (0)