rosblox / nav2_outdoor_example

Minimal example for using Navigation 2 with GNSS/IMU Localization in (Ignition) Gazebo
https://www.youtube.com/watch?v=gjaXRG1d2Fw
30 stars 6 forks source link

Robot doesn't localize properly with rotated IMU #2

Open maxpolzin opened 1 year ago

maxpolzin commented 1 year ago

When the IMU is rotated, e.g. 90 degrees yawed, the robot_localization is not working. When commanded to move forward, the robot_localization output does indicate that the robot is moving sideways.

Screencast from 09-04-2023 03:34:54 PM.webm

maxpolzin commented 1 year ago

That was a tough one. When the orientation_reference_frame tag is not provided, see https://github.com/art-e-fact/navigation2_ignition_gazebo_example/commit/7f4121bae5b37d1c4e53510422463a24ca8aa5ad, the simulated IMU returns measurements relative to its first measurement.

https://github.com/gazebosim/gz-sim/blob/2dbcc6c872a204e44f4dd3e3be8c44a98b04452f/src/systems/imu/Imu.cc#L228