mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 18:43:35 +08:00
Airspeed Selector: enable airspeed_validated in control modules (#12887)
* FW attitude controller, FW position controller and VTOL attitude controller subscribe to airspeed_validated topic * add possibility to switch off the airspeed valid checks * remove airspeed valid checks from commander * clean up of VTOL transition logic * Airspeed Selector: remove dynamic allocation of airspeed validators (depending on number of connected sensors) but do it statically for the maximum number allowed. Check for number of connected sensors not only during start up, but always when vehicle is disarmed. * Airspeed Selector: change work queue from lp to att_pos_ctrl as this module is safety-critical * add airspeed selector to px4_fmu-v2 defaults
This commit is contained in:
committed by
Daniel Agar
parent
a46581987c
commit
ebdc29bc5f
@@ -130,11 +130,24 @@ void Tailsitter::update_vtol_state()
|
||||
|
||||
case vtol_mode::TRANSITION_FRONT_P1: {
|
||||
|
||||
bool airspeed_condition_satisfied = _airspeed->indicated_airspeed_m_s >= _params->transition_airspeed;
|
||||
airspeed_condition_satisfied |= _params->airspeed_disabled;
|
||||
|
||||
// check if we have reached airspeed and pitch angle to switch to TRANSITION P2 mode
|
||||
if ((airspeed_condition_satisfied && pitch <= PITCH_TRANSITION_FRONT_P1) || can_transition_on_ground()) {
|
||||
const bool airspeed_triggers_transition = PX4_ISFINITE(_airspeed_validated->equivalent_airspeed_m_s)
|
||||
&& !_params->airspeed_disabled;
|
||||
|
||||
bool transition_to_fw = false;
|
||||
|
||||
if (pitch <= PITCH_TRANSITION_FRONT_P1) {
|
||||
if (airspeed_triggers_transition) {
|
||||
transition_to_fw = _airspeed_validated->equivalent_airspeed_m_s >= _params->transition_airspeed;
|
||||
|
||||
} else {
|
||||
transition_to_fw = true;
|
||||
}
|
||||
}
|
||||
|
||||
transition_to_fw |= can_transition_on_ground();
|
||||
|
||||
if (transition_to_fw) {
|
||||
_vtol_schedule.flight_mode = vtol_mode::FW_MODE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user