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

Gazebo simulated robot imu has erratic movement while stationary

asked 2022-08-23 02:50:41 -0500

bc524 gravatar image

updated 2022-08-24 21:23:54 -0500

ljaniec gravatar image

I am trying to perform SLAM mapping using a gazebo simulated robot. I am simulating a velodyne VLP-16 lidar for the point cloud and using the IMU plugin for gazebo.

When I load my robot into the gazebo environment, the /imu/data topic reading fluctuates randomly.

Attempting to map it with LIO-SAM produced this: image description

The top is the map link, while the one at the bottom is the base link. The robot is stationary in gazebo.

What could be causing it?

edit: echo of the imu data, only took a few data points as nothing changes except the orientation x,y,z values.

<pre>me_id: &quot;base_footprint&quot;
orientation: 
  x: -0.0004771787200831384
  y: -0.004141362131355094
  z: -0.012690029209163286
  w: 0.9999107883100555
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity: 
  x: 0.0
  y: 0.0
  z: 0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration: 
  x: 0.0
  y: 0.0
  z: 0.0
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
header: 
  seq: 32127
  stamp: 
    secs: 246
    nsecs:  36000000
  frame_id: &quot;base_footprint&quot;
orientation: 
  x: -0.00047878039731265965
  y: -0.004128353785896729
  z: -0.01268815748355096
  w: 0.9999108650894951
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity: 
  x: 0.0
  y: 0.0
  z: 0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration: 
  x: 0.0
  y: 0.0
  z: 0.0
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
</pre>
edit retag flag offensive close merge delete

Comments

An IMU plugin for this purpose would need to be implemented carefully. Wheeled robots already tend to "vibrate" in gazebo, so if your plugin simply differentiates the instantaneous velocity (to get acceleration), I suspect it is going to produce bad results. Have you looked at the robot's velocity when it is supposedly stationary?

Can you provide a link to the IMU plugin you are using?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-08-23 07:32:34 -0500 )edit

I'm using the GazeboRosImu as listed in the Gazebo tutorial https://classic.gazebosim.org/tutoria...

I added it within my robot's urdf file but it isn't linked to any part. Could this be the cause?

Not sure if this is correct, but another ros-answer said to subscribe to /gazebo/model_states/twist to get velocity. Echoed the topic and the output for all the values is 0.

bc524 gravatar image bc524  ( 2022-08-23 20:05:33 -0500 )edit

Please edit your description and show us one of these published Imu messages. Copy/paste the text, and format it with the 101010 button.

What Is your <gaussianNoise> parameter set to?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-08-24 16:05:36 -0500 )edit

edited my description with the echo of the imu reading.

I have gaussianNoise se at 0.0

bc524 gravatar image bc524  ( 2022-08-24 20:38:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-08-25 04:56:58 -0500

bc524 gravatar image

updated 2022-08-25 04:57:28 -0500

I've managed to somewhat solve the issue.

In short, the plugin, libgazebo_ros_imu does not play nice with LIO_SAM as it is somehow generating a z-axis acceleration. Switching to libgazebo_ros_imu_sensor worked a lot better. The imu is teetering back and forth between 2 points (which I believe is being caused by another plugin as disabling that plugin made it stable) but no longer creating a bottomless tunnel .

https://github.com/TixiaoShan/LIO-SAM...

Hope this helps anyone else.

edit flag offensive delete link more

Comments

It looks like LIO_SAM assumes your acceleration data includes gravity. So after it subtracts 9.8 from linear_acceleration.z, it now thinks your robot is accelerating down the z axis toward negative infinity.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-08-25 07:53:23 -0500 )edit

Question Tools

Stats

Asked: 2022-08-23 02:50:41 -0500

Seen: 250 times

Last updated: Aug 25 '22