implemented vtol weathervane yaw control for landing and loiter mission item

This commit is contained in:
Roman
2016-02-15 09:48:37 +01:00
parent be0f680863
commit 80f8fcbdf6
5 changed files with 74 additions and 3 deletions
@@ -192,6 +192,7 @@ private:
param_t hold_max_xy;
param_t hold_max_z;
param_t acc_hor_max;
} _params_handles; /**< handles for interesting parameters */
struct {
@@ -442,7 +443,6 @@ MulticopterPositionControl::MulticopterPositionControl() :
_params_handles.hold_max_z = param_find("MPC_HOLD_MAX_Z");
_params_handles.acc_hor_max = param_find("MPC_ACC_HOR_MAX");
/* fetch initial parameter values */
parameters_update(true);
}
@@ -1263,6 +1263,14 @@ MulticopterPositionControl::task_main()
control_auto(dt);
}
/* weather-vane mode for vtol: disable yaw control */
if(_mode_auto && _pos_sp_triplet.current.disable_mc_yaw_control == true) {
_att_sp.disable_mc_yaw_control = true;
} else {
/* reset in case of setpoint updates */
_att_sp.disable_mc_yaw_control = false;
}
if (!_control_mode.flag_control_manual_enabled && _pos_sp_triplet.current.valid
&& _pos_sp_triplet.current.type == position_setpoint_s::SETPOINT_TYPE_IDLE) {
/* idle state, don't run controller and set zero thrust */