ArduCopter: allow GUIDED mode roll-pitch, yaw and throttle control modes to be overridden

This commit is contained in:
rmackay9 2012-12-12 23:28:26 +09:00 committed by Andrew Tridgell
parent ddc578fd18
commit 50d46898fb
2 changed files with 16 additions and 3 deletions

View File

@ -577,6 +577,19 @@
# define AUTO_THR THROTTLE_AUTO
#endif
// Guided Mode
#ifndef GUIDED_YAW
# define GUIDED_YAW YAW_LOOK_AT_NEXT_WP
#endif
#ifndef GUIDED_RP
# define GUIDED_RP ROLL_PITCH_AUTO
#endif
#ifndef GUIDED_THR
# define GUIDED_THR THROTTLE_AUTO
#endif
// CIRCLE Mode
#ifndef CIRCLE_YAW
# define CIRCLE_YAW YAW_LOOK_AT_NEXT_WP

View File

@ -477,9 +477,9 @@ static void set_mode(uint8_t mode)
case GUIDED:
ap.manual_throttle = false;
ap.manual_attitude = false;
set_yaw_mode(YAW_LOOK_AT_NEXT_WP);
set_roll_pitch_mode(ROLL_PITCH_AUTO);
set_throttle_mode(THROTTLE_AUTO);
set_yaw_mode(GUIDED_YAW);
set_roll_pitch_mode(GUIDED_RP);
set_throttle_mode(GUIDED_THR);
next_WP = current_loc;
set_next_WP(&guided_WP);
break;