AP_GPS: log altitude above ellipsoid instead of undulation #29904
+8
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ArduPilot's internal definition of undulation is reversed in sign compared to the accepted convention and this creates confusion: #29199 .
Instead of the internal definition, log the altitude above ellipsoid, which ArduPilot already consistently and correctly calculates and broadcasts over e.g. DroneCAN and MAVLink. Switching the quantity logged allows users to accommodate the problem in old logs (i.e. always flip GPA.Und sign to match the accepted convention) and reduces opportunity for future confusion.
Future work will clean up or replace the internal representation, but this should be a complete fix for the issue from a user perspective.
Tested using u-blox, u-blox over AP_Periph over DroneCAN, and NovAtel.
Geoid information using EGM96 from my (approximate) back yard showing an ellipsoid height of 60.57m, an undulation of -28.35m, and a mean sea level height of 88.92m:

Dataflash log from a u-blox NEO-M9N, values match well (receiver-calculated undulation is -30.07m):

Corresponding telemetry log:
