From 6c48c346c1481815708ce63ea8eec18bcf29a634 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Fri, 5 Nov 2021 16:13:55 +0000 Subject: [PATCH] AP_Compass: convert param to new custom rotation --- libraries/AP_Compass/AP_Compass.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index 9a087c70a7..e527286cfc 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "AP_Compass_SITL.h" #include "AP_Compass_AK8963.h" @@ -640,6 +641,7 @@ const AP_Param::GroupInfo Compass::var_info[] = { // @Increment: 1 // @RebootRequired: True // @User: Advanced + // index 49 // @Param: CUS_PIT @@ -650,6 +652,7 @@ const AP_Param::GroupInfo Compass::var_info[] = { // @Increment: 1 // @RebootRequired: True // @User: Advanced + // index 50 // @Param: CUS_YAW @@ -660,7 +663,9 @@ const AP_Param::GroupInfo Compass::var_info[] = { // @Increment: 1 // @RebootRequired: True // @User: Advanced + // index 51 + AP_GROUPEND }; @@ -688,6 +693,30 @@ void Compass::init() return; } + // convert to new custom rotation method + // PARAMETER_CONVERSION - Added: Nov-2021 +#if !APM_BUILD_TYPE(APM_BUILD_AP_Periph) + for (StateIndex i(0); i 1 // Look if there was a primary compass setup in previous version // if so and the the primary compass is not set in current setup