mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-16 02:40:35 +08:00
VTOL: abort front transition early if airspeed doesn't go above blending speed (#24521)
vtol_type: timeout transition earlier if we use airspeed and airspeed has not increased above blend airspeed after openloop front transition time. Signed-off-by: RomanBapst <bapstroman@gmail.com> --------- Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -147,7 +147,7 @@ PARAM_DEFINE_FLOAT(VT_ARSP_TRANS, 10.0f);
|
||||
/**
|
||||
* Front transition timeout
|
||||
*
|
||||
* Time in seconds after which transition will be cancelled. Disabled if set to 0.
|
||||
* Time in seconds after which transition will be cancelled.
|
||||
*
|
||||
* @unit s
|
||||
* @min 0.1
|
||||
@@ -273,6 +273,8 @@ PARAM_DEFINE_INT32(VT_FW_QC_HMAX, 0);
|
||||
* Airspeed-less front transition time (open loop)
|
||||
*
|
||||
* The duration of the front transition when there is no airspeed feedback available.
|
||||
* When airspeed is used, transition timeout is declared if airspeed does not
|
||||
* reach VT_ARSP_BLEND after this time.
|
||||
*
|
||||
* @unit s
|
||||
* @min 1.0
|
||||
|
||||
@@ -329,10 +329,13 @@ bool VtolType::isRollExceeded()
|
||||
bool VtolType::isFrontTransitionTimeout()
|
||||
{
|
||||
// check front transition timeout
|
||||
if (getFrontTransitionTimeout() > FLT_EPSILON && _common_vtol_mode == mode::TRANSITION_TO_FW) {
|
||||
if (_common_vtol_mode == mode::TRANSITION_TO_FW) {
|
||||
// when we use airspeed, we can timeout earlier if airspeed is not increasing fast enough
|
||||
if (_param_fw_use_airspd.get() && _time_since_trans_start > getOpenLoopFrontTransitionTime()
|
||||
&& _airspeed_validated->calibrated_airspeed_m_s < getBlendAirspeed()) {
|
||||
return true;
|
||||
|
||||
if (_time_since_trans_start > getFrontTransitionTimeout()) {
|
||||
// transition timeout occured, abort transition
|
||||
} else if (_time_since_trans_start > getFrontTransitionTimeout()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user