Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sysid filtered output #1443

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions MAVProxy/modules/mavproxy_asterix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions MAVProxy/modules/mavproxy_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 0 additions & 14 deletions MAVProxy/modules/mavproxy_map/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down