Skip to content

A modularized multi-robot SLAM system with elevation mapping and a costmap converter for easy navigation. Different odometry and loop closure algorithms can be easily integrated into the system.

License

Notifications You must be signed in to change notification settings

PigletPh/MR_SLAM

 
 

Repository files navigation


Logo

MR_SLAM

A modularized multi-robot SLAM system with elevation mapping and a costmap converter for easy navigation. Different odometry and loop closure algorithms can be easily integrated into the system.

View Demo · Report Bug · Request Feature

video video
Table of Contents
  1. About The Project
  2. Getting Started
  3. Quick Demo
  4. Full Usage
  5. Roadmap
  6. Citation
  7. Contributing
  8. License
  9. Contact

About The Project

This is a C++ library with ROS interfaces to manage multi-robot maps. It contains a pluggable front-end FAST-LIO2, pluggable loop closure methods DiSCO / RING. and a global manager that handles submaps, loop candidates and optimization results. The optimizer is mainly based on GTSAM and dist-mapper. The system provides a 3D pointcloud map and an optional 2.5D elevation map output. The output elevation map can be easily converted to a costmap for navigation.

Author: Peter XU (Xuecheng XU)
Affiliation: ZJU-Robotics Lab
Maintainer: Peter XU, [email protected]

(back to top)

NEWS (Jan, 2023): Support PCM

Support PCM (Pairwise Consistent Measurement) for robustness.

A chinese version of Tutorial is posted on my blog.

Getting Started

Here, we provide an example to demonstrate the system. Some parameters can be changed to fit your needs.

Prerequisites

This software is built on the Robotic Operating System (ROS tested on kinetic and melodic), which needs to be installed first. Additionally, the MR_SLAM depends on following software:

  • Eigen (linear algebra library, tested on 3.2.9 & 3.3.4; elevation_mapping failed on 3.3.9)

  • CUDA (gpu process)

  • Cython (C extensions for Python)

  • GTSAM (pose optimization)

  • Grid Map (grid map library for mobile robots)

    sudo apt install ros-$ROS_DISTRO-grid-map*
  • DiSCO (pluggable loop detector)

    Follow https://github.com/MaverickPeter/DiSCO-pytorch
  • RING (pluggable loop detector)

    Follow the README in LoopDetection/src/RING_ros
  • livox_ros_driver (for FAST_LIO2)

    Follow https://github.com/Livox-SDK/livox_ros_driver
  • Fast GICP (for ICP refine)

    # Fast GICP is already include in the repo. You can use 
    git submodule init --recursive
    git submodule sync
    git submodule update
    
    # or you can clone the repo and put them in the same place
    Follow https://github.com/SMRT-AIST/fast_gicp
  • (optional - for elevation_mapping) OctoMap (octomap library for multi-resolution)

    sudo apt install ros-$ROS_DISTRO-octomap*
  • (optional - for elevation_mapping) Kindr

    Follow https://github.com/anybotics/kindr

Installation

  1. Clone the repo
    git clone https://github.com/MaverickPeter/MR_SLAM.git
  2. Make Mapping
    cd Mapping && catkin_make
  3. Make Localization
    cd Localization && catkin_make
  4. Make LoopDetection
    cd LoopDetection && catkin_make
    
    # If you encounter the PyInit__tf2 issue, use catkin_make with your python3 environment
    catkin_make --cmake-args \
    -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/home/client/miniconda3/envs/py3/bin/python3.8 \
    -DPYTHON_INCLUDE_DIR=/home/client/miniconda3/envs/py3/include/python3.8 \
    -DPYTHON_LIBRARY=/home/client/miniconda3/envs/py3/lib/libpython3.8.so

(back to top)

