jedeschaud / ct_icp

CT-ICP: Continuous-Time LiDAR Odometry
MIT License
737 stars 126 forks source link
ct-icp lidar odometry robotics ros slam

CT_ICP_LOGO

This repository implements the SLAM CT-ICP (see our article), a lightweight, precise and versatile pure LiDAR odometry.

The code can be run with ROS, but also as an independent library, or using scripts we provide.

It is integrated with the python project pyLiDAR-SLAM which gives access to more datasets. pyLiDAR-SLAM requires the installation of the python binding for CT-ICP (see below).

NEWS:

[27/07/2022] New release, with increased ROS support

We introduce a new release, with significant changes in the code. We do not guarantee the results of the article in this branch, (though this branch should globally our SLAM). To replicate the results from the dataset, see the release ICRA-2022

Installation

Requirements

Compiler: GCC >= 7.5, clang >= 8.01

cmake >= 3.14

Tested On:
OS COMPILER
Ubuntu 18.04 GCC >= 7.5
Ubuntu 18.04 clang >= 8.01

Step 0: Clone the directory

git clone https://github.com/jedeschaud/ct_icp.git
cd ct_icp

Step 1: Superbuild

CT-ICP uses Kitware's Superbuild to build the external dependencies.

You can either install the external dependencies, or use the script below to install all dependencies:

mkdir .cmake-build-superbuild && cd .cmake-build-superbuild     #< Creates the cmake folder
cmake ../superbuild                                             #< (1) Configure step 
cmake --build . --config Release                                #< Build step (Downloads and install the dependencies), add -DWITH_VIZ3D=ON to install with the GUI

/!\ If you want to build the visualization do not forget to add -DWITH_VIZ3D=ON

If everything worked, a directory install should have been created with at its root a superbuild_import.cmake file.

Step 2: Build and install CT-ICP library

# Inside the main directory
mkdir cmake-build-release && cd  cmake-build-release                  #< Create the build directory
cmake .. -DCMAKE_BUILD_TYPE=Release                                   #< (2) Configure with the desired options (specify arguments with -D<arg_name>=<arg_value>), add -DWITH_VIZ3D=ON to install with the GUI
cmake --build . --target install --config Release --parallel 12       #< Build and Install the project

/!\ If you want to build the visualization do not forget to add -DWITH_VIZ3D=ON

If everything worked fine, a CT_ICP subdirectory should appear in your Superbuild Directory. You can use the config files located at <SUPERBUILD_INSTALL_DIR>/CT_ICP/lib/cmake to load the libraries in a cmake project, or use ROS or the specified executables.

Step 3: ROS

To build the ROS wrapping for CT-ICP, first build and install the CT-ICP library (see Steps 1 and 2 ).

/!\ Set the CMAKE argument -DWITH_ROS=ON to the configure step (1) of the superbuild (Step 1)

Install the ROSCore library, (this should install a shared library named ROSCore at <CT_ICP_INSTALL_DIR>/CT_ICP/lib):

cd ros/roscore
mkdir cmake-build-release && cd  cmake-build-release                  #< Create the build directory
cmake .. -DCMAKE_BUILD_TYPE=Release                                   #< (2) Configure with the desired options (specify arguments with -D<arg_name>=<arg_value>)
cmake --build . --target install --config Release --parallel 12       #< Build and Install the ROSCore library

Then make a symbolic link of the directory ct_icp_odometry and slam_roscore of this project to the src directory of your catkin workspace.

cd <path-to-your-catkin-workspace>/src                              #< Move to the Catkin Workspace's src directory
ln -s <path-to-ct_icp-git-project>/ros/catkin_ws/ct_icp_odometry ct_icp_odometry        #< Make a symbolic link to the `catkin_ws` folder
ln -s <path-to-ct_icp-git-project>/ros/catkin_ws/slam_roscore slam_roscore        #< Make a symbolic link to the `catkin_ws` folder
cd ..                                                               #< Move back to the root of the catkin workspace
catkin_make -DSUPERBUILD_INSTALL_DIR=<path-to-superbuild-install-dir>

If the installation is successful, and after sourcing the workspace's devel directory, you should be able to launch the ROS Nodes installed.

The wrapping defines the following nodes:

roslaunch ct_icp_odometry launch_slam_dataset.launch dataset_path:=<path-to-dataset-root> dataset:=<dataset_name> sequence:=<sequence_name>

//: # ()

Install the Datasets

CT-ICP Datasets from the article

The Datasets are publicly available at: https://cloud.mines-paristech.fr/index.php/s/UwgVFtiTOmrgKp5

The folder is protected by the following password : npm3d

Each dataset is a .zip archive containing the PLY scan file with the relative timestamps for each point in the frame, and if available, the ground truth poses.

To install each dataset, simply download and extract the archives on disk. The datasets are redistributions of existing and copyrighted datasets, we only offer a convenient repackaging of these datasets.

The dataset available are the following:

Under Creative Commons Attribution-NonCommercial-ShareAlike LICENCE

Permissive LICENSE

Download ROSBAGS to run the SLAM with ROS

Below we give a list of datasets for we worked on the ROSBags, and for which we propose a roslaunch file.

For more datasets, don't hesitate to look at this awesome list [List of SLAM Datasets](https://github.com/youngguncho/awesome-slam-datasets#mapping()).

Running the SLAM

OPTION I -- Using the scripts (on the ct-icp datasets)

If the installation of CT-ICP went fine, there should be an executable located at <CT_ICP_INSTALL_DIR>/bin/run_odometry. This executable can be run with a config file with the command:

./run_odometry -c <path-to-config-file>

See ./config/odometry/driving_config.yaml for an example of the format of the config file to expect.

If CT-ICP was installed with viz3d, the SLAM should run along a GUI, otherwise, the trajectory and metrics will be saved to disk regularly.

OPTION II -- Using the SLAM as a library

After the installation, you can also use CT_ICP and SlamCore libraries, located in <CT_ICP_INSTALL_DIR>/lib, for instance with a cmake project with the cmake config files for the libraries located at <CT_ICP_INSTALL_DIR>/lib/cmake.

See for example command/cmd_run_odometry.cpp and command/odometry_runner.h for an example of use.

Custom Datasets

Some datasets are defined in the library (with expected layout for the Data, see dataset.h, dataset.cpp), but you can extend ct_icp::ADatasetSequence to define your own custom datasets.

OPTION III -- Using ROS

After completing the ROS installation, use the launch files defined in ros/catkin_ws/ct_icp_odometry/launch on a rosbag to launch the odometry, for e.g:

roslaunch ct_icp_odometry urban_loco_CAL.launch rosbag:=<path-to-UrbanLoco-root>/CA-20190828190411_blur_align.bag

Citation

If you use our work in your research project, please consider citing:

@misc{dellenbach2021cticp,
  title={CT-ICP: Real-time Elastic LiDAR Odometry with Loop Closure},
  author={Pierre Dellenbach and Jean-Emmanuel Deschaud and Bastien Jacquet and François Goulette},
  year={2021},
  eprint={2109.12979},
  archivePrefix={arXiv},
  primaryClass={cs.RO}
}

TODO(s)