diff --git a/msg/sensor_accel.msg b/msg/sensor_accel.msg new file mode 100644 index 0000000000..fdae381aba --- /dev/null +++ b/msg/sensor_accel.msg @@ -0,0 +1,13 @@ +uint64 timestamp +uint64 error_count +float32 x # acceleration in the NED X board axis in m/s^2 +float32 y # acceleration in the NED Y board axis in m/s^2 +float32 z # acceleration in the NED Z board axis in m/s^2 +float32 temperature # temperature in degrees celsius +float32 range_m_s2 # range in m/s^2 (+- this value) +float32 scaling + +int16 x_raw +int16 y_raw +int16 z_raw +int16 temperature_raw diff --git a/src/drivers/drv_accel.h b/src/drivers/drv_accel.h index 738b28a6e1..f17d1ac9c2 100644 --- a/src/drivers/drv_accel.h +++ b/src/drivers/drv_accel.h @@ -51,25 +51,8 @@ #define ACCEL1_DEVICE_PATH "/dev/accel1" #define ACCEL2_DEVICE_PATH "/dev/accel2" -/** - * accel report structure. Reads from the device must be in multiples of this - * structure. - */ -struct accel_report { - uint64_t timestamp; - 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 temperature; /**< temperature in degrees celsius */ - float range_m_s2; /**< range in m/s^2 (+- this value) */ - float scaling; - - int16_t x_raw; - int16_t y_raw; - int16_t z_raw; - int16_t temperature_raw; -}; +#include +#define accel_report sensor_accel_s /** accel scaling factors; Vout = Vscale * (Vin + Voffset) */ struct accel_scale { @@ -81,11 +64,6 @@ struct accel_scale { float z_scale; }; -/* - * ObjDev tag for raw accelerometer data. - */ -ORB_DECLARE(sensor_accel); - /* * ioctl() definitions *