From 45af173da1adddc01b327e4646f446e2d681f9e9 Mon Sep 17 00:00:00 2001 From: Azarakhsh Keipour Date: Sun, 26 Jul 2020 01:46:20 -0400 Subject: [PATCH] Omni Params: Attitude setpoint params moved from attitude controller to position controller --- .../mc_att_control/mc_att_control_params.c | 111 ------------------ .../mc_pos_control/mc_pos_control_params.c | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 111 deletions(-) diff --git a/src/modules/mc_att_control/mc_att_control_params.c b/src/modules/mc_att_control/mc_att_control_params.c index 4f5faf3cea..ce18646183 100644 --- a/src/modules/mc_att_control/mc_att_control_params.c +++ b/src/modules/mc_att_control/mc_att_control_params.c @@ -144,114 +144,3 @@ PARAM_DEFINE_FLOAT(MC_YAWRATE_MAX, 200.0f); * @group Multicopter Attitude Control */ PARAM_DEFINE_FLOAT(MC_RATT_TH, 0.8f); - -/** - * Maximum direct-force (horizontal) scaled thrust for omnidirectional vehicles - * - * Specifies the maximum horizontal thrust compared to the maximum possible - * thrust generated by the vehicle for an omnidirectional multirotor. The - * value of this parameter does not affect the behavior if the attitude mode - * is not set to one of omni-directional modes (if OMNI_ATT_MODE is 0). - * - * @min 0 - * @max 1 - * @decimal 2 - * @group Multicopter Attitude Control - */ -PARAM_DEFINE_FLOAT(OMNI_DFC_MAX_THR, 0.15f); - -/** - * Omni-directional attitude setpoint mode - * - * Specifies the type of attitude setpoint sent to the attitude controller. - * The parameter can be set to a normal attitude setpoint, where the tilt - * of the vehicle (roll and pitch) are calculated from the desired thrust - * vector. This should be the behavior for the non-omnidirectional vehicles, - * such as quadrotors and other multirotors with coplanar rotors. - * The "constant zero tilt" mode enforces zero roll and pitch and can only be - * used for omnidirectional vehicles. The min-tilt mode enforces zero tilt - * up to a maximum set acceleration (thrust) and tilts the vehicle as small - * as possible if the thrust vector is larger than the maximum. The "constant - * tilt" and "constant roll/pitch" modes enforce a given tilt or roll/pitch - * for the vehicle. The estimation modes estimate the optimal tilt or roll/pitch - * to counteract with the external force (e.g., wind). - * - * @min 0 - * @max 6 - * @value 0 tilted attitude - * @value 1 min-tilt attitude - * @value 2 constant zero tilt - * @value 3 constant tilt - * @value 4 constant roll/pitch - * @value 5 estimate tilt - * @value 6 estimate roll/pitch - * @group Multicopter Attitude Control - */ -PARAM_DEFINE_INT32(OMNI_ATT_MODE, 0); - -/** - * Omni-directional attitude setpoint tilt angle - * - * Specifies the tilt angle in degrees for the constant-tilt attitude - * setpoint generation mode (OMNI_ATT_MODE=3). - * - * @min 0 - * @max 90 - * @decimal 2 - * @group Multicopter Attitude Control - */ -PARAM_DEFINE_FLOAT(OMNI_ATT_TLT_ANG, 0.0f); - -/** - * Omni-directional attitude setpoint tilt direction angle - * - * Specifies the direction of the tilt in degrees for the constant-tilt - * attitude setpoint generation mode (OMNI_ATT_MODE=3). The direction is - * measured from North. - * - * @min -360 - * @max 360 - * @decimal 2 - * @group Multicopter Attitude Control - */ -PARAM_DEFINE_FLOAT(OMNI_ATT_TLT_DIR, 0.0f); - -/** - * Omni-directional attitude setpoint roll angle - * - * Specifies the roll angle in degrees for the constant-roll/pitch attitude - * setpoint generation mode (OMNI_ATT_MODE=4). - * - * @min -90 - * @max 90 - * @decimal 2 - * @group Multicopter Attitude Control - */ -PARAM_DEFINE_FLOAT(OMNI_ATT_ROLL, 0.0f); - -/** - * Omni-directional attitude setpoint pitch angle - * - * Specifies the pitch angle in degrees for the constant-roll/pitch attitude - * setpoint generation mode (OMNI_ATT_MODE=4). - * - * @min -90 - * @max 90 - * @decimal 2 - * @group Multicopter Attitude Control - */ -PARAM_DEFINE_FLOAT(OMNI_ATT_PITCH, 0.0f); - -/** - * Axes for thrust projection in omni-directional attitude modes - * - * Specifies the axis used for projecting inertial thrust setpoint - * to the body-fixed frame in omni-directional modes (OMNI_ATT_MODE > 0). - * - * @min 0 - * @max 1 - * @value 0 commanded attitude - * @value 1 current attitude - * @group Multicopter Attitude Control - */ -PARAM_DEFINE_INT32(OMNI_PROJ_AXES, 1); diff --git a/src/modules/mc_pos_control/mc_pos_control_params.c b/src/modules/mc_pos_control/mc_pos_control_params.c index 4f9e153d45..61aa15fb06 100644 --- a/src/modules/mc_pos_control/mc_pos_control_params.c +++ b/src/modules/mc_pos_control/mc_pos_control_params.c @@ -745,3 +745,114 @@ PARAM_DEFINE_FLOAT(MPC_SPOOLUP_TIME, 1.0f); * @group Mission */ PARAM_DEFINE_INT32(MPC_YAW_MODE, 0); + +/** + * Maximum direct-force (horizontal) scaled thrust for omnidirectional vehicles + * + * Specifies the maximum horizontal thrust compared to the maximum possible + * thrust generated by the vehicle for an omnidirectional multirotor. The + * value of this parameter does not affect the behavior if the attitude mode + * is not set to one of omni-directional modes (if OMNI_ATT_MODE is 0). + * + * @min 0 + * @max 1 + * @decimal 2 + * @group Multicopter Attitude Control + */ +PARAM_DEFINE_FLOAT(OMNI_DFC_MAX_THR, 0.15f); + +/** + * Omni-directional attitude setpoint mode + * + * Specifies the type of attitude setpoint sent to the attitude controller. + * The parameter can be set to a normal attitude setpoint, where the tilt + * of the vehicle (roll and pitch) are calculated from the desired thrust + * vector. This should be the behavior for the non-omnidirectional vehicles, + * such as quadrotors and other multirotors with coplanar rotors. + * The "constant zero tilt" mode enforces zero roll and pitch and can only be + * used for omnidirectional vehicles. The min-tilt mode enforces zero tilt + * up to a maximum set acceleration (thrust) and tilts the vehicle as small + * as possible if the thrust vector is larger than the maximum. The "constant + * tilt" and "constant roll/pitch" modes enforce a given tilt or roll/pitch + * for the vehicle. The estimation modes estimate the optimal tilt or roll/pitch + * to counteract with the external force (e.g., wind). + * + * @min 0 + * @max 6 + * @value 0 tilted attitude + * @value 1 min-tilt attitude + * @value 2 constant zero tilt + * @value 3 constant tilt + * @value 4 constant roll/pitch + * @value 5 estimate tilt/roll/pitch + * @value 6 slow attitude change + * @group Multicopter Attitude Control + */ +PARAM_DEFINE_INT32(OMNI_ATT_MODE, 0); + +/** + * Omni-directional attitude setpoint tilt angle + * + * Specifies the tilt angle in degrees for the constant-tilt attitude + * setpoint generation mode (OMNI_ATT_MODE=3). + * + * @min 0 + * @max 90 + * @decimal 2 + * @group Multicopter Attitude Control + */ +PARAM_DEFINE_FLOAT(OMNI_ATT_TLT_ANG, 0.0f); + +/** + * Omni-directional attitude setpoint tilt direction angle + * + * Specifies the direction of the tilt in degrees for the constant-tilt + * attitude setpoint generation mode (OMNI_ATT_MODE=3). The direction is + * measured from North. + * + * @min -360 + * @max 360 + * @decimal 2 + * @group Multicopter Attitude Control + */ +PARAM_DEFINE_FLOAT(OMNI_ATT_TLT_DIR, 0.0f); + +/** + * Omni-directional attitude setpoint roll angle + * + * Specifies the roll angle in degrees for the constant-roll/pitch attitude + * setpoint generation mode (OMNI_ATT_MODE=4). + * + * @min -90 + * @max 90 + * @decimal 2 + * @group Multicopter Attitude Control + */ +PARAM_DEFINE_FLOAT(OMNI_ATT_ROLL, 0.0f); + +/** + * Omni-directional attitude setpoint pitch angle + * + * Specifies the pitch angle in degrees for the constant-roll/pitch attitude + * setpoint generation mode (OMNI_ATT_MODE=4). + * + * @min -90 + * @max 90 + * @decimal 2 + * @group Multicopter Attitude Control + */ +PARAM_DEFINE_FLOAT(OMNI_ATT_PITCH, 0.0f); + +/** + * Axes for thrust projection in omni-directional attitude modes + * + * Specifies the axis used for projecting inertial thrust setpoint + * to the body-fixed frame in omni-directional modes (OMNI_ATT_MODE > 0). + * + * @min 0 + * @max 1 + * @value 0 commanded attitude + * @value 1 current attitude + * @group Multicopter Attitude Control + */ +PARAM_DEFINE_INT32(OMNI_PROJ_AXES, 1);