Giter Club home page Giter Club logo

loam_livox's Introduction

LOAM-Livox

A robust LiDAR Odometry and Mapping (LOAM) package for Livox-LiDAR

Loam-Livox is a robust, low drift, and real time odometry and mapping package for Livox LiDARs, significant low cost and high performance LiDARs that are designed for massive industrials uses. Our package address many key issues: feature extraction and selection in a very limited FOV, robust outliers rejection, moving objects filtering, and motion distortion compensation. In addition, we also integrate other features like parallelable pipeline, point cloud management using cells and maps, loop closure, utilities for maps saving and reload, etc. To know more about the details, please refer to our related paper:)

In the development of our package, we reference to LOAM, LOAM_NOTED, and A-LOAM.

Developer: Jiarong Lin

Our related paper: our related papers are now available on arxiv:

  1. Loam_livox: A fast, robust, high-precision LiDAR odometry and mapping package for LiDARs of small FoV
  2. A fast, complete, point cloud based loop closure for LiDAR odometry and mapping

Our related video: our related videos are now available on YouTube (click below images to open):

video video

1. Prerequisites

1.1 Ubuntu and ROS

Ubuntu 64-bit 16.04 or 18.04. ROS Kinetic or Melodic. ROS Installation and its additional ROS pacakge:

    sudo apt-get install ros-XXX-cv-bridge ros-XXX-tf ros-XXX-message-filters ros-XXX-image-transport

NOTICE: remember to replace "XXX" on above command as your ROS distributions, for example, if your use ROS-kinetic, the command should be:

    sudo apt-get install ros-kinetic-cv-bridge ros-kinetic-tf ros-kinetic-message-filters ros-kinetic-image-transport

1.2. Ceres Solver

Follow Ceres Installation.

1.3. PCL

Follow PCL Installation.

NOTICE: Recently, we find that the point cloud output form the voxelgrid filter vary form PCL 1.7 and 1.9, and PCL 1.7 leads some failure in some of our examples (issue #28). By this, we strongly recommand you to use update your PCL as version 1.9 if you are using the lower version.

2. Build

Clone the repository and catkin_make:

    cd ~/catkin_ws/src
    git clone https://github.com/hku-mars/loam_livox.git
    cd ../
    catkin_make
    source ~/catkin_ws/devel/setup.bash

3. Directly run

3.1 Livox Mid-40

Connect to your PC to Livox LiDAR (Mid-40) by following Livox-ros-driver installation, then (launch our algorithm first, then livox-ros-driver):

    roslaunch loam_livox livox.launch
    roslaunch livox_ros_driver livox_lidar.launch

3.2 Livox Mid-100

Unfortunately, the default configuration of Livox-ros-driver mix all three lidar point cloud as together, which causes some difficulties in our feature extraction and motion blur compensation. By this, some of the adaptations (modify some configurations) are required to launch our package.

For more details, please kindly refer our tutorials (click me to open).

4. Rosbag Example

4.1. Common rosbag

Download Our recorded rosbag and then

roslaunch loam_livox rosbag.launch
rosbag play YOUR_DOWNLOADED.bag

4.1. Large-scale rosbag

For large scale rosbag (for example, the HKUST_01.bag ), we recommand you launch with bigger line and plane resolution (using rosbag_largescale.launch)

roslaunch loam_livox rosbag_largescale.launch
rosbag play YOUR_DOWNLOADED.bag

4.2 Livox Mid-100 example

Download our recorded rosbag files (mid100_example.bag ), then:

roslaunch loam_livox rosbag_mid100.launch
rosbag play mid100_example.bag

5. Rosbag Example with loop closure enabled

5.1. Loop closure demostration

We provide a rosbag file of small size (named "loop_loop_hku_zym.bag", Download here) for demostration:

roslaunch loam_livox rosbag_loop_simple.launch
rosbag play YOUR_PATH/loop_simple.bag

5.2. Other examples

For other example (loop_loop_hku_zym.bag, loop_hku_main.bag), launch with:

roslaunch loam_livox rosbag_loop.launch
rosbag play YOUR_DOWNLOADED.bag

NOTICE: The only difference between launch files "rosbag_loop_simple.launch" and "rosbag_loop.launch" is the minimum number of keyframes (minimum_keyframe_differen) between two candidate frames of loop detection.

6. Have troubles in downloading the rosbag files?

If you have some troubles in downloading the rosbag files form google net-disk (like issue #33), you can download the same files from Baidu net-disk.

Link(链接): https://pan.baidu.com/s/1nMSJRuP8io8mEqLgACUT_w
Extraction code(提取码): sv9z

If the share link is disabled, please feel free to email me ([email protected]) for updating the link as soon as possible.

7. Our 3D-printable handheld device

To get our following handheld device, please go to another one of our open source reposity, all of the 3D parts are all designed of FDM printable. We also release our solidwork files so that you can freely make your own adjustments.

8.Acknowledgments

Thanks for LOAM(J. Zhang and S. Singh. LOAM: Lidar Odometry and Mapping in Real-time) LOAM, LOAM_NOTED, and A-LOAM.

9. License

The source code is released under GPLv2 license.

We are still working on improving the performance and reliability of our codes. For any technical issues, please contact me via email Jiarong Lin < [email protected] >.

For commercial use, please contact Dr. Fu Zhang < [email protected] >

loam_livox's People

Contributors

griz1112 avatar ziv-lin 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  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

loam_livox's Issues

initial trans value between curr anchor keyframe and history keyframe, before loop calculate

Hi @ziv-lin, when we detect there is a potential loop, before we use different voxel resolution to filter the curr anchor keyframe and history anchor history keyframe, we set the initial trans use keyframe's center, link is here. I guess we calculate transform is: the TF from curr to history in world frame. Here the transform direction is reffering to frame, not vectors in frame. Why we don't set the trans initial is history minus curr,

Eigen::Matrix< double, 3, 1 > transform_T =
( keyframe_b->get_center() - keyframe_a->get_center() ).template cast< double >();

It is the vector from curr to history. Thanks for your help very much!

How to save the pointcloud as pcd

First, thanks for your code and bag.But when I try to transform the pointcloud to the pcd.Here is a question:
图片
/opt/ros/kinetic/lib/pcl_ros/pointcloud_to_pcd: error while loading shared libraries: libpcl_io.so.1.7: cannot open shared object file: No such file or directory

But how could I find the libpcl_io.so.1.7 when I use the pcl1.9?

I would be very happy for yous any reply!

[Question] Livox Horizon compatibility

Hi,

I saw the Livox Horizon device and thought this would be a good match for this kind of software.
Before I buy such a device I want to make sure it will be compatible with this Software or at least I want to help making it compatible.

Thanks for this awesome project!

CU
KirK

unable to reproduce experimental results

Hi,Thanks for your open source.I test the new code on Ubuntu16.04 && ROS Kinetic.But I cannot reproduce experimental results using the example data——loop-simple.bag.
Here are some screen shots.
a)loop close error
Selection_006

b)big delay
Selection_005

