From cee63336392e663264a6da3e7c0e2f6f8d0d0795 Mon Sep 17 00:00:00 2001 From: JaeyoungLim Date: Mon, 24 Nov 2025 15:41:06 -0800 Subject: [PATCH] Use new param yaml format --- src/modules/fw_wind_estimator/CMakeLists.txt | 4 +- .../fw_wind_estimator_params.c | 100 ------------------ src/modules/fw_wind_estimator/module.yaml | 54 ++++++++++ 3 files changed, 56 insertions(+), 102 deletions(-) delete mode 100644 src/modules/fw_wind_estimator/fw_wind_estimator_params.c create mode 100644 src/modules/fw_wind_estimator/module.yaml diff --git a/src/modules/fw_wind_estimator/CMakeLists.txt b/src/modules/fw_wind_estimator/CMakeLists.txt index b39b144cd1..ed11db51e6 100644 --- a/src/modules/fw_wind_estimator/CMakeLists.txt +++ b/src/modules/fw_wind_estimator/CMakeLists.txt @@ -39,6 +39,6 @@ px4_add_module( FixedwingWindEstimator.hpp DEPENDS px4_work_queue - RateControl - SlewRate + MODULE_CONFIG + module.yaml ) diff --git a/src/modules/fw_wind_estimator/fw_wind_estimator_params.c b/src/modules/fw_wind_estimator/fw_wind_estimator_params.c deleted file mode 100644 index 5c7ce6955f..0000000000 --- a/src/modules/fw_wind_estimator/fw_wind_estimator_params.c +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 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. - * - ****************************************************************************/ - -/** - * @file fw_wind_estimator_params.c - * - * Parameters defined by the fixed-wing wind estimator - * - * @author Jaeyoung Lim - */ - -/** - * Vehicle Mass - * - * @unit %/rad/s - * @min 0.0 - * @max 25 - * @decimal 3 - * @increment 0.01 - * @group FW Wind Estimator - */ -PARAM_DEFINE_FLOAT(FW_W_MASS, 1.00f); - -/** -* Vehicle Mass -* -* @unit %/rad/s -* @min 0.0 -* @max 25 -* @decimal 3 -* @increment 0.01 -* @group FW Wind Estimator -*/ -PARAM_DEFINE_FLOAT(FW_W_AREA, 0.34f); - -/** -* Vehicle Aerodynamic coefficient -* -* @unit %/rad/s -* @min 0.0 -* @max 4 -* @decimal 3 -* @increment 0.01 -* @group FW Wind Estimator -*/ -PARAM_DEFINE_FLOAT(FW_W_C_B1, 1.0f); - -/** -* Vehicle Aerodynamic coefficient -* -* @unit %/rad/s -* @min 0.0 -* @max 4 -* @decimal 3 -* @increment 0.01 -* @group FW Wind Estimator -*/ -PARAM_DEFINE_FLOAT(FW_W_C_A0, 0.15188f); - -/** -* Vehicle Aerodynamic coefficient -* -* @unit %/rad/s -* @min 0.0 -* @max 10 -* @decimal 3 -* @increment 0.01 -* @group FW Wind Estimator -*/ -PARAM_DEFINE_FLOAT(FW_W_C_A1, 5.015f); diff --git a/src/modules/fw_wind_estimator/module.yaml b/src/modules/fw_wind_estimator/module.yaml new file mode 100644 index 0000000000..836f4c7e92 --- /dev/null +++ b/src/modules/fw_wind_estimator/module.yaml @@ -0,0 +1,54 @@ +module_name: fw_wind_estimator +parameters: +- group: FW Wind Estimator + definitions: + FW_W_MASS: + description: + short: Vehicle Mass + type: float + default: 1.0 + unit: '%/rad/s' + min: 0.0 + max: 25 + decimal: 3 + increment: 0.01 + FW_W_AREA: + description: + short: Vehicle Mass + type: float + default: 0.34 + unit: '%/rad/s' + min: 0.0 + max: 25 + decimal: 3 + increment: 0.01 + FW_W_C_B1: + description: + short: Vehicle Aerodynamic coefficient + type: float + default: 1.0 + unit: '%/rad/s' + min: 0.0 + max: 4 + decimal: 3 + increment: 0.01 + FW_W_C_A0: + description: + short: Vehicle Aerodynamic coefficient + type: float + default: 0.15188 + unit: '%/rad/s' + min: 0.0 + max: 4 + decimal: 3 + increment: 0.01 + FW_W_C_A1: + description: + short: Vehicle Aerodynamic coefficient + type: float + default: 5.015 + unit: '%/rad/s' + min: 0.0 + max: 10 + decimal: 3 + increment: 0.01