ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
776 stars 772 forks source link

IMU Output is unreasonable when my robot is spinning in circle with uniform speed #1363

Open KhalidOwlWalid opened 2 years ago

KhalidOwlWalid commented 2 years ago

Description

Whenever I am moving my robot in a uniform circular motion, I am getting a negative output for my linear (tangential) acceleration in the negative direction although I believe it should have been zero Reference : uniform circular motion

Output

header:
  stamp:
    sec: 266
    nanosec: 197000000
  frame_id: imu_base_link
orientation:
  x: 2.678757786652316e-07
  y: 4.246988684238048e-07
  z: 0.3740421717030349
  w: 0.9274116959513856
orientation_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
angular_velocity:
  x: 0.0008073019359326919
  y: 0.0005859120509501901
  z: 0.9184899232134838
angular_velocity_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
linear_acceleration:
  x: -2.156493067231797
  y: 10.832547949178531
  z: 9.886436726600044
linear_acceleration_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
---

Expected Output

linear_acceleration.x should have been zero

KhalidOwlWalid commented 2 years ago

I am still having the same issue and I am not able to debug the source of this problem.

Generally, when creating my imu sensor, in the sdf file, I have set the noise to be none, just to see if the noises are the actual problem. However, it still does not help with anything and I am still receiving odd values in which I believe should not happen in the first place. Here is some visualization that could possibly help you understand what I mean:

Screenshot from 2022-04-23 00-55-05

The image is taken when I intentionally make my robot to move in circular motion. Here is part of my sdf file which includes the imu sensor:

        <sensor name="imu_sensor" type="imu">
                <always_on>true</always_on>
                <update_rate>1000</update_rate>
                <visualize>true</visualize>
                <topic>__default_topic__</topic>
                <enable_metrics>true</enable_metrics>
                <pose>0 0 0 0 0 0</pose>
                <imu>
                    <angular_velocity>
                        <x>
                            <noise type="none">
                            </noise>
                        </x>

                        <y>
                            <noise type="none">
                            </noise>
                        </y>

                        <z>
                            <noise type="none">
                            </noise>
                        </z>
                    </angular_velocity>

                    <linear_acceleration>
                        <x>
                            <noise type="none">
                            </noise>
                        </x>

                        <y>
                            <noise type="none">
                            </noise>
                        </y>

                        <z>
                            <noise type="none">
                            </noise>
                        </z>
                    </linear_acceleration>
                </imu>

From the documentation, I have chosen my noise to be none.

I have also tried to compare the imu output along with my ground truth linear acceleration, and here is the result that I obtain when I made my robot to move in a straight line****.

Screenshot from 2022-04-22 20-33-16

Which is expected! However, the imu result happens to not coincide with my ground truth value when it is moving in a circle.

It would be great if you could review this and possibly, point me in the right direction if I may have made any mistake.

Thank you