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

Possibly bug or just tradition? #12657

Closed
hyonlim opened this issue Aug 7, 2019 · 1 comment
Closed

Possibly bug or just tradition? #12657

hyonlim opened this issue Aug 7, 2019 · 1 comment

Comments

@hyonlim
Copy link
Contributor

hyonlim commented Aug 7, 2019

Describe the bug
See above link. It is trying to swap x,y. Not z.

https://github.com/PX4/Firmware/blob/83e532d3399720b9bf10c2ed68adacd9ab4591a0/src/drivers/imu/mpu9250/mpu9250.cpp#L741

What is the purpose of this?

If you see another code, the intention of axes swapping is to make default sensor orientation (sensor on the PCB top, pin 1 toward west direction) to NED.
https://github.com/ArduPilot/ardupilot/blob/2a3676003aadf9fe3b2475b72e9687d77379e099/libraries/AP_InertialSensor/AP_InertialSensor_Invensense.cpp#L424

This code is trying to make ENU (Invensense sensor default axis orientation) to NED (PX4 default axis)

Is this a bug or tradition? Because this makes unnecessary rotation happened during sensor acquisition. What do you think?

@hyonlim hyonlim changed the title Possibly bug or just tradition. Possibly bug or just tradition? Aug 7, 2019
@mcsauder
Copy link
Contributor

Hello @hyonlim , this was intentional due to legacy, see comments above the line you linked. the discussion in #9459 sheds a little bit of light:
image

X and Y were rotated 90, hence the Y negation. Z axis remained with the same orientation. Hopefully this helps clarify. Good work combing through the code with an eye for possible errors!

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

No branches or pull requests

2 participants