From fc28e2d7b8537889ebf3f75d8fef00d256c6e2b8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 17 Jul 2024 16:46:42 +1000 Subject: [PATCH] SITL: adjust for renaming of Gimbal to SoloGimbal --- libraries/SITL/SIM_SoloGimbal.cpp | 26 ++++++++++++-------------- libraries/SITL/SIM_SoloGimbal.h | 19 ++++++++----------- libraries/SITL/SIM_config.h | 4 ++++ 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/libraries/SITL/SIM_SoloGimbal.cpp b/libraries/SITL/SIM_SoloGimbal.cpp index 649159da9f..123469344b 100644 --- a/libraries/SITL/SIM_SoloGimbal.cpp +++ b/libraries/SITL/SIM_SoloGimbal.cpp @@ -16,16 +16,14 @@ gimbal simulator class for MAVLink gimbal */ -#include "SIM_Gimbal.h" +#include "SIM_SoloGimbal.h" -#if HAL_SIM_GIMBAL_ENABLED +#if AP_SIM_SOLOGIMBAL_ENABLED #include #include "SIM_Aircraft.h" -#include - extern const AP_HAL::HAL& hal; #define GIMBAL_DEBUG 0 @@ -38,7 +36,7 @@ extern const AP_HAL::HAL& hal; namespace SITL { -Gimbal::Gimbal(const struct sitl_fdm &_fdm) : +SoloGimbal::SoloGimbal(const struct sitl_fdm &_fdm) : fdm(_fdm), target_address("127.0.0.1"), target_port(5762), @@ -58,7 +56,7 @@ Gimbal::Gimbal(const struct sitl_fdm &_fdm) : /* update the gimbal state */ -void Gimbal::update(void) +void SoloGimbal::update(void) { // calculate delta time in seconds uint32_t now_us = AP_HAL::micros(); @@ -213,7 +211,7 @@ static struct gimbal_param { /* find a parameter structure */ -struct gimbal_param *Gimbal::param_find(const char *name) +struct gimbal_param *SoloGimbal::param_find(const char *name) { for (uint8_t i=0; i +#include "SIM_config.h" -#ifndef HAL_SIM_GIMBAL_ENABLED -#define HAL_SIM_GIMBAL_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL) && !defined(HAL_BUILD_AP_PERIPH) -#endif - -#if HAL_SIM_GIMBAL_ENABLED +#if AP_SIM_SOLOGIMBAL_ENABLED +#include +#include #include -#include "SIM_Aircraft.h" - namespace SITL { -class Gimbal { +class SoloGimbal { public: - Gimbal(const struct sitl_fdm &_fdm); + SoloGimbal(const struct sitl_fdm &_fdm); void update(void); private: @@ -128,4 +124,5 @@ private: } // namespace SITL -#endif // HAL_SIM_GIMBAL_ENABLED +#endif // AP_SIM_SOLOGIMBAL_ENABLED + diff --git a/libraries/SITL/SIM_config.h b/libraries/SITL/SIM_config.h index bd5d07e799..21986735f8 100644 --- a/libraries/SITL/SIM_config.h +++ b/libraries/SITL/SIM_config.h @@ -121,3 +121,7 @@ #ifndef AP_SIM_GLIDER_ENABLED #define AP_SIM_GLIDER_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL) #endif + +#ifndef AP_SIM_SOLOGIMBAL_ENABLED +#define AP_SIM_SOLOGIMBAL_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL) +#endif