mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +08:00
rtl: do not use cone logic for vehicle flying as fixed wing
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -202,8 +202,13 @@ void RTL::on_activation()
|
|||||||
|
|
||||||
const vehicle_global_position_s &global_position = *_navigator->get_global_position();
|
const vehicle_global_position_s &global_position = *_navigator->get_global_position();
|
||||||
|
|
||||||
|
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
|
||||||
_rtl_alt = calculate_return_alt_from_cone_half_angle((float)_param_rtl_cone_half_angle_deg.get());
|
_rtl_alt = calculate_return_alt_from_cone_half_angle((float)_param_rtl_cone_half_angle_deg.get());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_rtl_alt = math::max(global_position.alt, _destination.alt + _param_rtl_return_alt.get());
|
||||||
|
}
|
||||||
|
|
||||||
if (_navigator->get_land_detected()->landed) {
|
if (_navigator->get_land_detected()->landed) {
|
||||||
// For safety reasons don't go into RTL if landed.
|
// For safety reasons don't go into RTL if landed.
|
||||||
_rtl_state = RTL_STATE_LANDED;
|
_rtl_state = RTL_STATE_LANDED;
|
||||||
|
|||||||
Reference in New Issue
Block a user