Skip to content

Commit

Permalink
MAVProxy: add compatibility code for MAV_TYPE_VTOL_DUOROTOR rename to…
Browse files Browse the repository at this point in the history
… MAV_TYPE_VTOL_TAILSITTER_DUOROTOR
  • Loading branch information
peterbarker committed Nov 12, 2024
1 parent f665668 commit 3ae8c12
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions MAVProxy/modules/mavproxy_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,19 @@ def heartbeat_is_from_autopilot(self, m):

return True

mav_type_planes = [
mavutil.mavlink.MAV_TYPE_FIXED_WING,
mavutil.mavlink.MAV_TYPE_VTOL_QUADROTOR,
mavutil.mavlink.MAV_TYPE_VTOL_TILTROTOR,
]
# VTOL_DUOROTOR was renamed to VTOL_TAILSITTER_DUOROTOR
for possible_plane_type in "VTOL_DUOROTOR", "VTOL_TAILSITTER_DUOROTOR":
t = f"MAV_TYPE_{possible_plane_type}"
attr = getattr(mavutil.mavlink, t, None)
if attr is None:
continue
mav_type_planes.append(attr)

def master_msg_handling(self, m, master):
'''link message handling for an upstream link'''

Expand Down Expand Up @@ -739,11 +752,7 @@ def master_msg_handling(self, m, master):
self.status.last_mode_announced = master.flightmode
self.say("Mode " + self.status.flightmode)

if m.type in [
mavutil.mavlink.MAV_TYPE_FIXED_WING,
mavutil.mavlink.MAV_TYPE_VTOL_DUOROTOR,
mavutil.mavlink.MAV_TYPE_VTOL_QUADROTOR,
mavutil.mavlink.MAV_TYPE_VTOL_TILTROTOR]:
if m.type in self.mav_type_planes:
self.mpstate.vehicle_type = 'plane'
self.mpstate.vehicle_name = 'ArduPlane'
elif m.type in [mavutil.mavlink.MAV_TYPE_GROUND_ROVER,
Expand Down

0 comments on commit 3ae8c12

Please sign in to comment.