|
|
|
@ -482,7 +482,7 @@ void Copter::rtl_compute_return_target(bool terrain_following_allowed)
@@ -482,7 +482,7 @@ void Copter::rtl_compute_return_target(bool terrain_following_allowed)
|
|
|
|
|
if ((fence.get_enabled_fences() & AC_FENCE_TYPE_ALT_MAX) != 0) { |
|
|
|
|
// get return target as alt-above-home so it can be compared to fence's alt
|
|
|
|
|
if (rtl_path.return_target.get_alt_cm(Location_Class::ALT_FRAME_ABOVE_HOME, target_alt)) { |
|
|
|
|
float fence_alt = fence.get_safe_alt()*100.0f; |
|
|
|
|
float fence_alt = fence.get_safe_alt_max()*100.0f; |
|
|
|
|
if (target_alt > fence_alt) { |
|
|
|
|
// reduce target alt to the fence alt
|
|
|
|
|
rtl_path.return_target.alt -= (target_alt - fence_alt); |
|
|
|
|