ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

gazebo imu sensor is falling down in Nav2 getting started example

asked 2022-08-16 11:22:08 -0500

Robotics010 gravatar image

updated 2022-08-18 19:30:19 -0500

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):

image description

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):

image description

System description

tb3 config is the same as Nav2 tutorials has the following:

sam_bot config is the same as in Nav2 tutorial:

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 ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-08-17 03:31:20 -0500

iimata gravatar image

updated 2022-08-17 03:36:43 -0500

i was facing this issue with the gazebo depth camera ...

but it is not a ros issue .

try to add ..

<gravity>false</gravity>

below the imu link.

like

<link name="sensor_link">
    <gravity>false</gravity>
    <pose>? ? ? ? ? ? </pose>
</link>
edit flag offensive delete link more

Comments

Thanks iimata! Your workaround has resolved the issue. Imu sensor is not falling down anymore and /imu message returns expected 9.81 linear_acceleration.z value.

Robotics010 gravatar image Robotics010  ( 2022-08-18 19:32:55 -0500 )edit

you'r welcome <3

iimata gravatar image iimata  ( 2022-08-19 07:18:30 -0500 )edit

u can accept the answer <3

iimata gravatar image iimata  ( 2022-08-19 07:19:00 -0500 )edit

But still I'd say that fixed to robot's body imu sensor must not fall down. Why is it happening anyway and how to fix it properly? Is it gazebo bug and I should update gazebo with the newer patched version?

Robotics010 gravatar image Robotics010  ( 2022-08-19 07:35:43 -0500 )edit

Maybe it was lack of something like?

<joint name="imu_joint" type="fixed">
  <parent link="base_link"/>
  <child link="imu_link"/>
  <origin xyz="0 0 0.01"/>
</joint>

If you could prepare a MWE repository with your model and launcher we could check it out properly :)

ljaniec gravatar image ljaniec  ( 2022-08-19 08:28:25 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-08-16 11:22:08 -0500

Seen: 517 times

Last updated: Aug 18 '22