-
-
Notifications
You must be signed in to change notification settings - Fork 915
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
Use attitude heading #3663
Use attitude heading #3663
Conversation
This comment has been minimized.
This comment has been minimized.
AUTOMERGE: (FAIL)
|
When a properly calibrated Mag is active, the identified problem is: Background: In the main Setup tab, there is a yaw heading value that changes 'immediately' when the quad is quickly yawed, but about a half second later, a slower correction happens. I have previously assumed that this is an IMU-derived yaw heading value, and that the immediate change comes from gyro data, whereas a bit more slowly, the Mag information updates this value. Importantly, changing the CLI In the GPS Rescue tab, there is a 'raw Mag Heading' value. This changes We need to get consistent values in both places, and to be able to explain these differences. Both values should respond to the CLI |
This comment has been minimized.
This comment has been minimized.
1ac405b
to
0f66d71
Compare
This comment has been minimized.
This comment has been minimized.
@haslinghuis Maybe we can simply use the MSP_ATTITUDE value for yaw when we want to show heading values from IMU. MSP_ATTITUDE carries So we should use the MSP_ATTITUDE value for yaw as the value to show on the main setup page, and for the value to be shown to the left of the GPS heading value in the GPS page. The label for these two values should be Regarding the map itself.... When GPS is 'stationary', its heading information is useless. Fortunately, the current Configurator leaves the map 'steady' when GPS alone is active. But if Mag is active, the current Configurator code rotates the map, and makes it really shaky. And the rotation is affected by pitching the quad. This is ugly and needs fixing. I would suggest that we do not rotate the map, but use the MSP_ATTITUDE value for yaw (which is smooth) to rotate the icon in the middle of the map and only when Mag is active. Hopefully I've explained it clearly, looking forward to seeing how it works out. I can test easily. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Looking good. IMU values now on the GPS tab, updating properly, accounting for declination. Map is stable. |
This comment has been minimized.
This comment has been minimized.
6fd1cf1
to
6a22376
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Do you want to test this code? Here you have an automated build: |
@haslinghuis @ctzsnooze but we loose the N symbol, pointing to North ? |
Please check on master? As we have PR 3668 and 3669 on top of this. |
* Rename heading * Change gpsHeading message * Use IMU heading on GPS tab * Remove precision and rotation * Code style fixes
Summary from ctzsnooze:
Bugfix PR to:
The PR displays the IMU heading value in the GPS tab, in place of the Mag X axis value, to the left of the GPS Heading value.
Previously the displayed Mag value was the Mag sensor X value converted to degrees. The X axis data alone returns a false heading value if the pitch or roll of the quad changes a tiny bit, and is, practically speaking, useless in the GPS tab.
Additionally, it is the IMU heading that we show in the Setup tab as the 'yaw attitude' of the quad (the 'heading' of the quad). It makes sense to use a consistent heading representation across Configurator.
Note that If a Mag is enabled, the IMU will derive heading from the Mag heading value, not the GPS value. If Mag is not enabled, the GPS heading will be shown.
Also note that the GPS Heading value will be incorrect (useless) unless the GPS is actually moving along the ground in a straight line at a velocity of at least 2m/s. Hence in most situations where both the computer that is running Configurator, and the quad itself, are stationary, the GPS value will not make sense.
That's why in most cases when a Mag is enabled, the IMU value will be 'correct', and the GPS value will be quite different. The only time both values will be the same is if the computer and quad are both walked, together, in the exact direction of the nose of the quad.
The 'madly jumping Map' issue was happening only when Mag was enabled. At present this is fixed by locking the Map stationary, as it should be (north always upwards). We are hoping to be able to rotate the icon, not the map, using the IMU value, but that may need to be in a different PR.
So this PR resolves the current problems with Mag display in the GPS tab. It has been tested and works.
I recommend we merge it now.
C
Original comments:
Also iProposal for renaming heading to clarify witch value is used.
MSP_ATTITUDE
andFC.SENSOR_DATA.kinematics[X,Y,Z]
.MSP_RAW_IMU
andFC.SENSOR_DATA.magnetometer[X,Y,Z]
.Heading
on setup tab can be confused with magnetometer heading so like to rename it toYaw
.For gps tab we rename heading text to
Heading IMU / GPS:
.magHeading
. @atomgomba may have some pointers. But did some investigation:https://arduino.stackexchange.com/questions/18625/converting-three-axis-magnetometer-to-degrees
OpenLayers function
setRotation(rotation)
seems not working correctly with heading data.All this assumes the XY plane is horizontal. Adding pitch or yaw movements would result in wrong calculation.
Here is a resource if we need a more accurate solution. https://www.mdpi.com/1424-8220/11/10/9182/pdf