Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensor Data Coordinate Convention #1154

Closed
jameswalmsley opened this issue Jun 11, 2018 · 5 comments
Closed

Sensor Data Coordinate Convention #1154

jameswalmsley opened this issue Jun 11, 2018 · 5 comments
Labels

Comments

@jameswalmsley
Copy link

jameswalmsley commented Jun 11, 2018

I've read in the documentation that the NED coordinate convention is used throughout AirSim.

Can someone confirm that the sensor data coming into e.g. SimpleFlight is also in NED convention.

  1. When looking down on top of the drone, a positive rotation (Clockwise) in Yaw (Z down axis) will cause a positive gyro signal?
  2. A pitch upwards of the drone (causing the front of the drone to pitch up by a positive angle) will cause a positive gyro signal?
  3. A roll to the right will cause a positive gyro signal?

If the drone is upright I can see an acceleration of -9.81 m/s^2
If the drone is rolled 90 degrees on its right, I should see -9.81 on the Y axis?
If the drone is pitched 90 degrees forward (on its nose) I should see -9.81 on the X axis?

Can anyone confirm that my assumptions are correct.

I would really love to be able to pick up the drone and spin it around in the simulator to test this.

Many thanks..

James

@sytelus
Copy link
Contributor

sytelus commented Jun 23, 2018

Yes, I think that's what should happen. Sensor data is also in NED. Try it out and if that's not the case we will look at it.

@jameswalmsley
Copy link
Author

@sytelus Many thanks for getting back to me.

After further investigating it seems to be in NED.
Can you confirm what gravity should look to a NED sensor. If the axis is pointing to the ground, should it see -9.81 ms/s^2 or +9.81?

Currently in AirSim its all -ve, so I assume this is correct.

I've fed the imu data into the MadgwickAHRS filter, and it also has a NED coordinate system. However I have to negate all the accel data, hence the question.

Thanks

James

@sytelus sytelus added bug and removed question labels Oct 17, 2018
@kylelindgren
Copy link

At complete resting state, the IMU should report -9.81 m/s^2 though the AirSim 1.2 API for simGetGroundTruthKinematics() does not account for gravity and it needs to be manually added after converting to body frame.

@madratman
Copy link
Contributor

Yes, you're right in that simGetGroundTruthKinematics() is in world NED frame and needs to be converted into body frame and gravity needs to be added. See discussion in #1909. I think you basically did what the first comment about.
#1920 adds an IMU API, so I am closing this

@yuyangch
Copy link

Hi, I am confused here,the body frame also uses NED convention right? where z points downward, so if the drone is resting upright, shouldn't the downward pointing z direction acceleration reads +9.81 instead of -9.81?

namely line 55 of ImuSimple.hpp:
output.linear_acceleration = ground_truth.kinematics->accelerations.linear - ground_truth.environment->getState().gravity;

why subtract ground_truth.environment->getState().gravity
instead of just adding it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants