Copter: Remove 80m altitude limit on RTL

This commit is contained in:
Jonathan Challinger 2014-02-17 02:49:30 -08:00 committed by Randy Mackay
parent 045c6d8c3f
commit 2601ac9959
3 changed files with 8 additions and 15 deletions

View File

@ -1,16 +1,5 @@
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
static int32_t get_RTL_alt()
{
if(g.rtl_altitude <= 0) {
return min(current_loc.alt, RTL_ALT_MAX);
}else if (g.rtl_altitude < current_loc.alt) {
return min(current_loc.alt, RTL_ALT_MAX);
}else{
return g.rtl_altitude;
}
}
// run this at setup on the ground
// -------------------------------
static void init_home()

View File

@ -541,10 +541,6 @@
# define RTL_ALT 1500 // default alt to return to home in cm, 0 = Maintain current altitude
#endif
#ifndef RTL_ALT_MAX
# define RTL_ALT_MAX 8000 // Max height to return to home in cm (i.e 80m)
#endif
#ifndef RTL_LOITER_TIME
# define RTL_LOITER_TIME 5000 // Time (in milliseconds) to loiter above home before begining final descent
#endif

View File

@ -268,3 +268,11 @@ static void rtl_land_run()
rtl_state_complete = ap.land_complete;
}
// get_RTL_alt - return altitude which vehicle should return home at
// altitude is in cm above home
static float get_RTL_alt()
{
// return maximum of current altitude and rtl altitude
return max(current_loc.alt, g.rtl_altitude);
}