diff --git a/libraries/AP_IMU/AP_IMU_INS.cpp b/libraries/AP_IMU/AP_IMU_INS.cpp index bb24f36248..fca618f13a 100644 --- a/libraries/AP_IMU/AP_IMU_INS.cpp +++ b/libraries/AP_IMU/AP_IMU_INS.cpp @@ -235,3 +235,7 @@ AP_IMU_INS::update(void) // always updated return true; } + +bool AP_IMU_INS::new_data_available(void) { + return _ins->new_data_available(); +} diff --git a/libraries/AP_IMU/AP_IMU_INS.h b/libraries/AP_IMU/AP_IMU_INS.h index 6e5311ab7b..54a0b54c80 100644 --- a/libraries/AP_IMU/AP_IMU_INS.h +++ b/libraries/AP_IMU/AP_IMU_INS.h @@ -51,6 +51,7 @@ public: virtual void init_gyro(void (*delay_cb)(unsigned long t) = delay, void (*flash_leds_cb)(bool on) = NULL); virtual bool update(void); + virtual bool new_data_available(void); // for jason virtual float gx() { return _sensor_cal[0]; } diff --git a/libraries/AP_IMU/AP_IMU_Shim.h b/libraries/AP_IMU/AP_IMU_Shim.h index 02aa86ee29..c9c1ce22b8 100644 --- a/libraries/AP_IMU/AP_IMU_Shim.h +++ b/libraries/AP_IMU/AP_IMU_Shim.h @@ -36,6 +36,8 @@ public: return updated; } //@} + + virtual bool new_data_available(void) { return true; } float gx() { return 0; } float gy() { return 0; } diff --git a/libraries/AP_IMU/IMU.cpp b/libraries/AP_IMU/IMU.cpp index 913020235b..2fabe704b8 100644 --- a/libraries/AP_IMU/IMU.cpp +++ b/libraries/AP_IMU/IMU.cpp @@ -30,6 +30,7 @@ void IMU::init_gyro(void (*delay_cb)(unsigned long t), void (*flash_leds_cb)(boo { } bool IMU::update(void) { return false; } +bool IMU::new_data_available(void) { return true; } float IMU::gx(void) { return 0.0; } float IMU::gy(void) { return 0.0; } diff --git a/libraries/AP_IMU/IMU.h b/libraries/AP_IMU/IMU.h index 8691e2663b..da259e5370 100644 --- a/libraries/AP_IMU/IMU.h +++ b/libraries/AP_IMU/IMU.h @@ -62,6 +62,9 @@ public: /// virtual bool update(void); + // true if new data is available from the sensors + virtual bool new_data_available(void); + /// Fetch the current gyro values /// /// @returns vector of rotational rates in radians/sec