From 8411b2ec03760dea13d0f3db3f072ebe825ab415 Mon Sep 17 00:00:00 2001 From: Shiv Tyagi Date: Thu, 28 Jul 2022 15:25:41 +0530 Subject: [PATCH] SITL: add param in SIM_Precland to enable return dist to target --- libraries/SITL/SIM_Precland.cpp | 7 +++++++ libraries/SITL/SIM_Precland.h | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/libraries/SITL/SIM_Precland.cpp b/libraries/SITL/SIM_Precland.cpp index cfbf91301f..8406d1696c 100644 --- a/libraries/SITL/SIM_Precland.cpp +++ b/libraries/SITL/SIM_Precland.cpp @@ -105,6 +105,13 @@ const AP_Param::GroupInfo SIM_Precland::var_info[] = { // @User: Advanced AP_GROUPINFO("ORIENT", 9, SIM_Precland, _orient, ROTATION_PITCH_90), + // @Param: OPTIONS + // @DisplayName: SIM_Precland extra options + // @Description: SIM_Precland extra options + // @Bitmask: 0: Enable target distance + // @User: Advanced + AP_GROUPINFO("OPTIONS", 10, SIM_Precland, _options, 0), + AP_GROUPEND }; diff --git a/libraries/SITL/SIM_Precland.h b/libraries/SITL/SIM_Precland.h index 827e83a5d5..f779867e6f 100644 --- a/libraries/SITL/SIM_Precland.h +++ b/libraries/SITL/SIM_Precland.h @@ -41,6 +41,11 @@ public: void set_default_location(float lat, float lon, int16_t yaw); static const struct AP_Param::GroupInfo var_info[]; + // enum for SIM_PLD_OPTIONS parameter + enum class Option : uint8_t { + ENABLE_TARGET_DISTANCE = (1U << 0), + }; + AP_Int8 _enable; AP_Float _device_lat; AP_Float _device_lon; @@ -51,6 +56,7 @@ public: AP_Float _alt_limit; AP_Float _dist_limit; AP_Int8 _orient; + AP_Enum