Point Cloud Configuration

The default point cloud configuration file is installed under the /usr/share/slamcore/presets/point_cloud.json path. When following the Nav2 Integration Overview tutorial, you may add some additional parameters to your SLAM Configuration file, which will allow you to trim the local point cloud (used for obstacle avoidance) for greater flexibility with your setup.

Parameters

Default Value

Type

LocalPointCloud.DepthSource.DepthNearThreshold

0.25

Float

LocalPointCloud.DepthSource.DepthFarThreshold

4.0

Float

LocalPointCloud.LowerBound

-∞

Float

LocalPointCloud.UpperBound

Float

Point Cloud Trimming

Point cloud trimming increases the usability of the point cloud for obstacle avoidance on ground robots, as for example, we can remove the ground points and avoid them being marked as an obstacle.

Vertical Height Trimming

The point cloud may be trimmed by specifying the height below and above the camera position that you want to include, using the LowerBound and UpperBound parameters respectively.

_images/trimmed-pointcloud-diagram.png

Fig. 28 Example upper and lower bounds to trim the point cloud vertically

  • LowerBound
    • Type: Float

    • Default: -1e30 (-∞)

    • Description: Vertical distance which specifies the lower bounds of the point cloud volume to trim relative to the camera height.

  • UpperBound
    • Type: Float

    • Default: 1e30 ()

    • Description: Vertical distance which specifies the upper bounds of the point cloud volume to trim relative to the camera height.

The bounds are anchored to the camera position and world-axis aligned (Z axis is vertical even when camera is tilted). For example, if the camera on the robot was 23cm above the floor and we wanted to trim the ground points of the point cloud, we could set LowerBound to -0.22 (slightly less than the distance from the camera to the floor) to filter out the ground points from the point cloud.

Example Configuration for Point Cloud Trimming in Vertical Distance
_images/trimmed-pointcloud-ground-example.jpg

Fig. 29 Example of trimming the ground points from the pointcloud

{
  "Version": "1.0.0",
  "Base": {
        "ProfileName": "local_point_cloud"
  },
  "LocalPointCloud": {
        "LowerBound": -0.22,
  }
}

The resulting point cloud that is published excludes any points outside the bounds defined above.

_images/trimmed-pointcloud-comparison-vertical.png

Fig. 30 Left, original point cloud. Right, vertically-trimmed point cloud.

Note

If you would prefer to keep the original point cloud as is, you can reproduce a similar behaviour without modifying the point cloud by using the min_obstacle_height ROS parameter, as explained in our Nav2 Integration Tutorial Nav2 Configuration section.

Depth Trimming

The point cloud may also be trimmed in depth by specifying the range of depth values you want to include, using the DepthNearThreshold and DepthFarThreshold parameters of the DepthSource respectively.

  • DepthSource.DepthNearThreshold
    • Type: Float

    • Default: 0.25

    • Description: Specifies the minimum depth from the camera position (in metres).

  • DepthSource.DepthFarThreshold
    • Type: Float

    • Default: 4.0

    • Description: Specifies the maximum depth from the camera position (in metres).

The resulting point cloud that is published excludes any points outside the defined depth range.

_images/trimmed-pointcloud-comparison-depth.png

Fig. 31 Left, original point cloud. Right, depth-trimmed point cloud.