c)ceres-solver optimization error
Selection_004

Any suggestions?

bag path do not exist

I try to roslaunch the program with the downloaded file and try to input like this:
roslaunch loam_livox rosbag.launch rosbag play /home/Downloads/CYT_02.bag
get the roslaunch error: The following input files do not exist: /home/Downloads/CYT_02.bag, I don't know why?

about edges from reflectivity & e_pt_reflectivity_high

Jiarong, Thanks for sharing your great work!
In the current version from Github, does it use edges from reflectivity and filter out points with e_pt_reflectivity_high? I do see it filters out points with e_pt_reflectivity_low.

thanks

some problem in eigen_math.hpp

template <typename T>
static T vector_project_on_vector( const T &vec_a, const T &vec_b )
{
    return vec_a.dot( vec_b ) * vec_b / ( vec_b.norm() * vec_b.norm() );
}

template <typename T>
static T vector_project_on_unit_vector( const T &vec_a, const T &vec_b )
{
    return vec_a.dot( vec_b ) * vec_b;
}

您好,感谢您的工作!我在研究代码时,对上面这段代码有点疑惑(在eigen_math.hpp中)。这两个函数的名称本意和实现方式是否搞反了呢?下面那个函数本意是想投影到单位向量,但是实现方式却错了。
ceres_icp.hpp中调用的是vector_project_on_unit_vector,看了代码原理,确实应该是vec_a投影在vec_b的单位向量上。
期待您的回复,谢谢!

Add curr frame's points into m_keyframe_of_updating_list

