ros2 runtime_error ai_generated partial

[costmap_2d] Failed to update costmap layer 'obstacle_layer': buffer overflow in mark function

ID: ros2/nav2-costmap-layer-buffer-overflow

Also available as: JSON · Markdown · 中文
80%Fix Rate
83%Confidence
1Evidence
2024-01-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
ros2-humble active
ros2-iron active
ros2-rolling active

Root Cause

The obstacle layer's internal buffer for marking obstacles overflows when too many points are added in a single update cycle, often due to a high-rate sensor publishing an excessive number of points.

generic

中文

当单个更新周期内添加过多点时,障碍物层的内部标记缓冲区会溢出,通常是由于高频率传感器发布了过多点。

Official Documentation

https://docs.nav2.org/configuration/packages/costmap-2d/index.html

Workarounds

  1. 85% success Reduce the sensor's point cloud publish rate: in the sensor driver configuration, set 'publish_rate: 5.0' (Hz) or use a filter like 'voxel_grid' to downsample.
    Reduce the sensor's point cloud publish rate: in the sensor driver configuration, set 'publish_rate: 5.0' (Hz) or use a filter like 'voxel_grid' to downsample.
  2. 80% success Increase the costmap update frequency and decrease the obstacle layer's 'combination_method' to '1' (max) to reduce buffer usage: set 'update_frequency: 10.0' and 'obstacle_layer.combination_method: 1' in costmap_common_params.yaml.
    Increase the costmap update frequency and decrease the obstacle layer's 'combination_method' to '1' (max) to reduce buffer usage: set 'update_frequency: 10.0' and 'obstacle_layer.combination_method: 1' in costmap_common_params.yaml.

中文步骤

  1. 降低传感器点云发布频率:在传感器驱动配置中设置'publish_rate: 5.0'(Hz),或使用'voxel_grid'滤波器进行降采样。
  2. 提高代价地图更新频率并将障碍物层的'combination_method'设置为'1'(最大值)以减少缓冲区使用:在costmap_common_params.yaml中设置'update_frequency: 10.0'和'obstacle_layer.combination_method: 1'。

Dead Ends

Common approaches that don't work:

  1. 50% fail

    Buffer overflow is a symptom of excessive data rate; increasing buffer may delay overflow but not prevent it.

  2. 30% fail

    Disabling obstacle layer removes obstacle avoidance, making navigation unsafe.