mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
Copter: fix rtl's use of rally point alt
Thanks to OXINARF for spotting this
This commit is contained in:
parent
57977e2d76
commit
68d3655195
@ -424,15 +424,7 @@ void Copter::rtl_compute_return_target(bool terrain_following_allowed)
|
||||
{
|
||||
// set return target to nearest rally point or home position
|
||||
#if AC_RALLY == ENABLED
|
||||
RallyLocation rallyLoc;
|
||||
Location_Class home(ahrs.get_home());
|
||||
bool use_home = !rally.find_nearest_rally_point(current_loc, rallyLoc);
|
||||
|
||||
if (!use_home) {
|
||||
rtl_path.return_target = Location_Class(rallyLoc.lat, rallyLoc.lng, home.alt, home.get_alt_frame());
|
||||
} else {
|
||||
rtl_path.return_target = home;
|
||||
}
|
||||
rtl_path.return_target = rally.calc_best_rally_or_home_location(current_loc, ahrs.get_home().alt);
|
||||
#else
|
||||
rtl_path.return_target = ahrs.get_home();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user