mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 06:51:35 +08:00
vtol_att_control: use airspeed_disabled flag instead of airspeed mode
Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -190,7 +190,7 @@ void Standard::update_vtol_state()
|
|||||||
|
|
||||||
} else if (_vtol_schedule.flight_mode == TRANSITION_TO_FW) {
|
} else if (_vtol_schedule.flight_mode == TRANSITION_TO_FW) {
|
||||||
// continue the transition to fw mode while monitoring airspeed for a final switch to fw mode
|
// continue the transition to fw mode while monitoring airspeed for a final switch to fw mode
|
||||||
if (((_params->airspeed_mode == 1 ||
|
if (((_params->airspeed_disabled ||
|
||||||
_airspeed->indicated_airspeed_m_s >= _params->transition_airspeed) &&
|
_airspeed->indicated_airspeed_m_s >= _params->transition_airspeed) &&
|
||||||
time_since_trans_start > _params->front_trans_time_min * 1e6f) ||
|
time_since_trans_start > _params->front_trans_time_min * 1e6f) ||
|
||||||
can_transition_on_ground()) {
|
can_transition_on_ground()) {
|
||||||
@@ -260,7 +260,7 @@ void Standard::update_transition_state()
|
|||||||
_airspeed_trans_blend_margin;
|
_airspeed_trans_blend_margin;
|
||||||
// time based blending when no airspeed sensor is set
|
// time based blending when no airspeed sensor is set
|
||||||
|
|
||||||
} else if (_params->airspeed_mode == 1 &&
|
} else if (_params->airspeed_disabled &&
|
||||||
time_since_trans_start < _params->front_trans_time_min * 1e6f &&
|
time_since_trans_start < _params->front_trans_time_min * 1e6f &&
|
||||||
time_since_trans_start > _params->front_trans_time_min * 1e6f / 2.0f) {
|
time_since_trans_start > _params->front_trans_time_min * 1e6f / 2.0f) {
|
||||||
mc_weight = 1.0f - ((time_since_trans_start - _params->front_trans_time_min * 1e6f / 2.0f) /
|
mc_weight = 1.0f - ((time_since_trans_start - _params->front_trans_time_min * 1e6f / 2.0f) /
|
||||||
|
|||||||
@@ -505,7 +505,8 @@ VtolAttitudeControl::parameters_update()
|
|||||||
param_get(_params_handles.front_trans_throttle, &_params.front_trans_throttle);
|
param_get(_params_handles.front_trans_throttle, &_params.front_trans_throttle);
|
||||||
param_get(_params_handles.back_trans_throttle, &_params.back_trans_throttle);
|
param_get(_params_handles.back_trans_throttle, &_params.back_trans_throttle);
|
||||||
param_get(_params_handles.airspeed_blend, &_params.airspeed_blend);
|
param_get(_params_handles.airspeed_blend, &_params.airspeed_blend);
|
||||||
param_get(_params_handles.airspeed_mode, &_params.airspeed_mode);
|
param_get(_params_handles.airspeed_mode, &l);
|
||||||
|
_params.airspeed_disabled = l != 0;
|
||||||
param_get(_params_handles.front_trans_timeout, &_params.front_trans_timeout);
|
param_get(_params_handles.front_trans_timeout, &_params.front_trans_timeout);
|
||||||
param_get(_params_handles.mpc_xy_cruise, &_params.mpc_xy_cruise);
|
param_get(_params_handles.mpc_xy_cruise, &_params.mpc_xy_cruise);
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ struct Params {
|
|||||||
float front_trans_throttle;
|
float front_trans_throttle;
|
||||||
float back_trans_throttle;
|
float back_trans_throttle;
|
||||||
float airspeed_blend;
|
float airspeed_blend;
|
||||||
int32_t airspeed_mode;
|
bool airspeed_disabled;
|
||||||
float front_trans_timeout;
|
float front_trans_timeout;
|
||||||
float mpc_xy_cruise;
|
float mpc_xy_cruise;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user