From 0744179970d5fe9f97d325bf68e6f8f713670427 Mon Sep 17 00:00:00 2001 From: Jason Short Date: Mon, 9 Jan 2012 16:56:52 -0800 Subject: [PATCH] Added comments moved out failsafe check. otherwise the reporting was erroneous. --- ArduCopter/events.pde | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ArduCopter/events.pde b/ArduCopter/events.pde index 1908aff2fb..6788e4b698 100644 --- a/ArduCopter/events.pde +++ b/ArduCopter/events.pde @@ -11,21 +11,20 @@ static void failsafe_on_event() { case AUTO: if (g.throttle_fs_action == 1) { + // do_rtl sets the altitude to the current altitude by default set_mode(RTL); - // send up up 10m + // We add an additional 10m to the current altitude next_WP.alt += 1000; } // 2 = Stay in AUTO and ignore failsafe default: if(home_is_set == true){ - // home distance is in meters - // This is to prevent accidental RTL - if ((home_distance > 15) && (current_loc.alt > 400)){ - set_mode(RTL); - // send up up 10m - next_WP.alt += 1000; - } + // same as above ^ + // do_rtl sets the altitude to the current altitude by default + set_mode(RTL); + // We add an additional 10m to the current altitude + next_WP.alt += 1000; }else{ // We have no GPS so we must land set_mode(LAND);