From 6a1db86110612f9a556b78c34bc10a2e4695533c Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 17 Mar 2026 21:55:34 -0800 Subject: [PATCH] refactor(flight_mode_manager/tasks/AutoFollowTarget): convert params.c to module.yaml Convert parameter definition(s) from legacy C format to YAML module configuration. --- .../tasks/AutoFollowTarget/CMakeLists.txt | 1 + .../follow_target_params.yaml | 74 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_params.yaml diff --git a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/CMakeLists.txt b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/CMakeLists.txt index 9abd0c8db2..3117312e14 100644 --- a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/CMakeLists.txt +++ b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/CMakeLists.txt @@ -36,6 +36,7 @@ add_subdirectory(follow_target_estimator) px4_add_library(FlightTaskAutoFollowTarget FlightTaskAutoFollowTarget.cpp ) +set_property(GLOBAL APPEND PROPERTY PX4_MODULE_CONFIG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/follow_target_params.yaml) target_link_libraries(FlightTaskAutoFollowTarget PUBLIC FlightTaskAuto follow_target_estimator) target_include_directories(FlightTaskAutoFollowTarget PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_params.yaml b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_params.yaml new file mode 100644 index 0000000000..76d600be76 --- /dev/null +++ b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_params.yaml @@ -0,0 +1,74 @@ +module_name: AutoFollowTarget +parameters: +- group: Follow target + definitions: + FLW_TGT_RS: + description: + short: Responsiveness to target movement in Target Estimator + long: lower values increase the responsiveness to changing position, but also + ignore less noise + type: float + default: 0.1 + min: 0.0 + max: 1.0 + decimal: 2 + FLW_TGT_HT: + description: + short: Follow target height + long: Following height above the target + type: float + default: 8.0 + unit: m + min: 8.0 + FLW_TGT_DST: + description: + short: Distance to follow target from + long: The distance in meters to follow the target at + type: float + default: 8.0 + unit: m + min: 1.0 + FLW_TGT_FA: + description: + short: Follow Angle setting in degrees + long: |- + Angle to follow the target from. 0.0 Equals straight in front of the target's + course (direction of motion) and the angle increases in clockwise direction, + meaning Right-side would be 90.0 degrees while Left-side is -90.0 degrees + + Note: When the user force sets the angle out of the min/max range, it will be + wrapped (e.g. 480 -> 120) in the range to gracefully handle the out of range. + type: float + default: 180.0 + min: -180.0 + max: 180.0 + FLW_TGT_ALT_M: + description: + short: Altitude control mode + long: |- + Maintain altitude or track target's altitude. When maintaining the altitude, + the drone can crash into terrain when the target moves uphill. When tracking + the target's altitude, the follow altitude FLW_TGT_HT should be high enough + to prevent terrain collisions due to GPS inaccuracies of the target. + type: enum + values: + 0: '2D Tracking: Maintain constant altitude relative to home and track XY + position only' + 1: '2D + Terrain: Maintain constant altitude relative to terrain below and + track XY position' + 2: '3D Tracking: Track target''s altitude (be aware that GPS altitude bias + usually makes this useless)' + default: 0 + FLW_TGT_MAX_VEL: + description: + short: Max tangential velocity for follow orbit trajectory + long: |- + Maximum tangential velocity setting for generating the follow orbit trajectory + + This is the maximum tangential velocity the drone will circle around the target whenever + an orbit angle setpoint changes. Higher value means more aggressive follow behavior. + type: float + default: 5.0 + min: 0.0 + max: 20.0 + decimal: 1