Pointcloud2Map for Tinker is based on pcd2pgm.
This repository is used to convert the PointCloud2 data achieved when doing 3D SLAM to a grid map in pgm format.
The octomap packages in this repository are not used yet. We expect to use octomap to do the convertion in the future.
We first use pointcloud2pcd
to convert PointCloud2 to .pcd
file, then use pcd2pgm
to convert the .pcd
file to .pgm
grid map
rosdep install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
colcon build --packages-select octomap_msgs octomap_ros
source ./install/setup.zsh
colcon build
ros2 run pointcloud2pcd pointcloud2pcd_node
pointcloud2pcd_node
subscribes /Laser_map
and converts the pointcloud2 data to a .pcd
file.
If the convertion runs successfully, the pointcloud2 data will be saved in pointcloud2pcd.pcd
.
You can change the file_directory & file_name of the .pgm
file in /pcd2pgm/config/pcd.yaml
ros2 launch pcd2pgm pcd2pgm.launch.py
ros2 run nav2_map_server map_saver_cli -f YOUR_MAP_NAME