diff --git a/src/modules/attitude_estimator_q/CMakeLists.txt b/src/modules/attitude_estimator_q/CMakeLists.txt index b725408721..305bc31f40 100644 --- a/src/modules/attitude_estimator_q/CMakeLists.txt +++ b/src/modules/attitude_estimator_q/CMakeLists.txt @@ -38,6 +38,8 @@ px4_add_module( STACK_MAX 1600 SRCS attitude_estimator_q_main.cpp + MODULE_CONFIG + attitude_estimator_q_params.yaml DEPENDS world_magnetic_model ) diff --git a/src/modules/attitude_estimator_q/attitude_estimator_q_params.c b/src/modules/attitude_estimator_q/attitude_estimator_q_params.c deleted file mode 100644 index b9a3dc752d..0000000000 --- a/src/modules/attitude_estimator_q/attitude_estimator_q_params.c +++ /dev/null @@ -1,146 +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 attitude_estimator_q_params.c - * - * Parameters for attitude estimator (quaternion based) - * - * @author Anton Babushkin - */ - -/** - * standalone attitude estimator enable (unsupported) - * - * Enable standalone quaternion based attitude estimator. - * - * @group Attitude Q estimator - * @boolean - */ -PARAM_DEFINE_INT32(ATT_EN, 0); - -/** - * Complimentary filter accelerometer weight - * - * @group Attitude Q estimator - * @min 0 - * @max 1 - * @decimal 2 - */ -PARAM_DEFINE_FLOAT(ATT_W_ACC, 0.2f); - -/** - * Complimentary filter magnetometer weight - * - * Set to 0 to avoid using the magnetometer. - * - * @group Attitude Q estimator - * @min 0 - * @max 1 - * @decimal 2 - */ -PARAM_DEFINE_FLOAT(ATT_W_MAG, 0.1f); - -/** - * Complimentary filter external heading weight - * - * @group Attitude Q estimator - * @min 0 - * @max 1 - */ -PARAM_DEFINE_FLOAT(ATT_W_EXT_HDG, 0.1f); - -/** - * Complimentary filter gyroscope bias weight - * - * @group Attitude Q estimator - * @min 0 - * @max 1 - * @decimal 2 - */ -PARAM_DEFINE_FLOAT(ATT_W_GYRO_BIAS, 0.1f); - -/** - * Magnetic declination, in degrees - * - * This parameter is not used in normal operation, - * as the declination is looked up based on the - * GPS coordinates of the vehicle. - * - * @group Attitude Q estimator - * @unit deg - * @decimal 2 - */ -PARAM_DEFINE_FLOAT(ATT_MAG_DECL, 0.0f); - -/** - * Automatic GPS based declination compensation - * - * @group Attitude Q estimator - * @boolean - */ -PARAM_DEFINE_INT32(ATT_MAG_DECL_A, 1); - -/** - * External heading usage mode (from Motion capture/Vision) - * - * Set to 1 to use heading estimate from vision. - * Set to 2 to use heading from motion capture. - * - * @group Attitude Q estimator - * @value 0 None - * @value 1 Vision - * @value 2 Motion Capture - * @min 0 - * @max 2 - */ -PARAM_DEFINE_INT32(ATT_EXT_HDG_M, 0); - -/** - * Acceleration compensation based on GPS velocity. - * - * @group Attitude Q estimator - * @boolean - */ -PARAM_DEFINE_INT32(ATT_ACC_COMP, 0); - -/** - * Gyro bias limit - * - * @group Attitude Q estimator - * @unit rad/s - * @min 0 - * @max 2 - * @decimal 3 - */ -PARAM_DEFINE_FLOAT(ATT_BIAS_MAX, 0.05f); diff --git a/src/modules/attitude_estimator_q/attitude_estimator_q_params.yaml b/src/modules/attitude_estimator_q/attitude_estimator_q_params.yaml new file mode 100644 index 0000000000..271a3f6a36 --- /dev/null +++ b/src/modules/attitude_estimator_q/attitude_estimator_q_params.yaml @@ -0,0 +1,86 @@ +module_name: attitude_estimator_q +parameters: +- group: Attitude Q estimator + definitions: + ATT_EN: + description: + short: standalone attitude estimator enable (unsupported) + long: Enable standalone quaternion based attitude estimator. + type: boolean + default: 0 + ATT_W_ACC: + description: + short: Complimentary filter accelerometer weight + type: float + default: 0.2 + min: 0 + max: 1 + decimal: 2 + ATT_W_MAG: + description: + short: Complimentary filter magnetometer weight + long: Set to 0 to avoid using the magnetometer. + type: float + default: 0.1 + min: 0 + max: 1 + decimal: 2 + ATT_W_EXT_HDG: + description: + short: Complimentary filter external heading weight + type: float + default: 0.1 + min: 0 + max: 1 + ATT_W_GYRO_BIAS: + description: + short: Complimentary filter gyroscope bias weight + type: float + default: 0.1 + min: 0 + max: 1 + decimal: 2 + ATT_MAG_DECL: + description: + short: Magnetic declination, in degrees + long: |- + This parameter is not used in normal operation, + as the declination is looked up based on the + GPS coordinates of the vehicle. + type: float + default: 0.0 + unit: deg + decimal: 2 + ATT_MAG_DECL_A: + description: + short: Automatic GPS based declination compensation + type: boolean + default: 1 + ATT_EXT_HDG_M: + description: + short: External heading usage mode (from Motion capture/Vision) + long: |- + Set to 1 to use heading estimate from vision. + Set to 2 to use heading from motion capture. + type: enum + values: + 0: None + 1: Vision + 2: Motion Capture + default: 0 + min: 0 + max: 2 + ATT_ACC_COMP: + description: + short: Acceleration compensation based on GPS velocity + type: boolean + default: 0 + ATT_BIAS_MAX: + description: + short: Gyro bias limit + type: float + default: 0.05 + unit: rad/s + min: 0 + max: 2 + decimal: 3