Interpretation of IMU data from the gazebo_ros_imu plugin
We want to use the gazebo_ros_imu plugin for the simulation of our quadrotor and other vehicles in Gazebo. When looking at the output and source file of the plugin, several questions arise:
- When the platform is standing still, the simulated accelerations are all zero apart from the simulated noise. Shouldn't the gravity vector be added to the accelerations measured due to body motion? A real IMU would give a more or less constant gravity vector in body coordinates. Does this behavior mimic the output of the simulated Microstrain 3DM-GX2 IMU?
- Accelerations are calculated by a first-order approximation of the linear velocity. Is there a specific reason why the driver does not use the gazebo::Entity::GetRelativeLinearAccel() or gazebo::Entity::GetWorldLinearAccel() functions?
- I am not familiar with the Gazebo interface. The Entity class seems to provide two types of access functions for the body states, one in relative (body) coordinates and one in world coordinates. Wouldn't it be more straight-forward to directly use the body vectors instead of the rotated world vectors? I assume the reason is the rpyOffsets parameter and that the accelerations and angular velocities should match the "wrong" orientation. But in reality the things are other way round, namely that offsets in orientation are a result of offsets in the acceleration measurements.
By the way, in my opinion the term "IMU" is misleading for a device providing the orientation of a platform, as a pure IMU by itself only provides accelerations and angular velocity. The roll and pitch angles can be estimated with this information under the assumption that the velocity vector of the platform is more or less constant over time (which does not necessarily hold for flying vehicles). Heading or yaw always needs additional references like earth magnetic field or others. I think "AHRS" (Attitude and Heading Reference System) would fit better for what an IMU is in ROS.
Thanks in advance for some useful answers!