From b6e54d927dc2c0dd091bd1133665820153fbecb6 Mon Sep 17 00:00:00 2001 From: Andras Schaffer Date: Mon, 23 Aug 2021 00:37:35 +0200 Subject: [PATCH] fix coax and single copter firmware type setting --- Common.cs | 11 ++++++----- ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Common.cs b/Common.cs index a77719d285..253e0cfbcf 100644 --- a/Common.cs +++ b/Common.cs @@ -65,6 +65,12 @@ public static GMapMarker getMAVMarker(MAVState MAV) return (new GMapMarkerAntennaTracker(portlocation, MAV.cs.yaw, MAV.cs.target_bearing){ Tag = MAV}); } + else if (MAV.aptype == MAVLink.MAV_TYPE.COAXIAL) + { + return (new GMapMarkerSingle(portlocation, MAV.cs.yaw, + MAV.cs.groundcourse, MAV.cs.nav_bearing, MAV.sysid) + { Tag = MAV }); + } else if (MAV.cs.firmware == Firmwares.ArduCopter2 || MAV.aptype == MAVLink.MAV_TYPE.QUADROTOR) { if (MAV.param.ContainsKey("AVD_W_DIST_XY") && MAV.param.ContainsKey("AVD_F_DIST_XY")) @@ -88,11 +94,6 @@ public static GMapMarker getMAVMarker(MAVState MAV) Tag = MAV }); } - else if (MAV.aptype == MAVLink.MAV_TYPE.COAXIAL) - { - return (new GMapMarkerSingle(portlocation, MAV.cs.yaw, - MAV.cs.groundcourse, MAV.cs.nav_bearing, MAV.sysid){ Tag = MAV}); - } else { // unknown type diff --git a/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs b/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs index 7a229674ee..502d8db56f 100644 --- a/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs +++ b/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs @@ -6297,7 +6297,9 @@ public void setAPType(byte sysid, byte compid) case MAV_TYPE.ANTENNA_TRACKER: MAVlist[sysid, compid].cs.firmware = Firmwares.ArduTracker; break; - + case MAV_TYPE.COAXIAL: + MAVlist[sysid, compid].cs.firmware = Firmwares.ArduCopter2; + break; default: MAVlist[sysid, compid].cs.firmware = Firmwares.Other; log.Error(MAVlist[sysid, compid].aptype + " not registered as valid type");