diff --git a/src/modules/landing_target_estimator/CMakeLists.txt b/src/modules/landing_target_estimator/CMakeLists.txt index 32308d3c93..adb8214338 100644 --- a/src/modules/landing_target_estimator/CMakeLists.txt +++ b/src/modules/landing_target_estimator/CMakeLists.txt @@ -39,5 +39,7 @@ px4_add_module( landing_target_estimator_main.cpp LandingTargetEstimator.cpp KalmanFilter.cpp + MODULE_CONFIG + landing_target_estimator_params.yaml DEPENDS ) diff --git a/src/modules/landing_target_estimator/landing_target_estimator_params.c b/src/modules/landing_target_estimator/landing_target_estimator_params.c deleted file mode 100644 index 92048efc31..0000000000 --- a/src/modules/landing_target_estimator/landing_target_estimator_params.c +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2014-2018 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 landing_target_estimator_params.c - * Landing target estimator algorithm parameters. - * - * @author Nicolas de Palezieux (Sunflower Labs) - * @author Mohammed Kabir - * - */ - -/** - * Landing target mode - * - * Configure the mode of the landing target. Depending on the mode, the landing target observations are used differently to aid position estimation. - * - * Mode Moving: The landing target may be moving around while in the field of view of the vehicle. Landing target measurements are not used to aid positioning. - * Mode Stationary: The landing target is stationary. Measured velocity w.r.t. the landing target is used to aid velocity estimation. - * - * @min 0 - * @max 1 - * @group Landing Target Estimator - * @value 0 Moving - * @value 1 Stationary - */ -PARAM_DEFINE_INT32(LTEST_MODE, 0); - -/** - * Acceleration uncertainty - * - * Variance of acceleration measurement used for landing target position prediction. - * Higher values results in tighter following of the measurements and more lenient outlier rejection - * - * @unit (m/s^2)^2 - * @min 0.01 - * @decimal 2 - * - * @group Landing Target Estimator - */ -PARAM_DEFINE_FLOAT(LTEST_ACC_UNC, 10.0f); - -/** - * Landing target measurement uncertainty - * - * Variance of the landing target measurement from the driver. - * Higher values result in less aggressive following of the measurement and a smoother output as well as fewer rejected measurements. - * - * @unit tan(rad)^2 - * @decimal 4 - * - * @group Landing Target Estimator - */ -PARAM_DEFINE_FLOAT(LTEST_MEAS_UNC, 0.005f); - -/** - * Initial landing target position uncertainty - * - * Initial variance of the relative landing target position in x and y direction - * - * @unit m^2 - * @min 0.001 - * @decimal 3 - * - * @group Landing Target Estimator - */ -PARAM_DEFINE_FLOAT(LTEST_POS_UNC_IN, 0.1f); - -/** - * Initial landing target velocity uncertainty - * - * Initial variance of the relative landing target velocity in x and y directions - * - * @unit (m/s)^2 - * @min 0.001 - * @decimal 3 - * - * @group Landing Target Estimator - */ -PARAM_DEFINE_FLOAT(LTEST_VEL_UNC_IN, 0.1f); - -/** - * Scale factor for sensor measurements in sensor x axis - * - * Landing target x measurements are scaled by this factor before being used - * - * @min 0.01 - * @decimal 3 - * - * @group Landing Target Estimator - */ -PARAM_DEFINE_FLOAT(LTEST_SCALE_X, 1.0f); - -/** - * Scale factor for sensor measurements in sensor y axis - * - * Landing target y measurements are scaled by this factor before being used - * - * @min 0.01 - * @decimal 3 - * - * @group Landing Target Estimator - */ -PARAM_DEFINE_FLOAT(LTEST_SCALE_Y, 1.0f); - - -/** - * Rotation of IRLOCK sensor relative to airframe - * - * Default orientation of Yaw 90° - * - * @value 0 No rotation - * @value 1 Yaw 45° - * @value 2 Yaw 90° - * @value 3 Yaw 135° - * @value 4 Yaw 180° - * @value 5 Yaw 225° - * @value 6 Yaw 270° - * @value 7 Yaw 315° - * - * @min -1 - * @max 40 - * @reboot_required true - * @group Landing Target Estimator - */ -PARAM_DEFINE_INT32(LTEST_SENS_ROT, 2); - -/** - * X Position of IRLOCK in body frame (forward) - * - * @reboot_required true - * @unit m - * @decimal 3 - * @group Landing Target Estimator - * - */ -PARAM_DEFINE_FLOAT(LTEST_SENS_POS_X, 0.0f); - -/** - * Y Position of IRLOCK in body frame (right) - * - * @reboot_required true - * @unit m - * @decimal 3 - * @group Landing Target Estimator - * - */ -PARAM_DEFINE_FLOAT(LTEST_SENS_POS_Y, 0.0f); - -/** - * Z Position of IRLOCK in body frame (downward) - * - * @reboot_required true - * @unit m - * @decimal 3 - * @group Landing Target Estimator - * - */ -PARAM_DEFINE_FLOAT(LTEST_SENS_POS_Z, 0.0f); diff --git a/src/modules/landing_target_estimator/landing_target_estimator_params.yaml b/src/modules/landing_target_estimator/landing_target_estimator_params.yaml new file mode 100644 index 0000000000..8d20df6d99 --- /dev/null +++ b/src/modules/landing_target_estimator/landing_target_estimator_params.yaml @@ -0,0 +1,120 @@ +module_name: landing_target_estimator +parameters: +- group: Landing Target Estimator + definitions: + LTEST_MODE: + description: + short: Landing target mode + long: |- + Configure the mode of the landing target. Depending on the mode, the landing target observations are used differently to aid position estimation. + + Mode Moving: The landing target may be moving around while in the field of view of the vehicle. Landing target measurements are not used to aid positioning. + Mode Stationary: The landing target is stationary. Measured velocity w.r.t. the landing target is used to aid velocity estimation. + type: enum + values: + 0: Moving + 1: Stationary + default: 0 + min: 0 + max: 1 + LTEST_ACC_UNC: + description: + short: Acceleration uncertainty + long: |- + Variance of acceleration measurement used for landing target position prediction. + Higher values results in tighter following of the measurements and more lenient outlier rejection + type: float + default: 10.0 + unit: (m/s^2)^2 + min: 0.01 + decimal: 2 + LTEST_MEAS_UNC: + description: + short: Landing target measurement uncertainty + long: |- + Variance of the landing target measurement from the driver. + Higher values result in less aggressive following of the measurement and a smoother output as well as fewer rejected measurements. + type: float + default: 0.005 + unit: tan(rad)^2 + decimal: 4 + LTEST_POS_UNC_IN: + description: + short: Initial landing target position uncertainty + long: Initial variance of the relative landing target position in x and y + direction + type: float + default: 0.1 + unit: m^2 + min: 0.001 + decimal: 3 + LTEST_VEL_UNC_IN: + description: + short: Initial landing target velocity uncertainty + long: Initial variance of the relative landing target velocity in x and y + directions + type: float + default: 0.1 + unit: (m/s)^2 + min: 0.001 + decimal: 3 + LTEST_SCALE_X: + description: + short: Scale factor for sensor measurements in sensor x axis + long: Landing target x measurements are scaled by this factor before being + used + type: float + default: 1.0 + min: 0.01 + decimal: 3 + LTEST_SCALE_Y: + description: + short: Scale factor for sensor measurements in sensor y axis + long: Landing target y measurements are scaled by this factor before being + used + type: float + default: 1.0 + min: 0.01 + decimal: 3 + LTEST_SENS_ROT: + description: + short: Rotation of IRLOCK sensor relative to airframe + long: "Default orientation of Yaw 90\xB0" + type: enum + values: + 0: No rotation + 1: "Yaw 45\xB0" + 2: "Yaw 90\xB0" + 3: "Yaw 135\xB0" + 4: "Yaw 180\xB0" + 5: "Yaw 225\xB0" + 6: "Yaw 270\xB0" + 7: "Yaw 315\xB0" + default: 2 + min: -1 + max: 40 + reboot_required: true + LTEST_SENS_POS_X: + description: + short: X Position of IRLOCK in body frame (forward) + type: float + default: 0.0 + reboot_required: true + unit: m + decimal: 3 + LTEST_SENS_POS_Y: + description: + short: Y Position of IRLOCK in body frame (right) + type: float + default: 0.0 + reboot_required: true + unit: m + decimal: 3 + LTEST_SENS_POS_Z: + description: + short: Z Position of IRLOCK in body frame (downward) + type: float + default: 0.0 + reboot_required: true + unit: m + decimal: 3