firmware icon indicating copy to clipboard operation
firmware copied to clipboard

[Bug]: Can only set MSL as the desired altitude, cannot set HAE

Open kovar-ursa opened this issue 2 years ago • 9 comments

Category

Other

Hardware

T-Beam S3, Heltec Wireless Tracker

Firmware Version

All.

Description

Two related issues:

  1. You need to set both ALTITUDE and ALTITUDE_MSL in the Position bitmask to get the device to send altitude data.
  2. You can only set MSL. There is no bit to set for HAE.

if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE) { if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE_MSL) p.altitude = localPosition.altitude; else p.altitude_hae = localPosition.altitude_hae; if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION) p.altitude_geoidal_separation = localPosition.altitude_geoidal_separation; }

I suspect the intention was to add a bit for HAE but it never got done.

Relevant log output

No response

kovar-ursa avatar Jan 18 '24 15:01 kovar-ursa

It is one or the other, there is a single altitude value on the packet and the value changes based on your position flag. It is possible some devices do not support HAE. There is also not much of a use case for having both, as you are either in an airplane or on the ground but seldomly both.

garthvh avatar Jan 18 '24 16:01 garthvh

If I set just ALTITUDE no altitude data is transmitted. I must set both ALTITUDE and ALTITUDE_MSL for any altitude data to be sent. This seems to force me to use MSL for altitude values.

The code is setting either p_altitude or p.altitude_hae depending on ALTITUDE_MSL. Maybe p.altitude is being sent out even if p.altitude_hae is the one that is set? (I'm not sure where in the code this is handled.)

kovar-ursa avatar Jan 18 '24 19:01 kovar-ursa

if you have MSL checked (which is the default) it outputs MSL for altitude, otherwise HAE

if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE_MSL) p.altitude = localPosition.altitude; else p.altitude_hae = localPosition.altitude_hae;

garthvh avatar Jan 18 '24 19:01 garthvh

With bitmask 163 (ALTITUDE, ALTITUDE_MSL, SATINVIEW, TIMESTAMP)

!e2e5b84c │ 42.9693° │ -70.9999° │ 42949665 m. (ignore the bad value for altitude)

With bitmask 161 (ALTITUDE, SATINVIEW, TIMESTAMP):

!e2e5b84c │ 42.9693° │ -70.9999° │ N/A

If I turn off ALTITUDE_MSL but still have ALTITUDE set, no altitude data is transmitted.

I just did the above and the only change to the config file was 163 -> 161. Same firmware, hardware, etc.

kovar-ursa avatar Jan 18 '24 19:01 kovar-ursa

@jp-bennett have you seen a HAE altitude value ever? The code looks to be adding it to the packet and sending it out if the position flag is set but there never seems to be a value.

garthvh avatar Jan 19 '24 18:01 garthvh

have you seen a HAE altitude value ever?

I'm not even entirely sure what an HAE altitude is. I'll look into it when I get back to my work on checking for empty fields.

jp-bennett avatar Jan 19 '24 18:01 jp-bennett

have you seen a HAE altitude value ever?

I'm not even entirely sure what an HAE altitude is. I'll look into it when I get back to my work on checking for empty fields.

Altitude value for aircraft

garthvh avatar Jan 19 '24 18:01 garthvh

HAE is height above ellipsoid. I believe this is the "normal" GPS altitude value, i.e., what all GPS receivers provide.

Some modern GPS receivers have added the ability to calculate height above mean sea level, MSL. This is traditionally done with barometric pressure sensors.

So, I believe, HAE data is what you get from all GPS receivers and MSL data only is produced by GPS receivers with the ability to calculate height above MSL.

kovar-ursa avatar Jan 19 '24 18:01 kovar-ursa

https://avionicswest.com/Articles/GPSalt.html

kovar-ursa avatar Jan 19 '24 18:01 kovar-ursa