gazebo imu sensor is falling down in Nav2 getting started example
I'm trying to modify Nav2 Getting Started example to fuse diff_drive odometry and imu data via robot_localization pkg, but I've noticed that the simulated imu sensor outputs an inadequate data. Digging in showed, that the imu sensor is actually detached from the base_link robot body and is keeping falling down from the beginning.
Is that imu falling problem is just my local problem? Or anybody could reproduce the same problem with unmodified Nav2 Getting started example? How to resolve this issue i.e. how fix the imu_link properly to body_link?
Here is a sample of imu data (look at linear_acceleration.z value, it is about zero value), while robot stands still (not moving anywhere):
$ ros2 topic echo /imu --once
header:
stamp:
sec: 6
nanosec: 298000000
frame_id: imu_link
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
orientation_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
angular_velocity:
x: 3.674648740750363e-05
y: -1.5758485404928543e-05
z: 8.80878528687566e-05
angular_velocity_covariance:
- 4.0e-08
- 0.0
- 0.0
- 0.0
- 4.0e-08
- 0.0
- 0.0
- 0.0
- 4.0e-08
linear_acceleration:
x: -0.006802633792902658
y: -0.0074336465388991375
z: -0.034367962884921444
linear_acceleration_covariance:
- 0.00028900000000000003
- 0.0
- 0.0
- 0.0
- 0.00028900000000000003
- 0.0
- 0.0
- 0.0
- 0.00028900000000000003
---
Here a screenshot from gazebo window with imu_link pose (highlighted with red, z = -1355 meters):
If I update imu_link pose data (by clicking again at imu_link field in gzclient window), then z value is going to be even lower, then it's keeping falling.
In comparison here is a sample of sam_bot imu data (got from First-Time Robot Setup Guide - Setting Up Odometry - Adding Gazebo Plugins to a URDF) (look at linear_acceleration.z value, it is about expected 9.81 value):
$ ros2 topic echo /demo/imu --once
header:
stamp:
sec: 61
nanosec: 838000000
frame_id: base_link
orientation:
x: -1.537258480573929e-09
y: 1.4639308030715501e-05
z: 0.004202907273712188
w: 0.9999911676390645
orientation_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
angular_velocity:
x: 6.531781238713562e-05
y: -0.00010195262499235747
z: 9.86782271776771e-06
angular_velocity_covariance:
- 4.0e-08
- 0.0
- 0.0
- 0.0
- 4.0e-08
- 0.0
- 0.0
- 0.0
- 4.0e-08
linear_acceleration:
x: -0.09869154506498802
y: -0.11664874054304436
z: 9.719326321457395
linear_acceleration_covariance:
- 0.00028900000000000003
- 0.0
- 0.0
- 0.0
- 0.00028900000000000003
- 0.0
- 0.0
- 0.0
- 0.00028900000000000003
---
Gazebo client doesn't show any imu_link with spawned sam_bot (though it's not an issue here):
System description
tb3 config is the same as Nav2 tutorials has the following:
- robot description turtlebot3_waffle.urdf
- sdf gazebo model file waffle.model
- nav2 launch file bringup_launch.py
sam_bot config is the same as in Nav2 tutorial:
- both URDF and SDF data in sam_bot_description.urdf file
- launch file display.launch.py
My distribution is ROS2 Humble with Gazebo 11.10.2. ROS2 Humble installed via sudo apt install ros-humble-desktop as default way of installation. ROS2 Nav2 is installed with ...