From a8a952d6566d32a3deb1cfe79054d3cec309c67f Mon Sep 17 00:00:00 2001 From: Shiv Tyagi Date: Fri, 19 Aug 2022 16:25:01 +0530 Subject: [PATCH] Rover: include fix in mode.h Co-authored-by: Peter Barker --- Rover/Rover.h | 14 ++++++++++---- Rover/mode.cpp | 1 - Rover/mode.h | 10 +--------- Rover/mode_acro.cpp | 1 - Rover/mode_auto.cpp | 1 - Rover/mode_follow.cpp | 1 - Rover/mode_guided.cpp | 1 - Rover/mode_hold.cpp | 1 - Rover/mode_loiter.cpp | 1 - Rover/mode_manual.cpp | 1 - Rover/mode_rtl.cpp | 1 - Rover/mode_simple.cpp | 1 - Rover/mode_smart_rtl.cpp | 1 - Rover/mode_steering.cpp | 1 - 14 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Rover/Rover.h b/Rover/Rover.h index 9291c9e587..0a7ec01471 100644 --- a/Rover/Rover.h +++ b/Rover/Rover.h @@ -19,6 +19,7 @@ #include #include +#include // Libraries #include @@ -37,18 +38,21 @@ #include #include #include +#include +#include +#include + +// Configuration +#include "defines.h" +#include "config.h" #if AP_SCRIPTING_ENABLED #include #endif // Local modules -#include "mode.h" #include "AP_Arming.h" #include "sailboat.h" -// Configuration -#include "config.h" -#include "defines.h" #if ADVANCED_FAILSAFE == ENABLED #include "afs_rover.h" #endif @@ -58,6 +62,8 @@ #include "AP_Rally.h" #include "RC_Channel.h" // RC Channel Library +#include "mode.h" + class Rover : public AP_Vehicle { public: friend class GCS_MAVLINK_Rover; diff --git a/Rover/mode.cpp b/Rover/mode.cpp index b5b6935078..21765ebadf 100644 --- a/Rover/mode.cpp +++ b/Rover/mode.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" Mode::Mode() : diff --git a/Rover/mode.h b/Rover/mode.h index c330aad0cd..496ec2c948 100644 --- a/Rover/mode.h +++ b/Rover/mode.h @@ -1,14 +1,6 @@ #pragma once -#include - -#include -#include -#include -#include -#include - -#include "defines.h" +#include "Rover.h" // pre-define ModeRTL so Auto can appear higher in this file class ModeRTL; diff --git a/Rover/mode_acro.cpp b/Rover/mode_acro.cpp index 5379be5fe4..d59f208f0a 100644 --- a/Rover/mode_acro.cpp +++ b/Rover/mode_acro.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" void ModeAcro::update() diff --git a/Rover/mode_auto.cpp b/Rover/mode_auto.cpp index 419209fc2a..68cbdc35a4 100644 --- a/Rover/mode_auto.cpp +++ b/Rover/mode_auto.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" #define AUTO_GUIDED_SEND_TARGET_MS 1000 diff --git a/Rover/mode_follow.cpp b/Rover/mode_follow.cpp index 60075b537e..437cb53deb 100644 --- a/Rover/mode_follow.cpp +++ b/Rover/mode_follow.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" // initialize follow mode diff --git a/Rover/mode_guided.cpp b/Rover/mode_guided.cpp index 0efac5af40..76f3436760 100644 --- a/Rover/mode_guided.cpp +++ b/Rover/mode_guided.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" bool ModeGuided::_enter() diff --git a/Rover/mode_hold.cpp b/Rover/mode_hold.cpp index df2759a51c..ea989157e3 100644 --- a/Rover/mode_hold.cpp +++ b/Rover/mode_hold.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" void ModeHold::update() diff --git a/Rover/mode_loiter.cpp b/Rover/mode_loiter.cpp index f1ba5ac277..918144c9fa 100644 --- a/Rover/mode_loiter.cpp +++ b/Rover/mode_loiter.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" bool ModeLoiter::_enter() diff --git a/Rover/mode_manual.cpp b/Rover/mode_manual.cpp index 35aacfa9b5..1435aa2b92 100644 --- a/Rover/mode_manual.cpp +++ b/Rover/mode_manual.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" void ModeManual::_exit() diff --git a/Rover/mode_rtl.cpp b/Rover/mode_rtl.cpp index 53ebefc0eb..b9a8ee4964 100644 --- a/Rover/mode_rtl.cpp +++ b/Rover/mode_rtl.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" bool ModeRTL::_enter() diff --git a/Rover/mode_simple.cpp b/Rover/mode_simple.cpp index c91313134b..73bb4932a7 100644 --- a/Rover/mode_simple.cpp +++ b/Rover/mode_simple.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" void ModeSimple::init_heading() diff --git a/Rover/mode_smart_rtl.cpp b/Rover/mode_smart_rtl.cpp index 62c3556ea4..0d083965e4 100644 --- a/Rover/mode_smart_rtl.cpp +++ b/Rover/mode_smart_rtl.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" bool ModeSmartRTL::_enter() diff --git a/Rover/mode_steering.cpp b/Rover/mode_steering.cpp index d46e2c5fac..d86a155f35 100644 --- a/Rover/mode_steering.cpp +++ b/Rover/mode_steering.cpp @@ -1,4 +1,3 @@ -#include "mode.h" #include "Rover.h" void ModeSteering::update()