From 06c4e842abdca8083dd2b1f20758431a6f8e975e Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Tue, 2 Jul 2013 16:48:01 +0200 Subject: [PATCH] [rotorcraft] add MODE_STARTUP to make flying without RC possible Based on Freek van Tienen's commit, thx. closes #467 for now --- conf/airframes/ardrone2_sdk.xml | 5 +++-- sw/airborne/firmwares/rotorcraft/autopilot.c | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/conf/airframes/ardrone2_sdk.xml b/conf/airframes/ardrone2_sdk.xml index 7544a9a391..dfbcab0f90 100644 --- a/conf/airframes/ardrone2_sdk.xml +++ b/conf/airframes/ardrone2_sdk.xml @@ -97,9 +97,10 @@
+ - - + +
diff --git a/sw/airborne/firmwares/rotorcraft/autopilot.c b/sw/airborne/firmwares/rotorcraft/autopilot.c index ae91f2c2d1..1652b0b4ed 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot.c +++ b/sw/airborne/firmwares/rotorcraft/autopilot.c @@ -73,8 +73,13 @@ static inline int ahrs_is_aligned(void) { #include "autopilot_arming_yaw.h" #endif +#ifndef MODE_STARTUP +#define MODE_STARTUP AP_MODE_KILL +PRINT_CONFIG_MSG("Using AP_MODE_KILL as MODE_STARTUP") +#endif + void autopilot_init(void) { - autopilot_mode = AP_MODE_KILL; + autopilot_mode = MODE_STARTUP; autopilot_motors_on = FALSE; kill_throttle = ! autopilot_motors_on; autopilot_in_flight = FALSE;