Demo video: bilibili
A real-time multifunctional Lidar SLAM package. It has dual functions of Mapping and Localization. Supports multiple types of IMUs(6-axis and 9-axis) and Lidars(Velodyne, Livox Avia, Livox Mid 360, RoboSense, Ouster, etc). Supports various types of frontends, such as LOAM, NDT, ICP, etc. Supports multiple fusion methods, such as Kalman filter, optimization method, etc. Support multiple LoopClosure methods. The overall accuracy and efficiency are close to the current state-of-the-art methods.
- Supports multiple IMU types.
- Supports multiple fusion methods.
- Supports Mapping and Localization.
- Supports multiple LoopClosure methods.
- Supports multiple Lidar types, and customize Lidar type.
- Supports multiple pointcloud registration methods, and easily extendable to other registration methods.
Features | Details |
---|---|
IMU Types | 6-axis, 9-axis. |
Lidar Types | Solid State Lidar(Mid-360, Avia, etc), Mechanical Lidar(Velodyne, Robosense, Ouster, etc), etc. |
Registration Methods | Loam Series, Optimized-ICP, Incremental-NDT, even customizable via plug-in. |
LoopClosure Methods (only Mapping mode) |
Euclidean distance based, Feature based. |
Fusion Methods | Loose Coupling, Kalman Filter, Optimization. |
Ubuntu >= 20.04 && ROS Noetic && C++17 Compiler
For Ubuntu 20.04 or higher. After installing ROS, most of the dependent libraries have been installed, including the PCL/Eigen/CMake/etc.
sudo apt-get install libgoogle-glog-dev libgflags-dev libgtest-dev
sudo apt install libeigen3-dev libspdlog-dev libsuitesparse-dev qtdeclarative5-dev qt5-qmake libqglviewer-dev-qt5 # g2o requirements
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ..
make -j
sudo make install
mkdir -p funny_lidar_slam_ws/src
cd funny_lidar_slam_ws/src
git clone https://github.com/zm0612/funny_lidar_slam.git
cd ../
catkin_make -j
source devel/setup.bash
If you want to use docker conatiner to run Funny Lidar SLAM, please install the docker on you machine. Follow Docker Installation.
git clone https://github.com/zm0612/funny_lidar_slam.git
cd funny_lidar_slam
docker build -f Dockerfile -t funny_lidar_slam:v0 .
cd docker
sudo chmod +x run.sh
bash run.sh
Tips:
-
When the above commands are executed correctly, you will enter the virtual terminal of the funny_lidar_slam container. Refer to the following to perform Mapping and Localization.
-
Please copy your bag data to the host's directory
funny_lidar_slam/data
. Then you can play them in the container.
Funny-Lidar-SLAM is a multi-functional Lidar SLAM package. You can freely choose the Lidar model, 6-axis or 9-axis IMU , and registration method. To help you get started quickly, here I provide some of my examples on some open source datasets. Of course you can also try other combinations.
cd funny_lidar_slam_ws
source devel/setup.bash
roslaunch funny_lidar_slam mapping_M2DGR.launch
rosbag play street_02.bag # Play one of the sets of data
cd funny_lidar_slam_ws
source devel/setup.bash
roslaunch funny_lidar_slam mapping_nclt.launch
rosbag play 20130110.bag # Play one of the sets of data
The test dataset comes from: LIO-SAM dataset. You can also get part of the dataset from Baidu Pan for testing.
cd funny_lidar_slam_ws
source devel/setup.bash
roslaunch funny_lidar_slam mapping_lio_sam.launch
rosbag play walking_dataset.bag # Play one of the sets of data
You can download the Livox Mid-360 data from: Baidu Pan
cd funny_lidar_slam_ws
source devel/setup.bash
roslaunch funny_lidar_slam mapping_mid360.launch
rosbag play mid_360.bag # Play one of the sets of data
Note: If your Mid-360 format is livox_ros_driver2/CustomMsg
, you can use 4.4 For Livox Avia
to run.
You can download the Livox Avia data from: Baidu Pan.
cd funny_lidar_slam_ws
source devel/setup.bash
roslaunch funny_lidar_slam mapping_livox_avia.launch
rosbag play avia.bag # Play one of the sets of data
Note: If your Livox Avia format is sensor_msgs/PointCloud2
, you can use 4.3 For Livox Mid-360
to run.
You can download the data from: Baidu Pan
cd funny_lidar_slam_ws
source devel/setup.bash
roslaunch funny_lidar_slam mapping_turing.launch
rosbag play our.bag # Play one of the sets of data
cd funny_lidar_slam_ws
source devel/setup.bash
rosservice call /funny_lidar_slam/save_map "map_path: '' split_map: false"
Note:
map_path
: is the path where the map is stored. If map_path
is empty, the default path funny_lidar_slam/data
is used for saving. If you want to save the map to a specific path, set map_path
. For example: "map_path: '/home/xx/xxx.pcd'"
split_map
: Whether to divide the map into blocks.
Copy your pointcloud map to the funny_lidar_slam/data
directory and change its name to map.pcd
. If you don’t have a pointcloud map, you can generate one according to Section 4.
- For Livox Mid 360
roslaunch funny_lidar_slam localization_mid_360.launch
- For Velodyne-32
roslaunch funny_lidar_slam localization_nclt.launch
- For RoboSense-16
roslaunch funny_lidar_slam localization_turing.launch
Note: Other Lidar models can be configured by referring to the above examples.
After running the Localization program, you need to play the bag and set the initial pose.
The localization program does not have a global relocalization function, so the initial position and orientation need to be set manually. For convenience, I use the 2D Pose Estimate
plugin in RVIZ to set the initial pose. If the initial pose effect is not good, you can try to use 2D Pose Estimate
multiple times to set the pose.
- If your IMU is 6-axis, and the fusion method is optimization, you need to ensure that your IMU and Lidar are stationary for at least two seconds before starting to run Mapping or Localization.
- When you run the Mapping program, the default Rviz configuration will be started. In order to reduce resource usage, the pointcloud map is displayed roughly. If you want to display richer details, pass the Rviz configuration path when running the Mapping launch file. For example:
roslaunch funny_lidar_slam mapping_xxx.launch rviz_config:=/path/to/funny_lidar_slam/launch/display_detailed_without_loopclosure.rviz