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

Gazebo Ignition recorded ros2 bag drift randomly #497

Open BabeJoan opened 2 months ago

BabeJoan commented 2 months ago

Hello Community,

I am using Gazebo ignition simulator to test LIO-SAM ros2 branch now. The problem I met is, LIO-SAM runs well with simulation but when I recorded ros bag from it and play, LIO-SAM performs quite randomly. Usually it starts well but then the drift happens. image

I built a simple robot and the lidar and imu both using the gazebo ignition plugins, so the extrinsic Matrix should be right. I have several guess of the possible reasons:

  1. Frame transformation: I have different frame transformation from LIO-SAM's robot, the error logs are also always around 'link transformation'. But there are only imu/data and lidarpoints topics in the rosbag, so it might not be the reason.

  2. Extrinsic Matrix: I'm using unit matrix for both ExtrinsicROT and ExtrinsicRPY. I built a simple robot and the lidar and imu both using the gazebo ignition plugins, so the extrinsic Matrix should be right. The plugin I used for imu is <plugin filename="ignition-gazebo-imu-system" name="ignition::gazebo::systems::Imu"> </plugin> But when I run LIO-SAM in some simulation world, the incremental part of the map shows a rotation trend, so does the trajectory. But in others, there is no such problem. image

  3. Time synchronization: Because LIO-SAM always starts well in the beginning and drift later. Meanwhile it ran well with simulation. I guess it's a bad synchronization increasing the error which leads to failure in alignment. But LIO-SAM runs well with ros bags which is recorded in reality with real time. And I checked the timestamp of topics, they look synchronized well.

And it always has this in log, even I decrease the rate of rosbag playing to 0.1: Message Filter dropping message: frame 'vehicle_blue/lidar_link/gpu_lidar' at time 166.800 for reason 'discarding message because the queue is full'

Part of the /imu/data and /points is shown below: `--- header: stamp: sec: 118 nanosec: 782000000 frame_id: vehicle_blue/imu_link/imu_sensor orientation: x: -6.693089243585746e-07 y: 3.1786958765501195e-06 z: -0.00022797704779308332 w: 0.9999999740079578 orientation_covariance:

Please leave me some thoughts if you met similar situation before or if you have any idea that I should try.

RodrigofrBastos commented 1 month ago

I'm facing similar issues testing LIO-SAM on a gazebo simulation