mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 08:27:34 +08:00
rtl: if very close to home then do not descend if higher than RTL_DESCEND_ALT
before reaching home Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -516,7 +516,8 @@ float RTL::calculate_return_alt_from_cone_half_angle(float cone_half_angle_deg)
|
||||
float rtl_altitude;
|
||||
|
||||
if (destination_dist <= _param_rtl_min_dist.get()) {
|
||||
rtl_altitude = _destination.alt + _param_rtl_descend_alt.get();
|
||||
// we are very close to home, make sure we are above the RTL descend altitude
|
||||
rtl_altitude = math::max(_destination.alt + _param_rtl_descend_alt.get(), gpos.alt);
|
||||
|
||||
} else if (gpos.alt > _destination.alt + _param_rtl_return_alt.get() || cone_half_angle_deg >= 90.0f) {
|
||||
rtl_altitude = gpos.alt;
|
||||
|
||||
Reference in New Issue
Block a user