hku-mars / r2live

R2LIVE: A Robust, Real-time, LiDAR-Inertial-Visual tightly-coupled state Estimator and mapping package
GNU General Public License v2.0
722 stars 194 forks source link

LiDAR incoming frame too old, need to be drop!!! #56

Closed Camilochiang closed 2 years ago

Camilochiang commented 2 years ago

Hei. Today your code is using for MID40 ros::Time ct(ros::Time::now()); on line 163 of feature_extract.cpp

This make it impossible to re run pre recorded bags as the following error show up for every LiDAR message LiDAR incoming frame too old, need to be drop!!! Failed to find match for field 'normal_x'. Failed to find match for field 'normal_y'. Failed to find match for field 'normal_z'. Failed to find match for field 'curvature'.

Is there any possibility or could you help me to implement a mid_handler that can receive CustomMsg so the timestamp is synchronized with the camera and IMU?

Thanks!

Camilochiang commented 2 years ago

I partially solve the problem setting lidar_type: 1 and N_SCANS to 1 in lio_config.yaml but the frames of the LiDAR are still trashed. I did install your special version of Livox_ros_driver and it was used for recording the rosbag. As you may see the time are extremily diferent.

IMU at : 1633417831.613297939 LIDAR at: 221.298467640 IMU at : 1633417831.618217945 IMU at : 1633417831.634017944 IMU at : 1633417831.635231018 IMAGE at: 1633417831.228661775

In my case IMAGE and IMU are taking the timestamp directly from ros::Time.now() Do you modify the time of the LIDAR in any other place that the driver? If is taking the ros time of the host, why the values are so low? Thanks in advance!

Camilochiang commented 2 years ago

Problem solve changing the already modified livox_driver. At the moment the version of the author is using the internal IMU but if is not present the time correction is never done. After changing the code this problem is solve.

Woodpecker0 commented 2 years ago

Problem solve changing the already modified livox_driver. At the moment the version of the author is using the internal IMU but if is not present the time correction is never done. After changing the code this problem is solve.

Hi, happy to see you success. I meet the same problem, and i would be appreciate if your share your changes of the code.

Camilochiang commented 2 years ago

Hei @Woodpecker0 . Sorry the late answer. I modified lddc.cpp from the author with:

Let me know if you need more help ;)

Tomato1107 commented 2 years ago

@Camilochiang Thanks!