From e60032d956fee07b793395bf4d2d5c654fee8bc8 Mon Sep 17 00:00:00 2001 From: Stephen Dade Date: Tue, 3 Sep 2024 20:49:14 +1000 Subject: [PATCH 1/3] Link: Clean up sysid_outputs --- MAVProxy/modules/mavproxy_link.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/MAVProxy/modules/mavproxy_link.py b/MAVProxy/modules/mavproxy_link.py index ad199efaba..21fa932682 100644 --- a/MAVProxy/modules/mavproxy_link.py +++ b/MAVProxy/modules/mavproxy_link.py @@ -943,22 +943,12 @@ def master_callback(self, m, master): # see if it is handled by a specialised sysid connection if sysid in self.mpstate.sysid_outputs: self.mpstate.sysid_outputs[sysid].write(m.get_msgbuf()) - if mtype == "GLOBAL_POSITION_INT": - for modname in 'map', 'asterix', 'NMEA', 'NMEA2': - mod = self.module(modname) - if mod is not None: - mod.set_secondary_vehicle_position(m) - return if getattr(m, '_timestamp', None) is None: master.post_message(m) self.status.counters['MasterIn'][master.linknum] += 1 if mtype == 'GLOBAL_POSITION_INT': - # send GLOBAL_POSITION_INT to 2nd GCS for 2nd vehicle display - for sysid in self.mpstate.sysid_outputs: - self.mpstate.sysid_outputs[sysid].write(m.get_msgbuf()) - if self.mpstate.settings.fwdpos: for link in self.mpstate.mav_master: if link != master: From a373f147c15064248a637aae90b36fb6c18fa245 Mon Sep 17 00:00:00 2001 From: Stephen Dade Date: Tue, 3 Sep 2024 20:49:41 +1000 Subject: [PATCH 2/3] Map: remove set_secondary_vehicle_position --- MAVProxy/modules/mavproxy_map/__init__.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/MAVProxy/modules/mavproxy_map/__init__.py b/MAVProxy/modules/mavproxy_map/__init__.py index 5340567d7c..ed9b9316de 100644 --- a/MAVProxy/modules/mavproxy_map/__init__.py +++ b/MAVProxy/modules/mavproxy_map/__init__.py @@ -1057,20 +1057,6 @@ def cmd_clear(self, args): self.map.add_object(mp_slipmap.SlipClearLayer(3)) self.have_vehicle = {} - def set_secondary_vehicle_position(self, m): - '''show 2nd vehicle on map''' - if m.get_type() != 'GLOBAL_POSITION_INT': - return - (lat, lon, heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01) - if abs(lat) < 1.0e-3 and abs(lon) > 1.0e-3: - return - # hack for OBC2016 - alt = self.module('terrain').ElevationModel.GetElevation(lat, lon) - agl = m.alt * 0.001 - alt - agl_s = str(int(agl)) + 'm' - self.create_vehicle_icon('VehiclePos2', 'blue', follow=False, vehicle_type='plane') - self.map.set_position('VehiclePos2', (lat, lon), rotation=heading, label=agl_s, colour=(0,255,255)) - def update_vehicle_icon(self, name, vehicle, colour, m, display): '''update display of a vehicle on the map. m is expected to store location in lat/lng *1e7 From 72919e959a72849b7906fecb74f27df15045b972 Mon Sep 17 00:00:00 2001 From: Stephen Dade Date: Tue, 3 Sep 2024 20:50:01 +1000 Subject: [PATCH 3/3] Asterix: remove set_secondary_vehicle_position --- MAVProxy/modules/mavproxy_asterix.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/MAVProxy/modules/mavproxy_asterix.py b/MAVProxy/modules/mavproxy_asterix.py index eca56d3be6..fc254df4ba 100644 --- a/MAVProxy/modules/mavproxy_asterix.py +++ b/MAVProxy/modules/mavproxy_asterix.py @@ -133,15 +133,6 @@ def stop_listener(self): self.sock = None self.tracks = {} - def set_secondary_vehicle_position(self, m): - '''store second vehicle position for filtering purposes''' - if m.get_type() != 'GLOBAL_POSITION_INT': - return - (lat, lon, heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01) - if abs(lat) < 1.0e-3 and abs(lon) < 1.0e-3: - return - self.vehicle2_pos = VehiclePos(m) - def could_collide_hor(self, vpos, adsb_pkt): '''return true if vehicle could come within filter_dist_xy meters of adsb vehicle in timeout seconds''' margin = self.asterix_settings.filter_dist_xy