From 6dc3cff0009527ef3e6eae97a0d16ea5aef676b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 7 May 2015 12:09:00 +1000 Subject: [PATCH] Copter: added LOG_BITMASK 1<<19 for logging raw accel/gyro data useful for checking vibration handling --- ArduCopter/ArduCopter.pde | 3 +++ ArduCopter/defines.h | 1 + ArduCopter/system.pde | 3 +++ 3 files changed, 7 insertions(+) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index c8da8e039f..1a630bb382 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -1088,6 +1088,9 @@ static void one_hz_loop() // update position controller alt limits update_poscon_alt_max(); + + // enable/disable raw gyro/accel logging + ins.set_raw_logging(should_log(MASK_LOG_IMU_RAW)); } // called at 50hz diff --git a/ArduCopter/defines.h b/ArduCopter/defines.h index e9f1d93fd3..d9ab325573 100644 --- a/ArduCopter/defines.h +++ b/ArduCopter/defines.h @@ -258,6 +258,7 @@ enum FlipState { #define MASK_LOG_WHEN_DISARMED (1UL<<16) #define MASK_LOG_MOTBATT (1UL<<17) #define MASK_LOG_IMU_FAST (1UL<<18) +#define MASK_LOG_IMU_RAW (1UL<<19) #define MASK_LOG_ANY 0xFFFF // DATA - event logging diff --git a/ArduCopter/system.pde b/ArduCopter/system.pde index b68cedce9a..f9b7842988 100644 --- a/ArduCopter/system.pde +++ b/ArduCopter/system.pde @@ -261,6 +261,9 @@ static void init_ardupilot() // enable CPU failsafe failsafe_enable(); + ins.set_raw_logging(should_log(MASK_LOG_IMU_RAW)); + ins.set_dataflash(&DataFlash); + cliSerial->print_P(PSTR("\nReady to FLY ")); // flag that initialisation has completed