MC Att C: add param to use VTOL way for att generation or not

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2022-07-27 09:03:47 +02:00
parent 7bcd33b177
commit 36af12a1d4
3 changed files with 11 additions and 2 deletions

View File

@ -153,7 +153,8 @@ private:
(ParamFloat<px4::params::MPC_MANTHR_MIN>) _param_mpc_manthr_min, /**< minimum throttle for stabilized */
(ParamFloat<px4::params::MPC_THR_MAX>) _param_mpc_thr_max, /**< maximum throttle for stabilized */
(ParamFloat<px4::params::MPC_THR_HOVER>) _param_mpc_thr_hover, /**< throttle at stationary hover */
(ParamInt<px4::params::MPC_THR_CURVE>) _param_mpc_thr_curve /**< throttle curve behavior */
(ParamInt<px4::params::MPC_THR_CURVE>) _param_mpc_thr_curve, /**< throttle curve behavior */
(ParamInt<px4::params::MC_ATT_VTOL_WAY>) _param_mc_att_vtol_way
)
};

View File

@ -164,7 +164,7 @@ MulticopterAttitudeControl::generate_attitude_setpoint(const Quatf &q, float dt,
attitude_setpoint.yaw_body = _man_yaw_sp + euler_sp(2);
/* modify roll/pitch only if we're a VTOL */
if (_vtol) {
if (_vtol && _param_mc_att_vtol_way.get()) {
// Construct attitude setpoint rotation matrix. Modify the setpoints for roll
// and pitch such that they reflect the user's intention even if a large yaw error
// (yaw_sp - yaw) is present. In the presence of a yaw error constructing a rotation matrix

View File

@ -158,3 +158,11 @@ PARAM_DEFINE_FLOAT(MC_YAWRATE_MAX, 200.0f);
* @group Multicopter Position Control
*/
PARAM_DEFINE_FLOAT(MC_MAN_TILT_TAU, 0.0f);
/**
* Generate manual attitude sp VTOL way
*
* @boolean
* @group Multicopter Attitude Control
*/
PARAM_DEFINE_INT32(MC_ATT_VTOL_WAY, 1);