From 467ef66a7722bc20a3a66661538ad85a59d4a2be Mon Sep 17 00:00:00 2001 From: Jason Short Date: Wed, 4 Jan 2012 09:26:45 -0800 Subject: [PATCH] Added home offset for altitude --- ArduCopter/commands_logic.pde | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduCopter/commands_logic.pde b/ArduCopter/commands_logic.pde index b2e7835296..2401e8e4a5 100644 --- a/ArduCopter/commands_logic.pde +++ b/ArduCopter/commands_logic.pde @@ -357,14 +357,14 @@ static bool verify_land() velocity_land = 2000; - if (current_loc.alt < 500){ + if ((current_loc.alt - home.alt) < 500){ // a LP filter used to tell if we have landed // will drive to 0 if we are on the ground - maybe, the baro is noisy velocity_land = ((velocity_land * 7) + (old_alt - current_loc.alt)) / 8; } old_alt = current_loc.alt; - if (current_loc.alt < 300){ + if ((current_loc.alt - home.alt) < 300){ wp_control = NO_NAV_MODE; @@ -384,7 +384,7 @@ static bool verify_land() } } - if(current_loc.alt < 300 && velocity_land <= 100){ + if((current_loc.alt - home.alt) < 300 && velocity_land <= 100){ land_complete = true; // reset old_alt old_alt == 0;