Quick Demo

  1. Get rosbag from Google Drive or Baidu Pan with extract code: gupx

  2. Run roscore

  3. Run bag

    rosbag play 3_dog.bag --clock --pause
  4. Run DiSCO / RING

    # !!!!! You need to change the Python interpreter to your environment The default is mine: #!/home/client/miniconda3/envs/disco/bin/python3
    
    cd LoopDetection && source devel/setup.bash
    
    # DiSCO
    rosrun disco_ros main.py
    
    # RING: If you encounter the PyInit__tf2 issue, use catkin_make with your python3 environment. Check installation section. 
    cd src/RING_ros
    python main.py
       
    # Note that if you add #!/home/client/miniconda3/envs/disco/bin/python3 in the first line of RING_ros/main.py you can also use rosrun RING_ros main.py to start the node.
  5. Run global_manager

    cd Mapping && source devel/setup.bash
    roslaunch global_manager global_manager.launch
  6. Visualization

    rviz -d Visualization/vis.rviz

(back to top)

Full Usage

  1. Run roscore

  2. Run fast-lio (in 3 terminals)

    # Set parameters in Localization/src/FAST_LIO/launch/ and Localization/src/FAST_LIO/config/ !!You need to set the scan_publish_en to true to send submaps
    
    cd Localization && source devel/setup.bash
    roslaunch fast_lio robot_1.launch
    roslaunch fast_lio robot_2.launch
    roslaunch fast_lio robot_3.launch
  3. Run elevation_mapping (in 3 terminals)

    # Set parameters in Mapping/src/elevation_mapping_periodical/elevation_mapping_demos/launch/ and Mapping/src/elevation_mapping_periodical/elevation_mapping_demos/config/
    
    cd Mapping && source devel/setup.bash
    roslaunch elevation_mapping_demos robot_1.launch
    roslaunch elevation_mapping_demos robot_2.launch
    roslaunch elevation_mapping_demos robot_3.launch   
  4. Run preprocess tools (in 3 terminals)

    # If robots don't have cameras, you have to create fake images for elevation_mapping
    
    cd Tool/Fake_img
    python robot_1.py
    python robot_2.py
    python robot_3.py
    
    # If robots' point cloud are too large for real-time processing, you have to launch filters to accelerate.
    
    cd Tool/Filters
    roslaunch filter_robot_1.launch   
    roslaunch filter_robot_2.launch   
    roslaunch filter_robot_3.launch   
    
  5. Run loop detection module

    # You need to change the Python interpreter to your environment The default is mine: #!/home/client/miniconda3/envs/disco/bin/python3
    
    cd LoopDetection && source devel/setup.bash
    
    # DiSCO
    rosrun disco_ros main.py
    
    # RING
    cd src/RING_ros
    python main.py
  6. Run global_manager

    # Set parameters in Mapping/src/global_manager/launch/
    
    cd Mapping && source devel/setup.bash
    roslaunch global_manager global_manager.launch
  7. Visualization

    rviz -d Visualization/vis.rviz

(back to top)

Roadmap

  • Add PCM.
  • Optimize code.
  • Add more pluggable loop closure methods.
  • Support more front-end odometry.

See the open issues for a full list of proposed features (and known issues).

(back to top)

Citation

If you find this repo useful to your project, please consider to cite it with following bib:

@article{xu2022ring++,
      title={RING++: Roto-translation Invariant Gram for Global Localization on a Sparse Scan Map},
      author={Xu, Xuecheng and Lu, Sha and Wu, Jun and Lu, Haojian and Zhu, Qiuguo and Liao, Yiyi and Xiong, Rong and Wang, Yue},
      journal={arXiv preprint arXiv:2210.05984},
      year={2022}
}

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Xuecheng Xu - [email protected]

Project Link: https://github.com/MaverickPeter/MR_SLAM

(back to top)

About

A modularized multi-robot SLAM system with elevation mapping and a costmap converter for easy navigation. Different odometry and loop closure algorithms can be easily integrated into the system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 47.5%
  • Jupyter Notebook 39.4%
  • Python 9.4%
  • Cuda 2.0%
  • CMake 1.1%
  • C 0.4%
  • Other 0.2%