Change request: GLOBAL_POSITION_INT altitudes
The GLOBAL_POSITION_INT message contains an absolute altitude and a relative-to-home altitude.
ArduPlane and ArduCopter both use the mixed GPS and baro altitude stored in current_loc.alt for navigation. Wherever an absolute altitude has the home alt. subtracted from it to make a relative altitude, current_loc.alt is used.
However the GLOBAL_POSITION_INT message includes g_gps->altitude and not current_loc.alt. This makes it impossible for the receiver to relate and convert between absolute and relative altitudes or to derive the exact home altitude:
mavlink_msg_global_position_int_send(
... g_gps->altitude * 10, // millimeters above sea level (current_loc.alt - home.alt) * 10, // millimeters above ground ...
(g_gps->altitude and current_loc.alt should not be too far apart, but they are most often somewhat different. A large difference is useful for revealing a bad home alt. stored at APM).
I request that g_gps->altitude * 10 in the message be replaced by current_loc.alt * 10, that will fix it. Applications interested in the GPS altitude can still find it in the GPS_RAW_INT message.
Resolved by this PR. https://github.com/diydrones/ardupilot/pull/2814 Thanks, Grant.