diff --git a/pkg/bbl/bblreader.go b/pkg/bbl/bblreader.go index 22029f7..e00c305 100644 --- a/pkg/bbl/bblreader.go +++ b/pkg/bbl/bblreader.go @@ -515,6 +515,7 @@ func (lg *BBLOG) Reader(meta types.FlightMeta) (types.LogSegment, bool) { homes.Flags = types.HOME_ARM | types.HOME_ALT if b.Bearing == -2 { _, dh := geo.Csedist(b.Hlat, b.Hlon, b.Lat, b.Lon) + if dh > 2.0/1852.0 { homes.SafeLat = b.Hlat homes.SafeLon = b.Hlon diff --git a/pkg/bltmqtt/bltmqtt.go b/pkg/bltmqtt/bltmqtt.go index 2302dee..2ce4045 100644 --- a/pkg/bltmqtt/bltmqtt.go +++ b/pkg/bltmqtt/bltmqtt.go @@ -565,7 +565,16 @@ func MQTTGen(s types.LogSegment) { if i%miscout == 0 { msg := make_bullet_mode(fmode, ncells, b.HWfail) output_message(c, wfh, msg, b.Utc) - msg = make_bullet_home(s.H.HomeLat, s.H.HomeLon, s.H.HomeAlt) + var hlat, hlon float64 + if s.H.Flags&types.HOME_SAFE != 0 { + hlat = s.H.SafeLat + hlon = s.H.SafeLon + } else { + hlat = s.H.HomeLat + hlon = s.H.HomeLon + } + + msg = make_bullet_home(hlat, hlon, s.H.HomeAlt) output_message(c, wfh, msg, b.Utc) if len(mstrs) > 0 && i%2*miscout == 0 { for _, str := range mstrs {