From 62f37204be6956adc1a26fe84b9dda3b2245802a Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 21 Jun 2015 18:50:24 +0200 Subject: [PATCH] Accel and gyro drivers: Add integrals --- src/drivers/drv_accel.h | 4 ++++ src/drivers/drv_gyro.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/drivers/drv_accel.h b/src/drivers/drv_accel.h index 738b28a6e1..845050edf5 100644 --- a/src/drivers/drv_accel.h +++ b/src/drivers/drv_accel.h @@ -57,10 +57,14 @@ */ struct accel_report { uint64_t timestamp; + uint64_t integral_dt; /**< integration time */ uint64_t error_count; float x; /**< acceleration in the NED X board axis in m/s^2 */ float y; /**< acceleration in the NED Y board axis in m/s^2 */ float z; /**< acceleration in the NED Z board axis in m/s^2 */ + float x_integral; /**< velocity in the NED X board axis in m/s over the integration time frame */ + float y_integral; /**< velocity in the NED Y board axis in m/s over the integration time frame */ + float z_integral; /**< velocity in the NED Z board axis in m/s over the integration time frame */ float temperature; /**< temperature in degrees celsius */ float range_m_s2; /**< range in m/s^2 (+- this value) */ float scaling; diff --git a/src/drivers/drv_gyro.h b/src/drivers/drv_gyro.h index 8e80413ac9..60426caf90 100644 --- a/src/drivers/drv_gyro.h +++ b/src/drivers/drv_gyro.h @@ -57,10 +57,14 @@ */ struct gyro_report { uint64_t timestamp; + uint64_t integral_dt; /**< integration time */ uint64_t error_count; float x; /**< angular velocity in the NED X board axis in rad/s */ float y; /**< angular velocity in the NED Y board axis in rad/s */ float z; /**< angular velocity in the NED Z board axis in rad/s */ + float x_integral; /**< delta angle in the NED X board axis in rad/s in the integration time frame */ + float y_integral; /**< delta angle in the NED Y board axis in rad/s in the integration time frame */ + float z_integral; /**< delta angle in the NED Z board axis in rad/s in the integration time frame */ float temperature; /**< temperature in degrees celcius */ float range_rad_s; float scaling;