VTOL: fix transition quadchute below home

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2023-04-21 14:29:27 +02:00
parent 233d901934
commit 0d156f84e6
1 changed files with 1 additions and 8 deletions

View File

@ -303,14 +303,7 @@ bool VtolType::isFrontTransitionAltitudeLoss()
if (_param_vt_qc_t_alt_loss.get() > FLT_EPSILON && _common_vtol_mode == mode::TRANSITION_TO_FW && _local_pos->z_valid) {
if (_local_pos->z <= FLT_EPSILON) {
// vehilce is above home
result = _local_pos->z - _local_position_z_start_of_transition > _param_vt_qc_t_alt_loss.get();
} else {
// vehilce is below home
result = _local_position_z_start_of_transition - _local_pos->z > _param_vt_qc_t_alt_loss.get();
}
result = _local_pos->z - _local_position_z_start_of_transition > _param_vt_qc_t_alt_loss.get();
}
return result;