Hi @ziv-lin, after transformed curr's points into map, when insert these celles into m_keyframe_of_updating_list called in add_cells into each keyframe of updating_list, we only insert the first cell into each keyframe, right? why we don't insert all of cells into each of them?
Thanks for your help!

    FUNC_T void add_cells( const std::set< Mapping_cell_ptr > &cells_vec )
    {
	unsigned int last_cell_numbers = 0;
	for ( typename std::set< Mapping_cell_ptr >::iterator it = cells_vec.begin(); it != cells_vec.end(); it++ )
	{
	    m_set_cell.insert( *( it ) );
	    m_map_pt_cell.insert( std::make_pair((*(it))->get_center(), *it) );
	    if(last_cell_numbers!= m_set_cell.size()) // New different cell
	    {
	        if(last_cell_numbers == 0)
	        {
	            // Init octree
	            m_pcl_cells_center->push_back( pcl::PointXYZ( (*it)->m_center( 0 ), (*it)->m_center( 1 ), (*it)->m_center( 2 ) ) );
	        }
	        last_cell_numbers = m_set_cell.size();
	    }
	};
	m_accumulate_frames++;
    }

ScanRegistration keeps crashing.

While driving the robot around if I yaw too quickly ScanRegistration crashes with exit code -11. Sometimes it happens while just driving straight ahead. Is there a way to turn off loop closure ?

Which version of PCL are we using in this repo?

Hello,

