Skip to content

Commit affff0c

Browse files
tridgeclaude
andcommitted
mavproxy_adsb: don't render real ADSB aircraft as the OBC flag icon
add_vehicle() was deriving emitter_type purely from get_internal_emitter(state['ICAO_address']), which is an OBC test helper: it maps a handful of synthetic ICAO bands (drones, weather, birds, OBC aircraft) to specific internal types and falls through to 99 ('flag.png', commented "dummy it for now") for everything else. Real-world ADSB feeds supply genuine 24-bit ICAOs in the 0x004000..0x9FFFFF range, so every live aircraft was being shown as the flag placeholder instead of a plane. Only consult get_internal_emitter() for ICAOs inside the OBC bands (<=0x003FFF or >=0xA00000); for everything else trust the supplied state['emitter_type'] so live ADSB data displays with its proper ADSB_EMITTER_TYPE icon. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 61a4e08 commit affff0c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

MAVProxy/modules/mavproxy_adsb.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,17 @@ def add_vehicle(self, state):
239239
altitude_km = state['altitude']
240240
callsign = state['callsign']
241241
heading = state['heading']
242-
emitter_type = get_internal_emitter(state['ICAO_address'])
242+
# OBC test framework reserves specific ICAO bands for synthetic
243+
# obstacles (drones/aircraft/birds/clouds) and maps them to
244+
# internal emitter types via get_internal_emitter(); for real
245+
# ADSB addresses (0x004000..0x9FFFFF) trust the supplied
246+
# emitter_type so we don't render every live aircraft as the
247+
# placeholder "flag" icon.
248+
icao = state['ICAO_address']
249+
if icao <= 0x003FFF or icao >= 0xA00000:
250+
emitter_type = get_internal_emitter(icao)
251+
else:
252+
emitter_type = state.get('emitter_type', 0) or 0
243253
squawk = state['squawk']
244254

245255
if id not in self.threat_vehicles.keys(): # check to see if the vehicle is in the dict

0 commit comments

Comments
 (0)