diff --git a/Common.cs b/Common.cs index e4c6fc87f8..7a226e5a4e 100644 --- a/Common.cs +++ b/Common.cs @@ -42,7 +42,7 @@ public static GMapMarker getMAVMarker(MAVState MAV, GMapOverlay overlay = null) itemp.Cog = MAV.cs.groundcourse; itemp.Target = MAV.cs.target_bearing; itemp.Nav_bearing = MAV.cs.nav_bearing; - itemp.Radius = MAV.cs.radius * CurrentState.multiplierdist; + itemp.Radius = (float)CurrentState.fromDistDisplayUnit(MAV.cs.radius); return null; } else if (item is GMapMarkerQuad) @@ -76,7 +76,7 @@ public static GMapMarker getMAVMarker(MAVState MAV, GMapOverlay overlay = null) { return (new GMapMarkerPlane(MAV.sysid - 1, portlocation, MAV.cs.yaw, MAV.cs.groundcourse, MAV.cs.nav_bearing, MAV.cs.target_bearing, - MAV.cs.radius * CurrentState.multiplierdist) + (float)CurrentState.toDistDisplayUnit(MAV.cs.radius)) { ToolTipText = ArduPilot.Common.speechConversion(MAV, "" + Settings.Instance["mapicondesc"]), ToolTipMode = String.IsNullOrEmpty(Settings.Instance["mapicondesc"]) ? MarkerTooltipMode.Never : MarkerTooltipMode.Always, diff --git a/ExtLibs/ArduPilot/CurrentState.cs b/ExtLibs/ArduPilot/CurrentState.cs index b44500cc68..217dffb170 100644 --- a/ExtLibs/ArduPilot/CurrentState.cs +++ b/ExtLibs/ArduPilot/CurrentState.cs @@ -1047,7 +1047,7 @@ public float radius get { if (_groundspeed <= 1) return 0; - return (float)(groundspeed * groundspeed / (9.80665 * Math.Tan(roll * MathHelper.deg2rad))); + return (float)toDistDisplayUnit(_groundspeed * _groundspeed / (9.80665 * Math.Tan(roll * MathHelper.deg2rad))); } } [GroupText("Position")] diff --git a/Swarm/Formation.cs b/Swarm/Formation.cs index 3e08a7572d..2628291323 100644 --- a/Swarm/Formation.cs +++ b/Swarm/Formation.cs @@ -191,7 +191,7 @@ public override void SendCommand() if (true) { - var leaderturnrad = Leader.cs.radius; + var leaderturnrad = CurrentState.fromDistDisplayUnit(Leader.cs.radius); var mavturnradius = leaderturnrad - x; {