Coder Social home page Coder Social logo

cc19245 / lvi-sam-easyused Goto Github PK

View Code? Open in Web Editor NEW
210.0 3.0 38.0 202.32 MB

LVI-SAM for easier using (更简单的使用LVI-SAM的方法)

License: BSD 3-Clause "New" or "Revised" License

CMake 0.70% Dockerfile 0.16% Shell 0.05% C++ 98.80% C 0.29%

lvi-sam-easyused's Introduction

LVI-SAM-Easyused(中文README

This repository contains the modified code of LVI-SAM for easier using, which mainly solves the problem of ambiguous extrinsic configuration of the original LVI-SAM. Using this code, you only need to configure the extrinsic between LiDAR and IMU (T_imu_lidar), the extrinsic between Camera and IMU (T_imu_camera), and the properties of the IMU itself (which axis the IMU rotates around counterclockwise to get a positive Euler angle output), and then you can run LVI-SAM on different devices.

The test video on many datasets is available on YouTube (click below images to open) and Bilibili.

video

Update

  • The "new" branch is avaliable. We recommend you to use the "new" branch, because the LiDAR-Inertial system in the original LVI-SAM code repo uses an old version of LIO-SAM with some bugs, which have been fixed in the latest LIO-SAM code repo. At present, we have updated the latest version of LIO-SAM into LVI-SAM, so the system is more robust. You can use the following commands to download and compile the "new" branch.

    mkdir -p ~/catkin_ws/src 
    cd ~/catkin_ws/src
    git clone https://github.com/Cc19245/LVI-SAM-Easyused
    git checkout new
    cd ..
    catkin_make

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.


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/Cc19245/LVI-SAM-Easyused
cd ..
catkin_make

Note:If you want to use the no-modified code (origin LVI-SAM official code), you can change the defination in CMakeLists.txt and compile again.

################## 编译开关 compile switch##############
# -DIF_OFFICIAL=1: use origin official LVI-SAM code
# -DIF_OFFICIAL=0: use modified code of this repo
add_definitions(-DIF_OFFICIAL=0)

Params config

Sensors extrinsic config

  1. params_camera.yaml: set the VIO params, especially for T_imu_camera, which is the camera pose represented in IMU frame. It's same as VINS-Mono.
###################### extrinsic between IMU and Camera  ###########################
###################### T_IMU_Camera, Camera -> IMU       ###########################  
# R_imu_camera
extrinsicRotation: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 0,    0,    -1, 
               -1,     0,    0, 
                0,     1,    0]
# t_imu_camera
extrinsicTranslation: !!opencv-matrix
   rows: 3
   cols: 1
   dt: d
   data: [0.006422381632411965, 0.019939800449065116, 0.03364235163589248]
  1. params_lidar.yaml: set the LIO params, especially for T_imu_lidar, which is the lidar pose represented in IMU frame.
  ###################### extrinsic between IMU and LiDAR  ###########################
  ###################### T_IMU_LiDAR, LiDAR -> IMU       ############################
  # t_imu_lidar
  extrinsicTranslation: [0.0,   0.0,   0.0]    
  # R_imu_lidar
  extrinsicRotation: [-1,   0,    0, 
                                         0,    1,    0, 
                                         0,    0,   -1]

IMU property config

(Note: This is only the property of the IMU itself and has no relationship with its installation.)

Due to the special IMU (the Euler angle coordinate system is different from the acceleration and angular velocity coordinate system) of official dataset , you also need to set which axis the IMU rotates around counterclockwise to get a positive Euler angle output. For official sensor equipment, it is set as follows.

  ## 对绝大多数IMU来说,下面三个值分别是"+z", "+y", "+x" (for most of IMUs, the following config is "+z", "+y", "+x")
  # 绕着哪个轴逆时针转动,输出yaw角度为正(which axis the IMU rotates around counterclockwise to get a positive yaw angle)
  yawAxis: "-z"  
  # 绕着哪个轴逆时针转动,输出pitch角度为正(which axis the IMU rotates around counterclockwise to get a positive pitch angle)
  pitchAxis: "+x"    
  # 绕着哪个轴逆时针转动,输出roll角度为正(which axis the IMU rotates around counterclockwise to get a positive roll angle)
  rollAxis: "+y"    

drawing

