Skip to content

AP_GPS Undulation is opposite common convention causing incorrect ellipsoid height #29199

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

Closed
Ryanf55 opened this issue Jan 31, 2025 · 3 comments · May be fixed by #29200
Closed

AP_GPS Undulation is opposite common convention causing incorrect ellipsoid height #29199

Ryanf55 opened this issue Jan 31, 2025 · 3 comments · May be fixed by #29200

Comments

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Jan 31, 2025

Bug report

Issue details

ArduPilot's idea of undulation is not following common convention. It's been this way since it was first implemented, and we have seen PR's come through to correct device drivers undulation, when in fact, ArduPilot was using the wrong definition.

See here for a report:

Ardupilot GPS Issue - PUBLIC3.pdf

If you use ellipsoid height for an algorithm, you may run into large offsets on some GPS's.

Version
Every version of ardupilot that publishes GPS_RAW_INT and dataflash logs to report UND, including master.

Platform
[x] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

Airframe type
All

Hardware type
A few GPS's have been tested

Logs
N/A

@tpwrules
Copy link
Contributor

After some experimentation and private discussion with Ryan it appears that (fortunately!) this issue does not affect the common use case of DroneCAN, UBX, or NMEA GPSes. When using these GPSes, whether through AP_Periph or a flight controller, the ellipsoid height is correct over MAVLink GPS_RAW_INT and/or DroneCAN's uavcan.equipment.gnss.Fix2 message. So the issue in these cases is only visible in dataflash GPA.Und.

This makes a fix a lot more palatable for me personally and I do think it is important for users of other GPSes.

tpwrules added a commit to tpwrules/ardupilot that referenced this issue Apr 26, 2025
ArduPilot's internal definition of undulation is reversed in sign
compared to the accepted convention and this creates confusion:
ArduPilot#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.
tpwrules added a commit to tpwrules/ardupilot that referenced this issue Apr 26, 2025
ArduPilot's internal definition of undulation is reversed in sign
compared to the accepted convention and this creates confusion:
ArduPilot#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.
rmackay9 pushed a commit to tpwrules/ardupilot that referenced this issue Apr 29, 2025
ArduPilot's internal definition of undulation is reversed in sign
compared to the accepted convention and this creates confusion:
ArduPilot#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.
rmackay9 pushed a commit that referenced this issue Apr 29, 2025
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.
rmackay9 pushed a commit to rmackay9/rmackay9-ardupilot that referenced this issue Apr 29, 2025
ArduPilot's internal definition of undulation is reversed in sign
compared to the accepted convention and this creates confusion:
ArduPilot#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.
rmackay9 pushed a commit to rmackay9/rmackay9-ardupilot that referenced this issue Apr 29, 2025
ArduPilot's internal definition of undulation is reversed in sign
compared to the accepted convention and this creates confusion:
ArduPilot#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.
rmackay9 pushed a commit that referenced this issue Apr 29, 2025
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.
@peterbarker
Copy link
Contributor

@Ryanf55 we've got patches which address this issue - all done yet?

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented May 2, 2025

Solved and back ported to 4.6

@Ryanf55 Ryanf55 closed this as completed May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants