LVI-SAM-LOCALIZATION

A simple version of system that can localize in a built map is developed in this repository. This sysytem is based on LVI-SAM, and also there are some new features that we developed.

  • Through Visual-LiDAR Fusion Relocalization, the system can launch anywhere in the built map, and the Visual-LiDAR Fusion Relocalization is based on Bag-of-Words and Scan Context.
  • Use the C++ boost serialization, the system can change the folder map to binary format, so that reduce map loading time by more than 30%.
  • Real-time parameter tuning: The system can adjust algorithm parameters in real time according to the current robot working environment, CPU and memory usage, etc., to improve system performance.

A video of this project can be found on YouTube.

drawing


Dependency

The dependency of this repo is same as the official LVI-SAM. So if you occur a compile problem, we recommend you to compile the official LVI-SAM firstly. Right now we have only tested on Ubuntu 18.04 + ROS melodic environment.

In particular, this ropo relies on jsk-rviz-plugins to display text on rviz, so remember to install it.

sudo apt-get install ros-melodic-jsk-rviz-plugins

Compile

You can use the following commands to download and compile the package.

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/x-Yabao/lvi_sam_localization
cd ..
catkin_make

Prepare a built map

Take the M2DGR dataset for example.

  1. Fisrtly, you need to prepare a built map. Please run our another work lvi-sam-savemap to build and save the map in a folder.

  2. Change the above map to binary format, so that we can reduce the map loading time.

    • Make sure the config file is right.

    • Run the launch file:

    roslaunch lvi_sam_localization build_map_m2dgr.launch
    

Run the package

Take the M2DGR dataset for example.

  1. Make sure the config file is right.

  2. Run the launch file:

roslaunch lvi_sam_localization run_m2dgr.launch
  1. Play existing bag files:
rosbag play your-bag.bag

Notes

  • Initialization: During the initialization stage, had better keep the robot still. Or if you play bags, fistly play the bag for about 0.5s, and then pause the bag until the initialization succeed. If initialization failure, move the robot to another place, or play the bag for a few seconds, than activate relocation again by give it a random guess on the the Rviz.

Acknowledgement

TODO

  • Preprocess the built map and cut it into squares. Global localization extracts squares instead of keyframes when extracting local maps.
  • Try to use my own implementation of icp and ndt.