LORD-MicroStrain / microstrain_inertial

ROS driver for all of MicroStrain's current G and C series products. To learn more visit
https://www.microstrain.com/inertial
99 stars 75 forks source link

High IMU Jitter with ROS2 #357

Open PRAN384 opened 4 weeks ago

PRAN384 commented 4 weeks ago

Describe the bug I am experiencing high jitter while using the GV7 AHRS IMU. Although I have tried various data rates, the jitter remains an issue. However, I did observe that the jitter appears to be less pronounced at 1000Hz compared to lower rates. I have experimented with settings like device timestamps and ROS2 timestamps, but the problem persists.

To Reproduce Steps to reproduce the behaviour:

Launch the IMU node with command ros2 launch with the provided config.yaml file Set data rate to 200Hz (also tested with 1000Hz). Observe the output for jitter.

Expected behavior The IMU data should be stable and without significant jitter across different data rates and configuration settings.

OS: Ubuntu 22 Architecture: ARM64, x86 ROS Version: Humble Version: 4.3.0 Sensor(s): Microstrain GV7 AHRS IMU Modifications No source code modifications were made.

Launch Parameters Please find the custom_imu.yml.txt file attached here: custom_imu.yaml.txt

Attaching data rate plots for different settings:

200hz 1000hz

Please help as my application is very sensitive to high jitter.

vinnnyr commented 1 day ago

At rates that high, I would also try to tune at the DDS layer. What RMW implementation, what QoS is your publisher (driver) and subscriber?

robbiefish commented 1 day ago

Hi @PRAN384, the comment left by @vinnnyr is a good one as DDS tuning can certainly help with timestamp jitter, which I believe is what you are showing. However, the problem you are seeing is also caused by the way that USB data gets read by our devices.

One option would be to connect the device over serial, which should result in more consistent DTs assuming you can run at a high enough baudrate.

If you want to continue using USB, we have added the timestamp_source parameter in the most recent release which should help with this problem. I think that either option 1 or 2 would help with your problem