Obstacle and voxel layer not raytracing free space properly

asked 2022-07-01 17:26:15 -0500

Pepis gravatar image

Hi

I have been working with nav2 and I have noted that dynamic obstacles marked by the obstacle and voxel layer often don't get cleared out when they change their position. This is problematic for my use case because the "trails" left by the obstacles can potentially block the movement of the robot when actually the obstacle is not longer located where it was marked in the first place.

I have tested this on the turtlebot simulator, the following links show the videos of the undesired behavior

obstacle_layer: As you can see, as I move the obstacle manually on gazebo some of its previous positions keep marked on the map.

voxel_layer: Red points show the voxels published by the layer, while the blue ones show the clearing endpoints. The behavior is the same as with the obstacle layer, it is possible to see also how some voxels are not cleared out when the cylinder is moved.

These are my configuration parameters, they are basically the same as the ones on nav2_bringup but with an extended raytrace_max_range. I got the same results with the original value. I'm building nav2 from source on ROS2 rolling.

obstacle_layer:
    plugin: "nav2_costmap_2d::ObstacleLayer"
    enabled: True
    observation_sources: scan
    scan:
      topic: /scan
      max_obstacle_height: 2.0
      clearing: True
      marking: True
      data_type: "LaserScan"
      raytrace_max_range: 10.0
      raytrace_min_range: 0.0
      obstacle_max_range: 2.5
      obstacle_min_range: 0.0

and

voxel_layer:
    plugin: "nav2_costmap_2d::VoxelLayer"
    enabled: True
    publish_voxel_map: True
    origin_z: 0.0
    z_resolution: 0.05
    z_voxels: 16
    max_obstacle_height: 2.0
    mark_threshold: 0
    observation_sources: scan
    scan:
      topic: /scan
      max_obstacle_height: 2.0
      clearing: True
      marking: True
      data_type: "LaserScan"
      raytrace_max_range: 10.0
      raytrace_min_range: 0.0
      obstacle_max_range: 2.5
      obstacle_min_range: 0.0

I'm aware that some alternatives like nonpersistent_voxel_layer and spatio_temporal_voxel_layer exist, and I think they were partly made to address the problems on the existing layers, however I wanted to ask, is this behavior expected? Is there any way to prevent this from happening using the builtin layers?

Thanks!

edit retag flag offensive close merge delete