From c1000372b27f219dbbc9ac3bab4746f08a41bc33 Mon Sep 17 00:00:00 2001 From: bnsgeyer Date: Mon, 13 May 2024 12:16:57 -0400 Subject: [PATCH] Copter: implement suggested changes --- ArduCopter/mode.h | 2 +- ArduCopter/mode_systemid.cpp | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ArduCopter/mode.h b/ArduCopter/mode.h index 24eac58a899406..3414d376b0f53b 100644 --- a/ArduCopter/mode.h +++ b/ArduCopter/mode.h @@ -3,7 +3,7 @@ #include "Copter.h" #include #include // TODO why is this needed if Copter.h includes this -#include + class Parameters; class ParametersG2; diff --git a/ArduCopter/mode_systemid.cpp b/ArduCopter/mode_systemid.cpp index 4a9f35c305218e..15f4ff16dc014d 100644 --- a/ArduCopter/mode_systemid.cpp +++ b/ArduCopter/mode_systemid.cpp @@ -1,4 +1,5 @@ #include "Copter.h" +#include #if MODE_SYSTEMID_ENABLED == ENABLED @@ -426,11 +427,18 @@ bool ModeSystemId::is_poscontrol_axis_type() const { bool ret = false; - if ((AxisType)axis.get() == AxisType::DISTURB_POS_LAT || (AxisType)axis.get() == AxisType::DISTURB_POS_LONG - || (AxisType)axis.get() == AxisType::DISTURB_VEL_LAT || (AxisType)axis.get() == AxisType::DISTURB_VEL_LONG - || (AxisType)axis.get() == AxisType::INPUT_LOITER_LAT || (AxisType)axis.get() == AxisType::INPUT_LOITER_LONG) { - ret = true; - } + switch ((AxisType)axis.get()) { + case AxisType::DISTURB_POS_LAT: + case AxisType::DISTURB_POS_LONG: + case AxisType::DISTURB_VEL_LAT: + case AxisType::DISTURB_VEL_LONG: + case AxisType::INPUT_LOITER_LAT: + case AxisType::INPUT_LOITER_LONG: + ret = true; + break; + default: + break; + } return ret; }