9) Map building for NAV2

To perform autonomous navigation, you can either build a 2D occupancy grid using the ToF camera mounted on the robot, or use the ad_r1m_pointcloud_to_occupancygrid package to convert the 3D pointcloud generated by cuVSLAM into a 2D occupancy grid required by NAV2.

To convert a point cloud into an occupancy grid, run the build_occupancy_grid.launch.py launch file:

ros2 launch ad_r1m_pointcloud_to_occupancygrid build_occupancy_grid.launch.py topic:=/visual_slam/vis/landmarks_cloud

The pointcloud resulted as an output from the cuVSLAM can be noisy or include ground points which, for a reliable navigation map, should be filtered. To enable pointcloud filtering before map building set the filter_enable parameter in build_occupancy_grid.launch.py. You can also enable/disable each individual filter to achieve an accurate occupancy grid, depending on the available pointcloud:

{'filter_enable': True}, # Global filtering enable
{'ror_enable': True}, # Radius outlier removal enable
{'sor_enable': False}, # Statistical outlier removal
{'pass_enable': True}, # Pass through filter (z-band)
{'voxel_enable': True}, # Voxel grid enable
{'cluster_enable': False}, # Filtering using clusters

This package allows optional averaging of consecutive grid maps to improve map quality when using noisy or incomplete point clouds, such as cuVSLAM landmarks. By averaging multiple frames, random sensor noise is reduced, persistent structures become clearer, and short-lived or unstable points are suppressed.

 # Normal mean averaging of maps
{'normal_averaging_enable': True},
# Moving average parameters
{'moving_average_enable': False},
{'ma_alpha': 0.5},

Warning

If both normal_averaging_enable and moving_average_enable are true, only normal averaging will be applied.

Important

When filter_enable is True, a Gaussian Z-probability weighting is applied based on how close its height is to the robot’s “obstacle-relevant” vertical band. Set the Gaussian mean to roughly the robot’s mid-height and the standard deviation to about half the robot’s height. Points within this band receive higher weight, while very low or very high points are suppressed, helping reduce vertical noise and emphasize likely obstacles.

{'gaussian_mean': 0.2},
{'gaussian_stddev': 0.05},
AD-R1M, cuVSLAM and 2D occupancy grid build

More information about the ad_r1m_pointcloud_to_occupancygrid can be found at:

Todo

ADD LINK TO ad_r1m_pointcloud_to_occupancygrid PACKAGE DOCUMENTATION