Skip to content

Commit

Permalink
Map: remove set_secondary_vehicle_position
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Sep 3, 2024
1 parent e60032d commit 1e2d8c6
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 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 Expand Up @@ -1198,7 +1184,7 @@ def mavlink_packet(self, m):

elif mtype == "NAV_CONTROLLER_OUTPUT":
tlayer = 'Trajectory%u' % m.get_srcSystem()
if (self.master.flightmode in [ "AUTO", "GUIDED", "LOITER", "RTL", "QRTL", "QLOITER", "QLAND", "FOLLOW", "ZIGZAG" ] and
if (self.master.flightmode in [ "AUTO", "GUIDED", "LOITER", "RTL", "QRTL","QLOITER", "QLAND", "FOLLOW", "ZIGZAG", "CIRCLE"] and
m.get_srcSystem() in self.lat_lon_heading):
(lat,lon,_) = self.lat_lon_heading[m.get_srcSystem()]
trajectory = [ (lat, lon),
Expand All @@ -1218,7 +1204,7 @@ def mavlink_packet(self, m):
return
tlayer = 'PostionTarget%u' % m.get_srcSystem()
(lat,lon,_) = self.lat_lon_heading[m.get_srcSystem()]
if (self.master.flightmode in [ "AUTO", "GUIDED", "LOITER", "RTL", "QRTL", "QLOITER", "QLAND", "FOLLOW" ]):
if (self.master.flightmode in [ "AUTO", "GUIDED", "LOITER", "RTL", "QRTL", "QLOITER", "QLAND", "FOLLOW", "CIRCLE"]):
lat_float = m.lat_int*1e-7
lon_float = m.lon_int*1e-7
vec = [ (lat_float, lon_float),
Expand Down

0 comments on commit 1e2d8c6

Please sign in to comment.