From 6943ea59b17d0697d1b44c66cfa3fc36063bde2a Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 13 May 2023 11:24:27 +1000 Subject: [PATCH] AP_HAL: add simulator for RDS02UF rangefinder --- libraries/AP_HAL/SIMState.cpp | 3 +++ libraries/AP_HAL/SIMState.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/libraries/AP_HAL/SIMState.cpp b/libraries/AP_HAL/SIMState.cpp index 9c461010f4..a0a3a82c68 100644 --- a/libraries/AP_HAL/SIMState.cpp +++ b/libraries/AP_HAL/SIMState.cpp @@ -163,6 +163,9 @@ void SIMState::fdm_input_local(void) if (leddarone != nullptr) { leddarone->update(sitl_model->rangefinder_range()); } + if (rds02uf != nullptr) { + rds02uf->update(sitl_model->rangefinder_range()); + } if (USD1_v0 != nullptr) { USD1_v0->update(sitl_model->rangefinder_range()); } diff --git a/libraries/AP_HAL/SIMState.h b/libraries/AP_HAL/SIMState.h index b16f1144a2..3d420963de 100644 --- a/libraries/AP_HAL/SIMState.h +++ b/libraries/AP_HAL/SIMState.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -139,6 +140,8 @@ private: SITL::RF_BLping *blping; // simulated LeddarOne rangefinder: SITL::RF_LeddarOne *leddarone; + // simulated RDS02UF rangefinder: + SITL::RF_RDS02UF *rds02uf; // simulated USD1 v0 rangefinder: SITL::RF_USD1_v0 *USD1_v0; // simulated USD1 v1 rangefinder: