kopia lustrzana https://github.com/cyoung/stratux
better traffic altitude computation for flarm targets, fixes flarm altitude in web radar
rodzic
04d62bfb62
commit
5b5859a522
|
@ -106,10 +106,10 @@ func makeFlarmPFLAAString(ti TrafficInfo) (msg string, valid bool) {
|
||||||
//}
|
//}
|
||||||
|
|
||||||
altf := mySituation.BaroPressureAltitude
|
altf := mySituation.BaroPressureAltitude
|
||||||
if !isTempPressValid() { // if no pressure altitude available, use GPS altitude
|
if !isTempPressValid() && isGPSValid() { // if no pressure altitude available, use GPS altitude
|
||||||
altf = mySituation.GPSAltitudeMSL
|
altf = mySituation.GPSAltitudeMSL
|
||||||
}
|
}
|
||||||
if ti.AltIsGNSS {
|
if ti.AltIsGNSS && isGPSValid() {
|
||||||
// Altitude coming from OGN. We set the geoid separation to 0 in the OGN config, so OGN reports ellipsoid alt - we need to compare to that
|
// Altitude coming from OGN. We set the geoid separation to 0 in the OGN config, so OGN reports ellipsoid alt - we need to compare to that
|
||||||
altf = mySituation.GPSHeightAboveEllipsoid
|
altf = mySituation.GPSHeightAboveEllipsoid
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,8 +389,16 @@ func processAprsData(aprsData string) {
|
||||||
ti.Last_source = TRAFFIC_SOURCE_FLARM
|
ti.Last_source = TRAFFIC_SOURCE_FLARM
|
||||||
|
|
||||||
// set altitude
|
// set altitude
|
||||||
ti.Alt = int32(data.Altitude)
|
// To keep the rest of the system as simple as possible, we want to work with barometric altitude everywhere.
|
||||||
ti.AltIsGNSS = true
|
// To do so, we use our own known geoid separation and pressure difference to compute the expected barometric altitude of the traffic.
|
||||||
|
if isGPSValid() && isTempPressValid() {
|
||||||
|
ti.Alt = int32(float32(data.Altitude) - mySituation.GPSHeightAboveEllipsoid + mySituation.BaroPressureAltitude)
|
||||||
|
} else {
|
||||||
|
ti.Alt = int32(data.Altitude)
|
||||||
|
ti.AltIsGNSS = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ti.Last_alt = stratuxClock.Time
|
ti.Last_alt = stratuxClock.Time
|
||||||
|
|
||||||
// set vertical speed
|
// set vertical speed
|
||||||
|
|
Ładowanie…
Reference in New Issue