koide3 / hdl_localization

Real-time 3D localization using a (velodyne) 3D LIDAR
BSD 2-Clause "Simplified" License
777 stars 309 forks source link

what is invert_imu #11

Open HaoyunXu opened 5 years ago

HaoyunXu commented 5 years ago

On default, the invert_imu is enabled but the localization just failed when the car turns. Then I turned it off, and everything works perfectly fine. Could you give me a hint of what this invert_imu does?

koide3 commented 5 years ago

Hi @HaoyunXu , If it is enabled, all IMU data will be inverted (multiplied by -1). It was made for backward compatibility with a specific sensor. I think I will make it disable by default. Thanks for reporting.

narutojxl commented 3 years ago

I did a test, it seems that when using hdl_400.bag.tar.gz with imu, the imu's acc and gyro in the bag, we should enable invert_imu_acc and invert_imu_gyro. Note: imu's orientation is not used.
Before using imu, we should firstly transform imu's data into laser, if they are not aligned. Am i correct @koide3 :)?

koide3 commented 3 years ago

Yes, the acc and gyro in the bag are inverted, and thus invert_imu_acc and invert_imu_gyro need to be enabled. plot_status.py is useful to validate the IMU directions that plots prediction errors with/without IMU. If the errors with IMU are smaller than without IMU, your IMU configuration should be fine.

Screenshot_20210122_114421

In case the LIDAR and IMU have different coordinate systems, it's better to change odom_child_frame_id to the imu frame. Then, input point cloud is transformed in the IMU frame, and localization should be done without problems.

narutojxl commented 3 years ago

Thanks for koide3's detailed reply. :+1: