From c123390719a37d6a4e859f95c14f8634d7399fab Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Sat, 2 Dec 2017 09:52:38 +0800 Subject: [PATCH] MagCalib: ensure we start from a valid state --- MagCalib.cs | 15 +++++++++++++++ MissionPlanner.csproj | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/MagCalib.cs b/MagCalib.cs index 93d95fb786..a2e931da22 100644 --- a/MagCalib.cs +++ b/MagCalib.cs @@ -312,6 +312,21 @@ static void prd_DoWork(object sender, ProgressWorkerEventArgs e, object passdata bool havecompass2 = false; bool havecompass3 = false; + if (MainV2.comPort.MAV.param.ContainsKey("COMPASS_OFS_X")) + { + MainV2.comPort.setParam("COMPASS_OFS_X", 0, true); + MainV2.comPort.setParam("COMPASS_OFS_Y", 0, true); + MainV2.comPort.setParam("COMPASS_OFS_Z", 0, true); + + MainV2.comPort.setParam("COMPASS_DIA_X", 1, true); + MainV2.comPort.setParam("COMPASS_DIA_Y", 1, true); + MainV2.comPort.setParam("COMPASS_DIA_Z", 1, true); + + MainV2.comPort.setParam("COMPASS_ODI_X", 0, true); + MainV2.comPort.setParam("COMPASS_ODI_Y", 0, true); + MainV2.comPort.setParam("COMPASS_ODI_Z", 0, true); + } + //compass2 get mag2 offsets if (MainV2.comPort.MAV.param.ContainsKey("COMPASS_OFS2_X")) { diff --git a/MissionPlanner.csproj b/MissionPlanner.csproj index 3e307b3ca0..f56489e68e 100644 --- a/MissionPlanner.csproj +++ b/MissionPlanner.csproj @@ -6,7 +6,7 @@ Exe Michael Oborne - 1.3.50.12 full + 1.3.50.13 full Mission Planner Mission Planner Mission Planner ground control station for ardupilot