For most of the IMUs, the Euler angle coordinate system is same as the acceleration and angular velocity coordinate system. So the above parameters should be set as follows.

  ## 对绝大多数IMU来说,下面三个值分别是"+z", "+y", "+x" (for most of IMUs, the following config is "+z", "+y", "+x")
  # 绕着哪个轴逆时针转动,输出yaw角度为正(which axis the IMU rotates around counterclockwise to get a positive yaw angle)
  yawAxis: "+z"  
  # 绕着哪个轴逆时针转动,输出pitch角度为正(which axis the IMU rotates around counterclockwise to get a positive pitch angle)
  pitchAxis: "+y"    
  # 绕着哪个轴逆时针转动,输出roll角度为正(which axis the IMU rotates around counterclockwise to get a positive roll angle)
  rollAxis: "+x"    

drawing


Run the package on different datasets

  1. Official dataset

    • Run the launch file:

      roslaunch lvi_sam run.launch
      

      Note: If you want to test the origin official LVI-SAM code (e.g. set add_definitions(-DIF_OFFICIAL=1) in CMakeLists.txt to compile), you should run launch file as following.

      roslaunch lvi_sam run_official.launch
      
    • Play existing bag files, e.g. handheld.bag:

      rosbag play handheld.bag 
      
    • Results of origin official code (up fig) and our modified code (down fig) on handheld.bag:

      drawing

      drawing

  2. M2DGR dataset

    • Run the launch file:

      roslaunch lvi_sam M2DGR.launch
      
    • Play existing bag files, e.g. gate_01.bag:

      rosbag play gate_01.bag 
      
    • Results of our modified code on gate_01.bag:

      drawing

  3. UrbanNavDataset

    • Run the launch file:

      roslaunch lvi_sam UrbanNavDataset.launch
      
    • Play existing bag files, the params we provided is for UrbanNav-HK-Data20200314. If you use other bag files of UrbanNavDataset, please check if the params need to be changed.

      rosbag play 2020-03-14-16-45-35.bag 
      
    • Results on UrbanNav-HK-Data20200314:

      drawing

  4. KITTI raw dataset

    • Run the launch file:

      roslaunch lvi_sam KITTI.launch
      
    • Play existing bag files. Please note that you must use KITTI raw dataset rather than KITTI Odometry dataset, because the latter's IMU frequency is too low. If you want to use KITTI raw dataset for LVI-SAM, you need to get rosbag files firstly. You can get it refer to LIO-SAM/config/doc/kitti2bag. Here we use KITTI_2011_09_26_drive_0084_synced raw data to get rosbag file. The transformed rosbag file can get at this link.

      rosbag play kitti_2011_09_26_drive_0084_synced.bag  
      
    • Results of our modified code on kitti_2011_09_26_drive_0084_synced.bag:

      drawing

  5. My test dataset

    • Run the launch file:

      roslaunch lvi_sam backbag.launch
      
    • Play existing bag files, e.g. backbag.bag:

      rosbag play backbag.bag 
      
    • Results of our modified code on backbag.bag:

      drawing

    • Results of our modified code on our own 0117-1525.bag (Device is different from backbag.bag, so it has another params. However, sorry for privacy issues, this data package can not open source):

      roslaunch lvi_sam ljj.launch
      rosbag play 0117-1525.bag 
      

      drawing

  6. KAIST Complex Urban Dataset

    See TODO.


TODO

  • More test on different dataset, e.g. KAIST Complex Urban Dataset. However, these datasets' lidar data have no ring information. So LVI-SAM can't run directly. If you want to run on these datasets, you need to modifidy the code to add this information refer to LeGO-LOAM.

  • We have test KAIST Complex Urban Dataset on "new" branch. We mainly made two changes:

    • We updated the latest version of LIO-SAM repo code into LVI-SAM, so the system is more robust and can run on KAIST Complex Urban Dataset successfully.
    • We generate rosbag from the origin KAIST Complex Urban Dataset, and recover the ringand time field of LiDAR pointcloud. You can using the ros package in doc/kaise-help to generate rosbags.
  • Test on KAIST Complex Urban Dataset urban26 sequence.

    • Run the launch file:

      roslaunch lvi_sam KAIST.launch
      
    • Play the generated bag files, e.g. urban26.bag:

      rosbag play urban26.bag 
      
    • Results of our modified code on urban26.bag:

      drawing

      drawing

      We can see that the trajectory has a large drift, and the loop closure doesn't be detected successfully. This may be due to the reason that the LiDAR of KAIST dataset is installed obliquely, resulting in too few valid pointclouds for registration.


