diff --git a/ArduCopter/motors.pde b/ArduCopter/motors.pde index 007c9dd316..7a427e6903 100644 --- a/ArduCopter/motors.pde +++ b/ArduCopter/motors.pde @@ -65,6 +65,11 @@ static void arm_motors() static void init_arm_motors() { + // Flag used to track if we have armed the motors the first time. + // This is used to decide if we should run the ground_start routine + // which calibrates the IMU + static bool did_ground_start = false; + //Serial.printf("\nARM\n"); #if HIL_MODE != HIL_MODE_DISABLED || defined(DESKTOP_BUILD) gcs_send_text_P(SEVERITY_HIGH, PSTR("ARMING MOTORS")); @@ -116,6 +121,9 @@ static void init_disarm_motors() motor_armed = false; compass.save_offsets(); + // we are not in the air + takeoff_complete = false; + #if PIEZO_ARMING == 1 piezo_beep(); #endif