I am using Ubuntu 16.04 LTS and installed kinetic version of ROS (which has PCL 1.7 installed). I encountered these error when I catkin_make under my catkin workspace:

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libpcl_features.so: undefined reference to `_ZNK3pcl6search6SearchINS_11PointXYZRGBEE12radiusSearchERKNS_10PointCloudIS2_EEidRSp6vectorIiSaIiEERS8_IfSaIfEEj'
collect2: error: ld returned 1 exit status
loam_livox/CMakeFiles/livox_scanRegistration.dir/build.make:462: recipe for target '/home/derek/workspace/ros/devel/lib/loam_livox/livox_scanRegistration' failed
make[2]: *** [/home/derek/workspace/ros/devel/lib/loam_livox/livox_scanRegistration] Error 1
CMakeFiles/Makefile2:7030: recipe for target 'loam_livox/CMakeFiles/livox_scanRegistration.dir/all' failed
make[1]: *** [loam_livox/CMakeFiles/livox_scanRegistration.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Thanks in advance!

How to export/save the pointcloud from the rivz?

Hi, I wonder how can I export the result to *.pcd files. Now I have recorded a rosbag file, and it looks good in rviz, but I can't get the coordinates of the points. How can I export them to *.pcd files? Then I can process them in pcl. Thank you!

play the given rosbag and scanRegistration crashed

Hello, I am trying to use the given rosbag to recreate the result, I followed the readme, used the command: roslaunch loam_livox rosbag.launch + rosbag play HKU_ZYM.bag, but the process scanRegistration was crashed right after I played the rosbag, and I got the message as followed:

problem

I am not sure if it is the same issue as the issue #34, but I have updated to the latest version but still have this problem, please take a look, thanks a lot!

Run KITTI Dataset

Thanks for sharing code.
I tried to use this code to run KITTI Data. I changed three places of rosbag.launch:

  1. scan_line -> 64
  2. lidar_type -> velodyne
  3. remap from="/laser_points" to = "/livox/lidar" -> remap from="/laser_points" to = "/kitti/velo/pointcloud"
    but nothing shows up. I don't know why. Please help me.

Drop lidar frame in mapping

Hi,
thanks for your project. when I run "roslaunch loam_livox livox.launch", I get the warning like this:
[ WARN] [1575016816.066039723]: Drop lidar frame in mapping for real time performance !!!
Is that something wrong? Can you give me some advices?

sometimes not trigger loop under the same params and dataset

Hi @ziv-lin , i use rosbag_loop.launch and don't modify any param in performance_precision.yaml , play with loop_hku_zym.bag. I run the demo 5 times, and i found sometimes it doesn't trigger loop, but sometimes it can. Did you meet this ? Here is This is the result of a experiment not loop.
image

About the livox data pre-process

Hi,recently i get a livox sensor, due to their unique Non-repetitive Scanning Technology, the adjacent frame differs a lot, it's hard to do frame-frame match work.
do you have any papers relative to this project, or do you have any introductions to their unique Non-repetitive Scanning Technology. Thanks a lot

time Map corner and surf num are not enough?

Hi,
when I run "roslaunch loam_livox livox.launch
"
the terminal print

[ WARN] [1571727835.757896886]: time Map corner and surf num are not enough ****** min max timestamp = [29.464680, 29.512922] ****** map corner num 0 surf num 108 [ WARN] [1571727835.807914851]: time Map corner and surf num are not enough ****** min max timestamp = [29.512922, 29.558619] ****** map corner num 0 surf num 108 [ WARN] [1571727835.858688485]: time Map corner and surf num are not enough ****** min max timestamp = [29.558619, 29.609156] ****** map corner num 0 surf num 108 [ WARN] [1571727835.908180349]: time Map corner and surf num are not enough ^C****** min max timestamp = [29.609156, 29.669964] ****** map corner num 0 surf num 108 [ WARN] [1571727835.958653270]: time Map corner and surf num are not enough

Is that something wrong?

Is there a data interface for velodyne lidar?

First of all, thank you very much for the exciting work of open source. When I read the source code, I found that the Velodyne option is provided in laser_feature_extractor.hpp. I tried to modify and compile, but rviz showed nothing when playing the rosbag of the Velodyne lidar.
Is it possible to use Velodyne radar by changing the parameters? Thank you very much!

Interfacing to ROS nav stack (Question)

Trying to start up ROS navigation stack with output from loam-livox. Not having much luck. Is there a document that explains the topics published by loam-livox? Can you point me to resources explaining how to do this?

Why there are some points on the trajectory?

Hi!I use rosbag_mid100.launch to processing data from livox-mid100. The result is better than livox-mid40. But, why there are some points on the trajectory in /velodyne_cloud_registered and /laser_cloud_surround? I checked the raw data and there are no these points. How can I delete these points?
Screenshot from 2020-01-04 18-27-14
Screenshot from 2020-01-04 18-28-15
Screenshot from 2020-01-04 18-28-45

how to understand " laserCloudIn.points[ idx ].x == 0 " ?

if ( laserCloudIn.points[ idx ].x == 0 )

if ( laserCloudIn.points[ idx ].x == 0 )
{
if ( idx == 0 )
{
// TODO: handle this case.
std::cout << "First point should be normal!!!" << std::endl;
return 0;
}
else
{
pt_info->pt_2d_img = m_pts_info_vec[ idx - 1 ].pt_2d_img;
pt_info->polar_dis_sq2 = m_pts_info_vec[ idx - 1 ].polar_dis_sq2;
//cout << "Add mask, id = " << idx << " type = e_point_000" << endl;
add_mask_of_point( pt_info, e_pt_000 );
continue;
}
}

Poor quality not matching demo material

Thank you for your excellent work but I'm unable to match results of demo material . Testing inside of an interior space 5x5x5 meters and the result looks more like a ball of yarn , Is this a limitation of Loam or something I'm doing wrong

the setup is on a tripod yet the mapping location is jittering all over the place

laser mapping crash after loop closure

Hi,I found that laser mapping will crash after loop closure.It happens both on rosbag_loop_simple and rosbag_loop.Here are some screen shots.
loop_simple
image
loop
image

Any suggestions?

迁移到windows

您好,感谢您的付出。我想请问你们有没有尝试过在windows上运行算法。我想迁移到windows上,请问您有什么建议吗?例如ros的版本要求,pcl的版本要求。

Problems getting this working with ROS navigation stack

I'm trying to integrate loam-livox with the ROS nav stack on my rover. The stack is working with a ZED camera and Rtabmap now. When I try and switch it over to loam-livox I can see the map if I run velodyne_cloud_registered into octomap_server. So that appears to be working. However when the robot moves I see the aft_mapped odometry moving but its not moving the robot model in rviz like its supposed too. Noticed that loam-livox doesn't publish odom or map like the other mapping software I've used does. So thinking that incorrect setup of the tf is what is causing my issue. Have you used it with ROS navigation?

livox_laserMapping crashes

Hello,
The livox_laserMapping node is crashing with some sort of memory issue:

 Error in `/home/finostro/Code/ros_ws/devel/lib/loam_livox/livox_laserMapping': double free or corruption (out): 0x00007fdcaddc1bc0 

Maybe you could run your code with address sanitizer to check for memory problems?

Cheers

Running large_scale demo died.

Hi, great contributors,

Today i'm testing your awesome project. I downloaded the large-scale HKUST_01.bag . But it somehow corrupted after a few seconds.

This is my terminal and problem:
livoxPro2
livoxPro1

Looking forward to your reply.
THANKS

Problems building V2

How did you build this under ROS? When I try it fails looking for a function that isn't in the opencv libs that ROS installs. I built ROS from source and got it to compile but no livox/scan or velodyne_cloud_registered messages when I start it that way. I built ROS with opencv3.4.3 and that takes care of the missing function which was introduced in 3.3.2 from what I've read. Nvidia Xavier installs 3.3.1 as part of the flash. If any 3.3.1 or 3.2 opencv libs exist it fails. The error is undefined reference to cv::Mat::updateContinuityFlag().

