CSM SLAM is a ROS 2 package that implements Simultaneous Localization and Mapping (SLAM) using the Correlative Scan Matcher algorithm as the scan matcher and GTSAM as the backend optimizer. This package provides offline and Online SLAM capabilities for processing laser scan data and building maps of unknown environments.
- ROS 2 (Humble or later)
- Python 3
Create a virtual environment and install the dependencies.
conda create -n csm_slam python=3.12
conda activate csm_slam
pip install -r requirements.txtBuild the package.
mkdir -p csm_ros_ws/src
cd csm_ros_ws/srcClone the repository in the src folder.
cd csm_ros_ws
conda activate csm_slam
source /opt/ros/<ros_distro>/setup.bash
colcon build --packages-select csm_slam
source install/setup.bashSet the venv_path in config/venv_settings.yaml to the path of the virtual environment you created. Adjust the other config file to your needs.
ros2 launch csm_slam csm_slam.launch.py bag_path:=/path/to/your/rosbag2ros2 launch csm_slam csm_slam_offline.launch.py bag_path:=/path/to/your/rosbag2Both launch files will automatically start RViz2 for visualization
Dataset tested with this package can be found at https://google-cartographer-ros.readthedocs.io/en/latest/demos.html#revo-lds. To download the dataset, run the following command:
wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/revo_lds/cartographer_paper_revo_lds.bagOutput of the slam tested in ROS kilted, Ubuntu 24.04 and Conda environment:
If something is not working, please open an issue.
- Add tests.
