System.pde - RTL

removed Approach mode, fixed RTL to loiter until desired altitude is reached
This commit is contained in:
Jason Short 2012-07-01 13:37:12 -07:00
parent 44e12c6d2d
commit bea1ab8810
1 changed files with 5 additions and 9 deletions

View File

@ -421,6 +421,8 @@ static void set_mode(byte mode)
// if we change modes, we must clear landed flag // if we change modes, we must clear landed flag
land_complete = false; land_complete = false;
// have we acheived the proper altitude before RTL is enabled
rtl_reached_alt = false;
// debug to Serial terminal // debug to Serial terminal
//Serial.println(flight_mode_strings[control_mode]); //Serial.println(flight_mode_strings[control_mode]);
@ -499,19 +501,13 @@ static void set_mode(byte mode)
do_land(); do_land();
break; break;
case APPROACH:
yaw_mode = LOITER_YAW;
roll_pitch_mode = LOITER_RP;
throttle_mode = THROTTLE_AUTO;
do_approach();
break;
case RTL: case RTL:
yaw_mode = RTL_YAW; yaw_mode = RTL_YAW;
roll_pitch_mode = RTL_RP; roll_pitch_mode = RTL_RP;
throttle_mode = RTL_THR; throttle_mode = RTL_THR;
rtl_reached_alt = false;
do_RTL(); set_next_WP(&current_loc);
set_new_altitude(get_RTL_alt());
break; break;
case OF_LOITER: case OF_LOITER: