mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
rtl: fixed computation of return altitude when mission landing is available
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -218,7 +218,8 @@ void RTL::on_activation()
|
|||||||
_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 {
|
} else {
|
||||||
_rtl_alt = math::max(global_position.alt, _destination.alt + _param_rtl_return_alt.get());
|
_rtl_alt = max(global_position.alt, max(_destination.alt,
|
||||||
|
_navigator->get_home_position()->alt + _param_rtl_return_alt.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_navigator->get_land_detected()->landed) {
|
if (_navigator->get_land_detected()->landed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user