From 4009643c4a6610c6617c324e0665b5190e1199bd Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 17 Mar 2026 21:55:34 -0800 Subject: [PATCH] refactor(fw_mode_manager): convert params.c to module.yaml Convert 3 parameter file(s) from legacy C format to YAML module configuration. --- src/modules/fw_mode_manager/CMakeLists.txt | 2 + .../fw_mode_manager/fw_mode_manager_params.c | 638 ------------------ .../fw_mode_manager_params.yaml | 519 ++++++++++++++ .../launchdetection/launchdetection_params.c | 81 --- .../runway_takeoff/runway_takeoff_params.c | 128 ---- 5 files changed, 521 insertions(+), 847 deletions(-) delete mode 100644 src/modules/fw_mode_manager/fw_mode_manager_params.c create mode 100644 src/modules/fw_mode_manager/fw_mode_manager_params.yaml delete mode 100644 src/modules/fw_mode_manager/launchdetection/launchdetection_params.c delete mode 100644 src/modules/fw_mode_manager/runway_takeoff/runway_takeoff_params.c diff --git a/src/modules/fw_mode_manager/CMakeLists.txt b/src/modules/fw_mode_manager/CMakeLists.txt index dc32389580..0cbec8f3da 100644 --- a/src/modules/fw_mode_manager/CMakeLists.txt +++ b/src/modules/fw_mode_manager/CMakeLists.txt @@ -63,6 +63,8 @@ px4_add_module( FixedWingModeManager.hpp ControllerConfigurationHandler.cpp ControllerConfigurationHandler.hpp + MODULE_CONFIG + fw_mode_manager_params.yaml DEPENDS ${POSCONTROL_DEPENDENCIES} ) diff --git a/src/modules/fw_mode_manager/fw_mode_manager_params.c b/src/modules/fw_mode_manager/fw_mode_manager_params.c deleted file mode 100644 index 0d3cdf292c..0000000000 --- a/src/modules/fw_mode_manager/fw_mode_manager_params.c +++ /dev/null @@ -1,638 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2025 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * NPFG period - * - * Period of NPFG control law. - * - * @unit s - * @min 1.0 - * @max 100.0 - * @decimal 1 - * @increment 0.1 - * @group FW NPFG Control - */ -PARAM_DEFINE_FLOAT(NPFG_PERIOD, 10.0f); - -/** - * NPFG damping ratio - * - * Damping ratio of NPFG control law. - * - * @min 0.10 - * @max 1.00 - * @decimal 2 - * @increment 0.01 - * @group FW NPFG Control - */ -PARAM_DEFINE_FLOAT(NPFG_DAMPING, 0.7f); - -/** - * Enable automatic lower bound on the NPFG period - * - * Avoids limit cycling from a too aggressively tuned period/damping combination. - * If false, also disables upper bound NPFG_PERIOD_UB. - * - * @boolean - * @group FW NPFG Control - */ -PARAM_DEFINE_INT32(NPFG_LB_PERIOD, 1); - -/** - * Enable automatic upper bound on the NPFG period - * - * Adapts period to maintain track keeping in variable winds and path curvature. - * - * @boolean - * @group FW NPFG Control - */ -PARAM_DEFINE_INT32(NPFG_UB_PERIOD, 1); - -/** - * Roll time constant - * - * Time constant of roll controller command / response, modeled as first order delay. - * Used to determine lower period bound. Setting zero disables automatic period bounding. - * - * @unit s - * @min 0.00 - * @max 2.00 - * @decimal 2 - * @increment 0.05 - * @group FW NPFG Control - */ -PARAM_DEFINE_FLOAT(NPFG_ROLL_TC, 0.5f); - -/** - * NPFG switch distance multiplier - * - * Multiplied by the track error boundary to determine when the aircraft switches - * to the next waypoint and/or path segment. Should be less than 1. - * - * @min 0.1 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group FW NPFG Control - */ -PARAM_DEFINE_FLOAT(NPFG_SW_DST_MLT, 0.32f); - -/** - * Period safety factor - * - * Multiplied by period for conservative minimum period bounding (when period lower - * bounding is enabled). 1.0 bounds at marginal stability. - * - * @min 1.0 - * @max 10.0 - * @decimal 1 - * @increment 0.1 - * @group FW NPFG Control - */ -PARAM_DEFINE_FLOAT(NPFG_PERIOD_SF, 1.5f); - - -/** - * Minimum pitch angle setpoint - * - * Applies in any altitude controlled flight mode. - * - * @unit deg - * @min -60.0 - * @max 0.0 - * @decimal 1 - * @increment 0.5 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_P_LIM_MIN, -30.0f); - -/** - * Maximum pitch angle setpoint - * - * Applies in any altitude controlled flight mode. - * - * @unit deg - * @min 0.0 - * @max 80.0 - * @decimal 1 - * @increment 0.5 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_P_LIM_MAX, 30.0f); - -/** - * Maximum roll angle setpoint - * - * Applies in any altitude controlled flight mode. - * - * @unit deg - * @min 35.0 - * @max 75.0 - * @decimal 1 - * @increment 0.5 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_R_LIM, 50.0f); - -/** - * Throttle limit max - * - * Applies in any altitude controlled flight mode. - * Should be set accordingly to achieve FW_T_CLMB_MAX. - * - * @unit norm - * @min 0.0 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_THR_MAX, 1.0f); - -/** - * Throttle limit min - * - * Applies in any altitude controlled flight mode. - * Usually set to 0 but can be increased to prevent the motor from stopping when - * descending, which can increase achievable descent rates. - * - * @unit norm - * @min 0.0 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_THR_MIN, 0.0f); - -/** - * Idle throttle - * - * This is the minimum throttle while on the ground ("landed") in auto modes. - * - * @unit norm - * @min 0.0 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_THR_IDLE, 0.0f); - -/** - * Maximum landing slope angle - * - * Typically the desired landing slope angle when landing configuration (flaps, airspeed) is enabled. - * Set this value within the vehicle's performance limits. - * - * @unit deg - * @min 1.0 - * @max 45.0 - * @decimal 1 - * @increment 0.5 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_ANG, 5.0f); - -/** - * Minimum pitch during takeoff. - * - * @unit deg - * @min -5.0 - * @max 80.0 - * @decimal 1 - * @increment 0.5 - * @group FW Auto Takeoff - */ -PARAM_DEFINE_FLOAT(FW_TKO_PITCH_MIN, 10.0f); - -/** - * Takeoff Airspeed - * - * The calibrated airspeed setpoint during the takeoff climbout. - * - * If set <= 0, FW_AIRSPD_MIN will be set by default. - * - * @unit m/s - * @min -1.0 - * @decimal 1 - * @increment 0.1 - * @group FW Auto Takeoff - */ -PARAM_DEFINE_FLOAT(FW_TKO_AIRSPD, -1.0f); - -/** - * Landing flare altitude (relative to landing altitude) - * - * NOTE: max(FW_LND_FLALT, FW_LND_FL_TIME * |z-velocity|) is taken as the flare altitude - * - * @unit m - * @min 0.0 - * @decimal 1 - * @increment 0.5 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_FLALT, 0.5f); - -/** - * Use terrain estimation during landing. - * - * This is critical for detecting when to flare, and should be enabled if possible. - * - * If enabled and no measurement is found within a given timeout, the landing waypoint altitude will be used OR the landing - * will be aborted, depending on the criteria set in FW_LND_ABORT. - * - * If disabled, FW_LND_ABORT terrain based criteria are ignored. - * - * @min 0 - * @max 2 - * @value 0 Disable the terrain estimate - * @value 1 Use the terrain estimate to trigger the flare (only) - * @value 2 Calculate landing glide slope relative to the terrain estimate - * @group FW Auto Landing - */ -PARAM_DEFINE_INT32(FW_LND_USETER, 1); - -/** - * Early landing configuration deployment - * - * Allows to deploy the landing configuration (flaps, landing airspeed, etc.) already in - * the loiter-down waypoint before the final approach. - * Otherwise is enabled only in the final approach. - * - * @boolean - * - * @group FW Auto Landing - */ -PARAM_DEFINE_INT32(FW_LND_EARLYCFG, 0); - -/** - * Flare, minimum pitch - * - * Minimum pitch during landing flare. - * - * @unit deg - * @min -5 - * @max 15.0 - * @decimal 1 - * @increment 0.5 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_FL_PMIN, 2.5f); - -/** - * Flare, maximum pitch - * - * Maximum pitch during landing flare. - * - * @unit deg - * @min 0 - * @max 45.0 - * @decimal 1 - * @increment 0.5 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_FL_PMAX, 15.0f); - -/** - * Landing airspeed - * - * The calibrated airspeed setpoint during landing. - * - * If set <= 0, landing airspeed = FW_AIRSPD_MIN by default. - * - * @unit m/s - * @min -1.0 - * @decimal 1 - * @increment 0.1 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_AIRSPD, -1.f); - -/** - * Altitude time constant factor for landing and low-height flight - * - * The TECS altitude time constant (FW_T_ALT_TC) is multiplied by this value. - * - * @unit - * @min 0.2 - * @max 1.0 - * @decimal 1 - * @increment 0.1 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_THRTC_SC, 1.0f); - -/** - * Speed <--> Altitude weight - * - * Adjusts the amount of weighting that the pitch control - * applies to speed vs height errors. - * 0 -> control height only - * 2 -> control speed only (gliders) - * - * @min 0.0 - * @max 2.0 - * @decimal 1 - * @increment 1.0 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_T_SPDWEIGHT, 1.0f); - -/** - * Custom stick configuration - * - * Applies in manual Position and Altitude flight modes. - * - * @min 0 - * @max 3 - * @bit 0 Alternative stick configuration (height rate on throttle stick, airspeed on pitch stick) - * @bit 1 Enable airspeed setpoint via sticks in altitude and position flight mode - * @group FW General - */ -PARAM_DEFINE_INT32(FW_POS_STK_CONF, 2); - -/** - * Default target climbrate. - * - * In auto modes: default climb rate output by controller to achieve altitude setpoints. - * In manual modes: maximum climb rate setpoint. - * - * @unit m/s - * @min 0.1 - * @decimal 2 - * @increment 0.01 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_T_CLMB_R_SP, 3.0f); - -/** - * Default target sinkrate. - * - * In auto modes: default sink rate output by controller to achieve altitude setpoints. - * In manual modes: maximum sink rate setpoint. - * - * @unit m/s - * @min 0.1 - * @decimal 2 - * @increment 0.01 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_T_SINK_R_SP, 2.0f); - -/** - * GPS failure loiter time - * - * The time the system should do open loop loiter and wait for GPS recovery - * before it starts descending. Set to 0 to disable. Roll angle is set to FW_GPSF_R. - * Does only apply for fixed-wing vehicles or VTOLs with NAV_FORCE_VT set to 0. - * - * @unit s - * @min 0 - * @group FW General - */ -PARAM_DEFINE_INT32(FW_GPSF_LT, 30); - -/** - * GPS failure fixed roll angle - * - * Roll angle in GPS failure loiter mode. - * - * @unit deg - * @min 0.0 - * @max 60.0 - * @decimal 1 - * @increment 0.5 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_GPSF_R, 15.0f); - - -/** - * The aircraft's wing span (length from tip to tip). - * - * This is used for limiting the roll setpoint near the ground. (if multiple wings, take the longest span) - * - * @unit m - * @min 0.1 - * @decimal 1 - * @increment 0.1 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_WING_SPAN, 3.0); - -/** - * Height (AGL) of the wings when the aircraft is on the ground. - * - * This is used to constrain a minimum altitude below which we keep wings level to avoid wing tip strike. It's safer - * to give a slight margin here (> 0m) - * - * @unit m - * @min 0.0 - * @decimal 1 - * @increment 1 - * @group FW General - */ -PARAM_DEFINE_FLOAT(FW_WING_HEIGHT, 0.5); - -/** - * Landing flare time - * - * Multiplied by the descent rate to calculate a dynamic altitude at which - * to trigger the flare. - * - * NOTE: max(FW_LND_FLALT, FW_LND_FL_TIME * descent rate) is taken as the flare altitude - * - * @unit s - * @min 0.1 - * @max 5.0 - * @decimal 1 - * @increment 0.1 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_FL_TIME, 1.0f); - -/** - * Landing touchdown time (since flare start) - * - * This is the time after the start of flaring that we expect the vehicle to touch the runway. - * At this time, a 0.5s clamp down ramp will engage, constraining the pitch setpoint to RWTO_PSP. - * If enabled, ensure that RWTO_PSP is configured appropriately for full gear contact on ground roll. - * - * Set to -1.0 to disable touchdown clamping. E.g. it may not be desirable to clamp on belly landings. - * - * The touchdown time will be constrained to be greater than or equal to the flare time (FW_LND_FL_TIME). - * - * @unit s - * @min -1.0 - * @max 5.0 - * @decimal 1 - * @increment 0.1 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_TD_TIME, -1.0f); - -/** - * Landing flare sink rate - * - * TECS will attempt to control the aircraft to this sink rate via pitch angle (throttle killed during flare) - * - * @unit m/s - * @min 0.0 - * @max 2 - * @decimal 2 - * @increment 0.1 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_FL_SINK, 0.25f); - -/** - * Maximum lateral position offset for the touchdown point - * - * @unit m - * @min 0.0 - * @max 10.0 - * @decimal 1 - * @increment 1 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_LND_TD_OFF, 3.0); - -/** - * Landing touchdown nudging option. - * - * Approach angle nudging: shifts the touchdown point laterally while keeping the approach entrance point constant - * Approach path nudging: shifts the touchdown point laterally along with the entire approach path - * - * This is useful for manually adjusting the landing point in real time when map or GNSS errors cause an offset from the - * desired landing vector. Nudging is done with yaw stick, constrained to FW_LND_TD_OFF (in meters) and the direction is - * relative to the vehicle heading (stick deflection to the right = land point moves to the right as seen by the vehicle). - * - * @min 0 - * @max 2 - * @value 0 Disable nudging - * @value 1 Nudge approach angle - * @value 2 Nudge approach path - * @group FW Auto Landing - */ -PARAM_DEFINE_INT32(FW_LND_NUDGE, 2); - -/** - * Bit mask to set the automatic landing abort conditions. - * - * Terrain estimation: - * bit 0: Abort if terrain is not found - * bit 1: Abort if terrain times out (after a first successful measurement) - * - * The last estimate is always used as ground, whether the last valid measurement or the land waypoint, depending on the - * selected abort criteria, until an abort condition is entered. If FW_LND_USETER == 0, these bits are ignored. - * - * TODO: Extend automatic abort conditions - * e.g. glide slope tracking error (horizontal and vertical) - * - * @min 0 - * @max 3 - * @bit 0 Abort if terrain is not found (only applies to mission landings) - * @bit 1 Abort if terrain times out (after a first successful measurement) - * @group FW Auto Landing - */ -PARAM_DEFINE_INT32(FW_LND_ABORT, 3); - -/** - * Fixed-wing launch detection - * - * Enables automatic launch detection based on measured acceleration. Use for hand- or catapult-launched vehicles. - * Not compatible with runway takeoff. - * - * @boolean - * @group FW Auto Takeoff - */ -PARAM_DEFINE_INT32(FW_LAUN_DETCN_ON, 0); - -/** - * Control surface launch delay - * - * Locks control surfaces during pre-launch (armed) and until this time since launch has passed. - * Only affects control surfaces that have corresponding flag set, and not active for runway takeoff. - * Set to 0 to disable any surface locking after arming. - * - * @unit s - * @min 0.0 - * @decimal 1 - * @increment 0.1 - * @group FW Auto Takeoff - */ -PARAM_DEFINE_FLOAT(FW_LAUN_CS_LK_DY, 0.f); - -/** - * Flaps setting during take-off - * - * Sets a fraction of full flaps during take-off. - * Also applies to flaperons if enabled in the mixer/allocation. - * - * @unit norm - * @min 0.0 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group FW Auto Takeoff - */ -PARAM_DEFINE_FLOAT(FW_FLAPS_TO_SCL, 0.0f); - -/** - * Flaps setting during landing - * - * Sets a fraction of full flaps during landing. - * Also applies to flaperons if enabled in the mixer/allocation. - * - * @unit norm - * @min 0.0 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_FLAPS_LND_SCL, 1.0f); - -/** - * Spoiler landing setting - * - * @unit norm - * @min 0.0 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group FW Auto Landing - */ -PARAM_DEFINE_FLOAT(FW_SPOILERS_LND, 0.f); diff --git a/src/modules/fw_mode_manager/fw_mode_manager_params.yaml b/src/modules/fw_mode_manager/fw_mode_manager_params.yaml new file mode 100644 index 0000000000..f3695c92b6 --- /dev/null +++ b/src/modules/fw_mode_manager/fw_mode_manager_params.yaml @@ -0,0 +1,519 @@ +module_name: fw_mode_manager +parameters: +- group: FW Auto Landing + definitions: + FW_LND_ANG: + description: + short: Maximum landing slope angle + long: |- + Typically the desired landing slope angle when landing configuration (flaps, airspeed) is enabled. + Set this value within the vehicle's performance limits. + type: float + default: 5.0 + unit: deg + min: 1.0 + max: 45.0 + decimal: 1 + increment: 0.5 + FW_LND_FLALT: + description: + short: Landing flare altitude (relative to landing altitude) + long: 'NOTE: max(FW_LND_FLALT, FW_LND_FL_TIME * |z-velocity|) is taken as + the flare altitude' + type: float + default: 0.5 + unit: m + min: 0.0 + decimal: 1 + increment: 0.5 + FW_LND_USETER: + description: + short: Use terrain estimation during landing + long: |- + This is critical for detecting when to flare, and should be enabled if possible. + + If enabled and no measurement is found within a given timeout, the landing waypoint altitude will be used OR the landing + will be aborted, depending on the criteria set in FW_LND_ABORT. + + If disabled, FW_LND_ABORT terrain based criteria are ignored. + type: enum + values: + 0: Disable the terrain estimate + 1: Use the terrain estimate to trigger the flare (only) + 2: Calculate landing glide slope relative to the terrain estimate + default: 1 + min: 0 + max: 2 + FW_LND_EARLYCFG: + description: + short: Early landing configuration deployment + long: |- + Allows to deploy the landing configuration (flaps, landing airspeed, etc.) already in + the loiter-down waypoint before the final approach. + Otherwise is enabled only in the final approach. + type: boolean + default: 0 + FW_LND_FL_PMIN: + description: + short: Flare, minimum pitch + long: Minimum pitch during landing flare. + type: float + default: 2.5 + unit: deg + min: -5 + max: 15.0 + decimal: 1 + increment: 0.5 + FW_LND_FL_PMAX: + description: + short: Flare, maximum pitch + long: Maximum pitch during landing flare. + type: float + default: 15.0 + unit: deg + min: 0 + max: 45.0 + decimal: 1 + increment: 0.5 + FW_LND_AIRSPD: + description: + short: Landing airspeed + long: |- + The calibrated airspeed setpoint during landing. + + If set <= 0, landing airspeed = FW_AIRSPD_MIN by default. + type: float + default: -1.0 + unit: m/s + min: -1.0 + decimal: 1 + increment: 0.1 + FW_LND_THRTC_SC: + description: + short: Altitude time constant factor for landing and low-height flight + long: The TECS altitude time constant (FW_T_ALT_TC) is multiplied by this + value. + type: float + default: 1.0 + min: 0.2 + max: 1.0 + decimal: 1 + increment: 0.1 + FW_LND_FL_TIME: + description: + short: Landing flare time + long: |- + Multiplied by the descent rate to calculate a dynamic altitude at which + to trigger the flare. + + NOTE: max(FW_LND_FLALT, FW_LND_FL_TIME * descent rate) is taken as the flare altitude + type: float + default: 1.0 + unit: s + min: 0.1 + max: 5.0 + decimal: 1 + increment: 0.1 + FW_LND_TD_TIME: + description: + short: Landing touchdown time (since flare start) + long: |- + This is the time after the start of flaring that we expect the vehicle to touch the runway. + At this time, a 0.5s clamp down ramp will engage, constraining the pitch setpoint to RWTO_PSP. + If enabled, ensure that RWTO_PSP is configured appropriately for full gear contact on ground roll. + + Set to -1.0 to disable touchdown clamping. E.g. it may not be desirable to clamp on belly landings. + + The touchdown time will be constrained to be greater than or equal to the flare time (FW_LND_FL_TIME). + type: float + default: -1.0 + unit: s + min: -1.0 + max: 5.0 + decimal: 1 + increment: 0.1 + FW_LND_FL_SINK: + description: + short: Landing flare sink rate + long: TECS will attempt to control the aircraft to this sink rate via pitch + angle (throttle killed during flare) + type: float + default: 0.25 + unit: m/s + min: 0.0 + max: 2 + decimal: 2 + increment: 0.1 + FW_LND_TD_OFF: + description: + short: Maximum lateral position offset for the touchdown point + type: float + default: 3.0 + unit: m + min: 0.0 + max: 10.0 + decimal: 1 + increment: 1 + FW_LND_NUDGE: + description: + short: Landing touchdown nudging option + long: |- + Approach angle nudging: shifts the touchdown point laterally while keeping the approach entrance point constant + Approach path nudging: shifts the touchdown point laterally along with the entire approach path + + This is useful for manually adjusting the landing point in real time when map or GNSS errors cause an offset from the + desired landing vector. Nudging is done with yaw stick, constrained to FW_LND_TD_OFF (in meters) and the direction is + relative to the vehicle heading (stick deflection to the right = land point moves to the right as seen by the vehicle). + type: enum + values: + 0: Disable nudging + 1: Nudge approach angle + 2: Nudge approach path + default: 2 + min: 0 + max: 2 + FW_LND_ABORT: + description: + short: Bit mask to set the automatic landing abort conditions + long: |- + Terrain estimation: + bit 0: Abort if terrain is not found + bit 1: Abort if terrain times out (after a first successful measurement) + + The last estimate is always used as ground, whether the last valid measurement or the land waypoint, depending on the + selected abort criteria, until an abort condition is entered. If FW_LND_USETER == 0, these bits are ignored. + + TODO: Extend automatic abort conditions + e.g. glide slope tracking error (horizontal and vertical) + type: bitmask + bit: + 0: Abort if terrain is not found (only applies to mission landings) + 1: Abort if terrain times out (after a first successful measurement) + default: 3 + min: 0 + max: 3 + FW_FLAPS_LND_SCL: + description: + short: Flaps setting during landing + long: |- + Sets a fraction of full flaps during landing. + Also applies to flaperons if enabled in the mixer/allocation. + type: float + default: 1.0 + unit: norm + min: 0.0 + max: 1.0 + decimal: 2 + increment: 0.01 + FW_SPOILERS_LND: + description: + short: Spoiler landing setting + type: float + default: 0.0 + unit: norm + min: 0.0 + max: 1.0 + decimal: 2 + increment: 0.01 +- group: FW Auto Takeoff + definitions: + FW_TKO_PITCH_MIN: + description: + short: Minimum pitch during takeoff + type: float + default: 10.0 + unit: deg + min: -5.0 + max: 80.0 + decimal: 1 + increment: 0.5 + FW_TKO_AIRSPD: + description: + short: Takeoff Airspeed + long: |- + The calibrated airspeed setpoint during the takeoff climbout. + + If set <= 0, FW_AIRSPD_MIN will be set by default. + type: float + default: -1.0 + unit: m/s + min: -1.0 + decimal: 1 + increment: 0.1 + FW_LAUN_DETCN_ON: + description: + short: Fixed-wing launch detection + long: |- + Enables automatic launch detection based on measured acceleration. Use for hand- or catapult-launched vehicles. + Not compatible with runway takeoff. + type: boolean + default: 0 + FW_LAUN_CS_LK_DY: + description: + short: Control surface launch delay + long: |- + Locks control surfaces during pre-launch (armed) and until this time since launch has passed. + Only affects control surfaces that have corresponding flag set, and not active for runway takeoff. + Set to 0 to disable any surface locking after arming. + type: float + default: 0.0 + unit: s + min: 0.0 + decimal: 1 + increment: 0.1 + FW_FLAPS_TO_SCL: + description: + short: Flaps setting during take-off + long: |- + Sets a fraction of full flaps during take-off. + Also applies to flaperons if enabled in the mixer/allocation. + type: float + default: 0.0 + unit: norm + min: 0.0 + max: 1.0 + decimal: 2 + increment: 0.01 +- group: FW General + definitions: + FW_P_LIM_MIN: + description: + short: Minimum pitch angle setpoint + long: Applies in any altitude controlled flight mode. + type: float + default: -30.0 + unit: deg + min: -60.0 + max: 0.0 + decimal: 1 + increment: 0.5 + FW_P_LIM_MAX: + description: + short: Maximum pitch angle setpoint + long: Applies in any altitude controlled flight mode. + type: float + default: 30.0 + unit: deg + min: 0.0 + max: 80.0 + decimal: 1 + increment: 0.5 + FW_R_LIM: + description: + short: Maximum roll angle setpoint + long: Applies in any altitude controlled flight mode. + type: float + default: 50.0 + unit: deg + min: 35.0 + max: 75.0 + decimal: 1 + increment: 0.5 + FW_THR_MAX: + description: + short: Throttle limit max + long: |- + Applies in any altitude controlled flight mode. + Should be set accordingly to achieve FW_T_CLMB_MAX. + type: float + default: 1.0 + unit: norm + min: 0.0 + max: 1.0 + decimal: 2 + increment: 0.01 + FW_THR_MIN: + description: + short: Throttle limit min + long: |- + Applies in any altitude controlled flight mode. + Usually set to 0 but can be increased to prevent the motor from stopping when + descending, which can increase achievable descent rates. + type: float + default: 0.0 + unit: norm + min: 0.0 + max: 1.0 + decimal: 2 + increment: 0.01 + FW_THR_IDLE: + description: + short: Idle throttle + long: This is the minimum throttle while on the ground ("landed") in auto + modes. + type: float + default: 0.0 + unit: norm + min: 0.0 + max: 1.0 + decimal: 2 + increment: 0.01 + FW_T_SPDWEIGHT: + description: + short: Speed <--> Altitude weight + long: |- + Adjusts the amount of weighting that the pitch control + applies to speed vs height errors. + 0 -> control height only + 2 -> control speed only (gliders) + type: float + default: 1.0 + min: 0.0 + max: 2.0 + decimal: 1 + increment: 1.0 + FW_POS_STK_CONF: + description: + short: Custom stick configuration + long: Applies in manual Position and Altitude flight modes. + type: bitmask + bit: + 0: Alternative stick configuration (height rate on throttle stick, airspeed + on pitch stick) + 1: Enable airspeed setpoint via sticks in altitude and position flight mode + default: 2 + min: 0 + max: 3 + FW_T_CLMB_R_SP: + description: + short: Default target climbrate + long: |- + In auto modes: default climb rate output by controller to achieve altitude setpoints. + In manual modes: maximum climb rate setpoint. + type: float + default: 3.0 + unit: m/s + min: 0.1 + decimal: 2 + increment: 0.01 + FW_T_SINK_R_SP: + description: + short: Default target sinkrate + long: |- + In auto modes: default sink rate output by controller to achieve altitude setpoints. + In manual modes: maximum sink rate setpoint. + type: float + default: 2.0 + unit: m/s + min: 0.1 + decimal: 2 + increment: 0.01 + FW_GPSF_LT: + description: + short: GPS failure loiter time + long: |- + The time the system should do open loop loiter and wait for GPS recovery + before it starts descending. Set to 0 to disable. Roll angle is set to FW_GPSF_R. + Does only apply for fixed-wing vehicles or VTOLs with NAV_FORCE_VT set to 0. + type: int32 + default: 30 + unit: s + min: 0 + FW_GPSF_R: + description: + short: GPS failure fixed roll angle + long: Roll angle in GPS failure loiter mode. + type: float + default: 15.0 + unit: deg + min: 0.0 + max: 60.0 + decimal: 1 + increment: 0.5 + FW_WING_SPAN: + description: + short: The aircraft's wing span (length from tip to tip) + long: This is used for limiting the roll setpoint near the ground. (if multiple + wings, take the longest span) + type: float + default: 3.0 + unit: m + min: 0.1 + decimal: 1 + increment: 0.1 + FW_WING_HEIGHT: + description: + short: Height (AGL) of the wings when the aircraft is on the ground + long: |- + This is used to constrain a minimum altitude below which we keep wings level to avoid wing tip strike. It's safer + to give a slight margin here (> 0m) + type: float + default: 0.5 + unit: m + min: 0.0 + decimal: 1 + increment: 1 +- group: FW NPFG Control + definitions: + NPFG_PERIOD: + description: + short: NPFG period + long: Period of NPFG control law. + type: float + default: 10.0 + unit: s + min: 1.0 + max: 100.0 + decimal: 1 + increment: 0.1 + NPFG_DAMPING: + description: + short: NPFG damping ratio + long: Damping ratio of NPFG control law. + type: float + default: 0.7 + min: 0.1 + max: 1.0 + decimal: 2 + increment: 0.01 + NPFG_LB_PERIOD: + description: + short: Enable automatic lower bound on the NPFG period + long: |- + Avoids limit cycling from a too aggressively tuned period/damping combination. + If false, also disables upper bound NPFG_PERIOD_UB. + type: boolean + default: 1 + NPFG_UB_PERIOD: + description: + short: Enable automatic upper bound on the NPFG period + long: Adapts period to maintain track keeping in variable winds and path curvature. + type: boolean + default: 1 + NPFG_ROLL_TC: + description: + short: Roll time constant + long: |- + Time constant of roll controller command / response, modeled as first order delay. + Used to determine lower period bound. Setting zero disables automatic period bounding. + type: float + default: 0.5 + unit: s + min: 0.0 + max: 2.0 + decimal: 2 + increment: 0.05 + NPFG_SW_DST_MLT: + description: + short: NPFG switch distance multiplier + long: |- + Multiplied by the track error boundary to determine when the aircraft switches + to the next waypoint and/or path segment. Should be less than 1. + type: float + default: 0.32 + min: 0.1 + max: 1.0 + decimal: 2 + increment: 0.01 + NPFG_PERIOD_SF: + description: + short: Period safety factor + long: |- + Multiplied by period for conservative minimum period bounding (when period lower + bounding is enabled). 1.0 bounds at marginal stability. + type: float + default: 1.5 + min: 1.0 + max: 10.0 + decimal: 1 + increment: 0.1 diff --git a/src/modules/fw_mode_manager/launchdetection/launchdetection_params.c b/src/modules/fw_mode_manager/launchdetection/launchdetection_params.c deleted file mode 100644 index eee3d7ccef..0000000000 --- a/src/modules/fw_mode_manager/launchdetection/launchdetection_params.c +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013, 2014 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * @file launchdetection_params.c - * - * Parameters for launchdetection - * - * @author Thomas Gubler - */ - -/** - * Trigger acceleration threshold - * - * Launch is detected when acceleration in body forward direction is above FW_LAUN_AC_THLD for FW_LAUN_AC_T seconds. - * - * @unit m/s^2 - * @min 0 - * @decimal 1 - * @increment 0.5 - * @group FW Auto Takeoff - */ -PARAM_DEFINE_FLOAT(FW_LAUN_AC_THLD, 30.0f); - -/** - * Trigger time - * - * Launch is detected when acceleration in body forward direction is above FW_LAUN_AC_THLD for FW_LAUN_AC_T seconds. - * - * @unit s - * @min 0.0 - * @max 5.0 - * @decimal 2 - * @increment 0.05 - * @group FW Auto Takeoff - */ -PARAM_DEFINE_FLOAT(FW_LAUN_AC_T, 0.05f); - -/** - * Motor delay - * - * Start the motor(s) this amount of seconds after launch is detected. - * - * @unit s - * @min 0.0 - * @max 10.0 - * @decimal 1 - * @increment 0.5 - * @group FW Auto Takeoff - */ -PARAM_DEFINE_FLOAT(FW_LAUN_MOT_DEL, 0.0f); diff --git a/src/modules/fw_mode_manager/runway_takeoff/runway_takeoff_params.c b/src/modules/fw_mode_manager/runway_takeoff/runway_takeoff_params.c deleted file mode 100644 index 68afdeffa1..0000000000 --- a/src/modules/fw_mode_manager/runway_takeoff/runway_takeoff_params.c +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * @file runway_takeoff_params.c - * - * Parameters for runway takeoff - * - * @author Andreas Antener - */ - -/** - * Runway takeoff with landing gear - * - * @boolean - * @group Runway Takeoff - */ -PARAM_DEFINE_INT32(RWTO_TKOFF, 0); - -/** - * Throttle during runway takeoff. - * - * @unit norm - * @min 0.0 - * @max 1.0 - * @decimal 2 - * @increment 0.01 - * @group Runway Takeoff - */ -PARAM_DEFINE_FLOAT(RWTO_MAX_THR, 1.0); - -/** - * Pitch setpoint during taxi / before takeoff rotation airspeed is reached. - * - * A taildragger with steerable wheel might need to pitch up - * a little to keep its wheel on the ground before airspeed - * to takeoff is reached. - * - * @unit deg - * @min -10.0 - * @max 20.0 - * @decimal 1 - * @increment 0.5 - * @group Runway Takeoff - */ -PARAM_DEFINE_FLOAT(RWTO_PSP, 0.0); - -/** - * Throttle ramp up time for runway takeoff - * - * @unit s - * @min 1.0 - * @max 15.0 - * @decimal 2 - * @increment 0.1 - * @group Runway Takeoff - */ -PARAM_DEFINE_FLOAT(RWTO_RAMP_TIME, 2.0f); - -/** - * Enable use of yaw stick for nudging the wheel during runway ground roll - * - * This is useful when map, GNSS, or yaw errors on ground are misaligned with what the operator intends for takeoff course. - * Particularly useful for skinny runways or if the wheel servo is a bit off trim. - * - * @boolean - * @group Runway Takeoff - */ -PARAM_DEFINE_INT32(RWTO_NUDGE, 1); - -/** - * Takeoff rotation airspeed - * - * The calibrated airspeed threshold during the takeoff ground roll when the plane should start rotating (pitching up). - * Must be less than the takeoff airspeed, will otherwise be capped at the takeoff airpeed (see FW_TKO_AIRSPD). - * - * If set <= 0.0, defaults to 0.9 * takeoff airspeed (see FW_TKO_AIRSPD) - * - * @unit m/s - * @min -1.0 - * @decimal 1 - * @increment 0.1 - * @group Runway Takeoff - */ -PARAM_DEFINE_FLOAT(RWTO_ROT_AIRSPD, -1.0f); - -/** - * Takeoff rotation time - * - * This is the time desired to linearly ramp in takeoff pitch constraints during the takeoff rotation - * - * @unit s - * @min 0.1 - * @decimal 1 - * @increment 0.1 - * @group Runway Takeoff - */ -PARAM_DEFINE_FLOAT(RWTO_ROT_TIME, 1.0f);