hyye / lio-mapping

Implementation of Tightly Coupled 3D Lidar Inertial Odometry and Mapping (LIO-mapping)
https://sites.google.com/view/lio-mapping
GNU General Public License v3.0
898 stars 320 forks source link

Extrinsic Calibration Failed and imu not initialized? #22

Closed llu0120 closed 4 years ago

llu0120 commented 4 years ago

It seems that running the data you provided will have Extrinsic Calibration successful and imu initialized. However, now I plugin my data and the bag can play normally to the end without any process died, but didn't show anything on Rviz and always show Extrinsic Calibration Failed in the terminal. Does this mean the result didn't converge? How to deal with this problem or what might cause them happened?

llu0120 commented 4 years ago

Hi author, After tuning the extrinsic parameters, I confronted imu excitation is not enouth and I found that your provided IMU frequency is about 400 Hz, but mine's is 50 Hz. Will this be a problem to cause this happened? Or what parameters I need to adjust to deal with this problem?

hyye commented 4 years ago

Typically, 50Hz is not enough for the system to run smoothly.

llu0120 commented 4 years ago

May I know the reason that why this frequency doesn't work?

hyye commented 4 years ago

One issue is the timestamp alignment; another issue is the integration error will be large when the time interval is large. I don't suggest using a low-frequency IMU.

llu0120 commented 4 years ago

So is there a suggestion of frequency? Or what is the threshold of this frequency? And although the frequency is low, I think there will still appear some result, but now with imu excitation is not enouth, no results are shown in Rviz.

hyye commented 4 years ago

My suggestion is at least >=100Hz, recommended >=200Hz. imu excitation is not enough (the typo is fixed) means no good initialization can be obtained. Thus, there is no further optimization; otherwise, only the wrong results will be produced.

llu0120 commented 4 years ago

Thanks for your reply, but due to my data the imu frequency cannot change. Are there any parameters that can adjust?

hyye commented 4 years ago

It is not recommended to use a low-frequency IMU. But you may try to moderately move (rotate) the sensor pair to make the extrinsic calibration success. Then fill in the calibrated parameters and set the estimate_extrinsic in the config file to 1.

llu0120 commented 4 years ago

Thanks for your suggestion! By the way what is the function ApproximateGravity for? Because I make the return always into true then the imu can be initialized. (My IMU data is already processed by deducting g_norm in the z axis of accleration.)

hyye commented 4 years ago

That function is used to estimate the gravity vector in the local frame. If your IMU data provides free acceleration, the code cannot be directly used. In the current version, the inputs should be raw IMU data without subtracting gravity.

llu0120 commented 4 years ago

Thanks for your reply and I will try to plugin the raw IMU data. Another two questions, what is the real usage of the rostopic /compact_data and its meaning, can I just turn it off? And how can I ensure my imu data is fully turned off in your code?

hyye commented 4 years ago

To turn off IMU data, you can set imu_factor to 0 in the config yaml . Then, there will be no optimization at all. compact_data is used for storing all the feature points, odom, etc. and transmit all of them once by one message.