Notes


Acknowledgement

lvi-sam-easyused's People

Contributors

cc19245 avatar chenc111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lvi-sam-easyused's Issues

关于KITTI数据集的问题

大佬,我跑KITTI数据集的序列00,在150s左右轨迹会原地不动,很奇怪,我把VIO关了只跑LIO,也是这样。但是,我下载LIO-SAM测试,就没这个问题,想问问你知道是什么问题嘛?非常感谢!

NTU数据集SLAM运行失败

十分感谢您的工作!这对我非常有帮助!
我尝试在NTU数据集(https://ntu-aris.github.io/ntu_viral_dataset/)
上运行您的改进代码,但得到的地图是z轴颠倒的,算法估计轨迹的漂移也很大,下面是我的param列表
#camera

image_width: 752
image_height: 480
distortion_parameters:
k1: -0.300267420221178
k2: 0.090544063693053
p1: 3.330220891093334e-05
p2: 8.989607188457415e-05
projection_parameters:
fx: 4.313364265799752e+02
fy: 4.327527965378035e+02
cx: 3.548956286992647e+02
cy: 2.325508916495161e+02

acc_n: 6.0e-2 # accelerometer measurement noise standard deviation.
gyr_n: 5.0e-3 # gyroscope measurement noise standard deviation.
acc_w: 8.0e-5 # accelerometer bias random work noise standard deviation.
gyr_w: 3.0e-6 # gyroscope bias random work noise standard deviation.
g_norm: 9.805

extrinsicRotation: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [-0.01916508, -0.01496218, 0.99970437,
0.99974371, 0.01176483, 0.01934191,
-0.01205075, 0.99981884, 0.01473287]
#Translation from camera frame to imu frame, imu^T_cam
extrinsicTranslation: !!opencv-matrix
rows: 3
cols: 1
dt: d
data: [0.00519443, 0.1347802, 0.01465067]

#lidar
extrinsicTranslation: [0.05, 0.0, -0.055]
extrinsicRotation: [ 1, 0, 0,
0, -1, 0,
0, 0, -1]

Vio does not publish information

Insufficient movement of the Lidar device during initialization
Poor lighting conditions
Insufficient sensor data
Incorrect device calibration

运行时间问题

您好,感谢您的工作!
我运行了您的旧版和新版(new分支)代码,发现某些代码的时间消耗有很大差距,
比如特征提取操作,在extractFeatures()函数中,旧版的耗时约为69.5 msec,而新版的耗时约为5.87 msec
我认为是LIO-SAM部分的更新带来的问题,但始终找不到原因,令我非常头疼。
请问您对此有没有什么想法?有可能是那部分导致的运行时间差异?

關於使用的設備

您好 想請問您錄製數據集時使用的硬體配置 鏡頭可使用一般鏡頭嗎?

求助编译时候出现的问题

Traceback (most recent call last):
File "/opt/ros/melodic/share/genpy/cmake/../../../lib/genpy/genmsg_py.py", line 43, in
import genpy.generator
File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/init.py", line 34, in
from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/message.py", line 48, in
import yaml
File "/usr/lib/python3/dist-packages/yaml/init.py", line 284
class YAMLObject(metaclass=YAMLObjectMetaclass):
^
SyntaxError: invalid syntax
LVI-SAM-Easyused/CMakeFiles/lvi_sam_generate_messages_py.dir/build.make:67: recipe for target '/home/lya/test01_ws/devel/lib/python2.7/dist-packages/lvi_sam/msg/_cloud_info.py' failed
make[2]: *** [/home/lya/test01_ws/devel/lib/python2.7/dist-packages/lvi_sam/msg/_cloud_info.py] Error 1
CMakeFiles/Makefile2:3043: recipe for target 'LVI-SAM-Easyused/CMakeFiles/lvi_sam_generate_messages_py.dir/all' failed
make[1]: *** [LVI-SAM-Easyused/CMakeFiles/lvi_sam_generate_messages_py.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j1" failed
求助

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.