mirror of https://github.com/ArduPilot/ardupilot
System.pde - RTL
removed Approach mode, fixed RTL to loiter until desired altitude is reached
This commit is contained in:
parent
e35fb9ecd7
commit
9a30270879
|
@ -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(¤t_loc);
|
||||||
|
set_new_altitude(get_RTL_alt());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OF_LOITER:
|
case OF_LOITER:
|
||||||
|
|
Loading…
Reference in New Issue