This is a clone of google cartographer, I modified some parameters to work with my robot (cartographer ROS1 noetic).
https://github.com/poplop03/robot1
- This repo is used to do SLAM with cartographer algorithm.
- The configuration is used to generated 3D or 2D map of the environment with cartographer offline SLAM.
- Critically, check this original program https://google-cartographer-ros.readthedocs.io/en/latest/
- run the bash file
slamSerialized2D.shfor 2D map generation. - run the bash file
slamSerialized3D.shfor 2D map generation. - For more detail read the 2 bash file.
- Your robot setup must use the topic similar to the topic in the picture, otherwise you can change or remapping by modify
offline_my_robot_custom.launchandcustom_dynamic_assets_writer_ros_map.launchto suit your naming convention. - The output map is in the same folder of the .bag file. For 2D slam you will have .yaml and .pgm file.
- Your robot setup must use the topic similar to the topic in the picture, otherwise you can change or remapping by modify
offline_backpack_3d_custom.launchandassets_writer_backpack_3d_custom.launchto suit your naming convention. - The output map is in the same folder of the .bag file. For 3D slam you will have the xray of different projection and .xyz and .ply file. then you can use any point cloud viewer to view the generated map. in my case i use Cloud Compare.
I recommend dig further into the configuration, you will have a better understand how to tune the the SLAM algorithm.
- Some of the parameters i have discovered strongly influence the result:
- TRAJECTORY_BUILDER_2D.num_accumulated_range_data
- num_subdivisions_per_laser_scan
3D result is not very good right now, i am still working on.




