-
-
Notifications
You must be signed in to change notification settings - Fork 977
Fix heading calculation #3669
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
Fix heading calculation #3669
Conversation
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
ab7c461
to
38bc3de
Compare
This comment has been minimized.
This comment has been minimized.
0124cdc
to
c5bf184
Compare
c5bf184
to
d0e632e
Compare
|
Do you want to test this code? Here you have an automated build: |
This is AWESOME! A Mag user can now easily validate that it is working properly, by checking the position of the icon in the centre of the map. When the Mag is oriented and calibrated correctly, the icon angle should be about right, and remain about the same even if the quad is pitched up or down. With this PR, the icon points upwards when Mag heading is North (around 350-0-10 range), and points to the right when Mag heading is East, down for South, etc. Perfect! Note that when Mag is connected, the IMU favours Mag, and this is correct; the Mag value is used over the GPS value by the IMU. If Mag is not connected, the icon angle is consistent with the angle value shown for IMU in the Setup tab. Also this PR fixes the reported GPS heading value is now correct. If a quad with a properly Mag and GPS is connected to a laptop, and we walk with the laptop, with the quad facing 'forward' (in the direction we are walking), then the IMU (mag) and GPS headings are nearly identical. This confirms that the Mag is reasonably accurate. Both the Mag heading and the GPS Heading values can be validated by looking in Sensors when the |
Complements #3668
Fixes:
Thanks to @ctzsnooze for testing and suggestions.