mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 04:23:35 +08:00
implemented vtol weathervane yaw control for landing and loiter mission item
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user