CmakeLists.txt not correct for melodic

The CMakeLists.txt file in the src directory refers to kinetic only. I've built it and it runs on melodic with out changing the soft link but I'm wondering if this needs to point to the correct toplevel.cmake file for the version of ROS you are running? Also with other mapping packages I've been using the package provides an odom and map frame. Are there any plans to add this?

How do you recreate your work

Hello, thank you for your amazing work, but I am not quite clear about what to do after connecting lidar, could you please provide a detailed operation instruction

Issue with TF

Managed to get loam-livox working with the ROS navigation stack. Using octomap_server to create a 2-d map from velodyne_cloud_registered for the costmaps. I did run into an issue though. When I first set it up there were constant errors from ros_tf2 complaining about / in front of the camera_init frame. Tf2 doesn't allow / in front of frame names. Couldn't find any other source of the error so I edited laser_mapping.hpp and laser_feature_extractor.hpp changing all the instances of /camera_init to camera_init. The errors went away and the costmaps started working. Also using velodyne_cloud_registered as input for the costmaps instead of using pointcloud_to_laserscan to create a LaserScan topic. Doesn't seem to work with amcl however it wants a Pointcloud. I'm using robot_localization instead with a ukf filter using aft_mapped_to_init and the imu as inputs. In the robot model I made camera_init the parent of base_link. Robot_localization adds the map topic to complete everything. V2 performance seems to be better. I'll get it outside in a day or so and see how it works. Good Job !!!

Memory Leak?

If you leave loam-livox running for about an hour it will eventually take up all the memory and swap and crash. This is on a nvidia Xavier which has 16Gb of ram. Ubuntu 18.04. Easy to see with jtop. It takes a long enough period of time to crash that it isn't really going to effect my testing that much but I thought you might like to know.

image topic does not give output

I used a usb camera as my web cam with usb_camera package installed. I executed the same process as given in the readme.md file on the repo. The below screenshot is taken with the camera and lidar attached. Any help is appreciated.
Screenshot from 2020-03-06 16-40-59

IMU support

Hi!
Thanks a lot for your excellent work! Will the next version of the code support IMU?

Running on Pi 64bit

Currently unable to run in raspbian nspawn 64bit , is this not supported?

Something is wrong with PCL1.9.1

Hi:
Thank you for your outstanding work!
As the README instructions, I configured my environment. But when I Updated my PCL to version 1.9.1, something is wrong.
My motified CMakeLists.txt as follow:

CmakeLIsts txt

Then "1.rosbag play CYT_02.bag 2. roslaunch loam_livox livox.launch", an error is throwed out, as follow pictures show.
laserMapping

However, when I used PCL1.7, it running well. But the results did not have the effect of the show.

cell's center, covariance and feature_direction

Hi @ziv-lin , thanks for sharing your work to community. when calculating cell's center cell_map_keyframe.hpp func find_cell_center() and covariance func get_covmat() in code is as follows, different from the paper equ1. and equ3. repectively, does this matter?

cell_center(0) = (std::round((pt(0) - half_of_box_size) / box_size)) * box_size + half_of_box_size;
cell_center(1) = (std::round((pt(1) - half_of_box_size) / box_size)) * box_size + half_of_box_size;
cell_center(2) = (std::round((pt(2) - half_of_box_size) / box_size)) * box_size + half_of_box_size;

for (size_t i = 0; i < pt_size; i++) {
m_cov_mat = m_cov_mat + (m_points_vec[i] * m_points_vec[i].transpose()).template cast<COMP_TYPE>();
}
m_cov_mat -= pt_size * (m_mean * m_mean.transpose());
m_cov_mat /= (pt_size - 1);

When calculating feature direction in func feature_direction(), in paper V-C(2D histogram of keyframe), " we choose the direction with positive X components", in code we transform points whose x part is negative into positive, could you please explain it? Looking forward to your reply, thanks for your help!

if (vec_3d[0] < 0) {
vec_3d *= (-1.0);
}

can't download bag

Hi,I cann't download the bags,can you upload them to baidu cloud?

Mid-100 support

Hi!

Thanks a lot for this package. I've run some tests already with Mid-40 and really like it so far! Would you be able to give me some pointers on how to implement Mid-100 support?

If you take pull request I'd be more than happy to expose this feature as a parameter and make a PR for it.

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.