AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Simulate "perfect" IMU

Open paaraujo opened this issue 3 years ago • 0 comments

Bug report

  • AirSim Version/#commit: 1.7.0 (installed via pip)
  • OS Version: Ubuntu 20.04

What's the issue you encountered?

I am trying to simulate a "perfect" IMU inside the platform. Thus, inside the settings.json, I've put this: "Imu-Clean": { "SensorType": 2, "Enabled" : true, "AngularRandomWalk": 1E-12, "GyroBiasStabilityTau": 1E-12, "GyroBiasStability": 1E-12, "VelocityRandomWalk": 1E-12, "AccelBiasStabilityTau": 1E-12, "AccelBiasStability": 1E-12 } I have tried different small numbers, and they all give the same effect. In the IMU linear accelerations, we can see some residuals. This is easily noticed when the car is stopped (the first IMU in the debug panel is the 'clean' IMU):

airsim

These residuals vary a log, especially when we stop the car after some significant dynamic change. I am computing the trajectory based on the IMU measurements, and it seems that this behaviour is preventing me to recover the original trajectory; for example:

attitude

The attitude angles are close but not "perfect." And here is the estimated trajectory:

trajec

I am recording IMU data at 65Hz. I've checked the API code, and it seems that after it transforms the ground truth linear acceleration from the world to the body frame, things start to get strange.

https://github.com/microsoft/AirSim/blob/6688d27d3712c2a9c824ababec7a2703475b6628/AirLib/include/sensors/imu/ImuSimple.hpp#L62

Maybe the quaternion multiplication is causing that, even with a normalized quaternion. Any help on how to simulate such a sensor properly will be appreciated. Thank you.

Settings

How can the issue be reproduced?

  1. Just add the settings presented above into the DefaultSensor section of the settings.json file
  2. Open the Blocks map and check the debug window

Include full error message in text form

What's better than filing an issue? Filing a pull request :).

paaraujo avatar Aug 10 '22 03:08 paaraujo