fix the time sync remind problem

This commit is contained in:
xw
2021-07-18 01:31:56 -04:00
parent 669eedfc7d
commit 5cd5be3201
2 changed files with 4 additions and 4 deletions

View File

@@ -309,9 +309,9 @@ void livox_pcl_cbk(const livox_ros_driver::CustomMsg::ConstPtr &msg)
}
last_timestamp_lidar = msg->header.stamp.toSec();
if (!time_sync_en && abs(last_timestamp_imu - lidar_end_time) > 10.0)
if (!time_sync_en && abs(last_timestamp_imu - last_timestamp_lidar) > 10.0 && !imu_buffer.empty() && !lidar_buffer.empty() )
{
printf("IMU and LiDAR not Synced, IMU time: %lf, lidar scan end time: %lf",last_timestamp_imu, lidar_end_time);
printf("IMU and LiDAR not Synced, IMU time: %lf, lidar header time: %lf \n",last_timestamp_imu, last_timestamp_lidar);
}
if (time_sync_en && !timediff_set_flg && abs(last_timestamp_lidar - last_timestamp_imu) > 1 && !imu_buffer.empty())