The PCL recorder package allows you to create point cloud maps from CARLA maps.
Install the pcl-tools
library:
sudo apt install pcl-tools
The PCL recorder package will spawn an ego vehicle that can be controlled with the keyboard or via the autopilot functionality within the Carla PythonAPI.
1. After starting a CARLA server, in a new terminal run the following command to launch the PCL recorder package:
# ROS 1
roslaunch pcl_recorder pcl_recorder.launch
# ROS 2
ros2 launch pcl_recorder pcl_recorder.launch.py
2. When the capture drive is finished, reduce the overall size of the point cloud:
# Create one point cloud file
pcl_concatenate_points_pcd /tmp/pcl_capture/*.pcd
# Filter duplicates
pcl_voxel_grid -leaf 0.1,0.1,0.1 output.pcd map.pcd
3. Verify the result:
pcl_viewer map.pcd