From a4d2b044f0472e96f6f2598b534d792a77bd875d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 16 Oct 2014 10:33:36 +1100 Subject: [PATCH] AntennaTracker: convert to new AP_InertialSensor API --- AntennaTracker/AntennaTracker.pde | 26 +++----------------------- AntennaTracker/config.h | 1 - 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/AntennaTracker/AntennaTracker.pde b/AntennaTracker/AntennaTracker.pde index 4d085e5a05..efbf714448 100644 --- a/AntennaTracker/AntennaTracker.pde +++ b/AntennaTracker/AntennaTracker.pde @@ -144,29 +144,11 @@ static AP_Compass_HIL compass; #error Unrecognized CONFIG_COMPASS setting #endif -#if CONFIG_INS_TYPE == HAL_INS_OILPAN || CONFIG_HAL_BOARD == HAL_BOARD_APM1 +#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 AP_ADC_ADS7844 apm1_adc; #endif -#if CONFIG_INS_TYPE == HAL_INS_MPU6000 -AP_InertialSensor_MPU6000 ins; -#elif CONFIG_INS_TYPE == HAL_INS_PX4 -AP_InertialSensor_PX4 ins; -#elif CONFIG_INS_TYPE == HAL_INS_VRBRAIN -AP_InertialSensor_VRBRAIN ins; -#elif CONFIG_INS_TYPE == HAL_INS_HIL -AP_InertialSensor_HIL ins; -#elif CONFIG_INS_TYPE == HAL_INS_OILPAN -AP_InertialSensor_Oilpan ins( &apm1_adc ); -#elif CONFIG_INS_TYPE == HAL_INS_FLYMAPLE -AP_InertialSensor_Flymaple ins; -#elif CONFIG_INS_TYPE == HAL_INS_L3G4200D -AP_InertialSensor_L3G4200D ins; -#elif CONFIG_INS_TYPE == HAL_INS_MPU9250 -AP_InertialSensor_MPU9250 ins; -#else - #error Unrecognised CONFIG_INS_TYPE setting. -#endif // CONFIG_INS_TYPE +AP_InertialSensor ins; // Inertial Navigation EKF #if AP_AHRS_NAVEKF_AVAILABLE @@ -300,9 +282,7 @@ void setup() void loop() { // wait for an INS sample - if (!ins.wait_for_sample(1000)) { - return; - } + ins.wait_for_sample(); // tell the scheduler one tick has passed scheduler.tick(); diff --git a/AntennaTracker/config.h b/AntennaTracker/config.h index 96bb4da334..d1f49e4eb9 100644 --- a/AntennaTracker/config.h +++ b/AntennaTracker/config.h @@ -17,7 +17,6 @@ #define ENABLE ENABLED #define DISABLE DISABLED -#define CONFIG_INS_TYPE HAL_INS_DEFAULT #define CONFIG_BARO HAL_BARO_DEFAULT #define CONFIG_COMPASS HAL_COMPASS_DEFAULT