TixiaoShan / LIO-SAM

LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping
BSD 3-Clause "New" or "Revised" License
3.34k stars 1.24k forks source link

Run error when mapOptimazation #81

Closed starcosmos1225 closed 4 years ago

starcosmos1225 commented 4 years ago

Hi When I run lio-sam, an error occurred. I locate this error in the function extractNearby()(in line 834), which appears in the following code: for (int i = numPoses-1; i >= 0; --i) { if (timeLaserInfoCur - cloudKeyPoses6D->points[i].time < 10.0) surroundingKeyPosesDS->push_back(cloudKeyPoses3D->points[i]); else break; } I don't understand why this code report an error. I have checked that the pointers is not nullptr. The push_back function of pcl::point_cloud puts this PointType in a vector, changes the width to the size of the current vector, and then sets the height to 1. Why did this operation report an running error?

TixiaoShan commented 4 years ago

Did you install the GTSAM provided in the readme. Runtime error in mapOptimization is usually caused by GTSAM.

starcosmos1225 commented 4 years ago

Thanks, I will try to reinstall a new version of gtsam.

ClementPinard commented 4 years ago

Had the same error. At first I simply installed the master branch of gtsam. The only way I could make it work was to checkout precisely version 4.0.3 (as said in this repo's README) and build it without march native, otherwise I would get errors.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

plumewind commented 2 years ago

Hello,

@starcosmos1225 Did you solve it? I installed the gtsam ( version 4.0.3 ), and still the same error.

plumewind commented 2 years ago

hello,

@TixiaoShan @ClementPinard

A very surprising thing, when I use the source code to compile pcl ( version 1.8.1 ) and then install it, there will be no problems. Why?

Sonne-Zhu commented 2 years ago

hello,

@TixiaoShan @ClementPinard

A very surprising thing, when I use the source code to compile pcl ( version 1.8.1 ) and then install it, there will be no problems. Why?

I try this,and also have no problems,although i do not know why,but thanks!