diff --git a/msg/sensor_gyro.msg b/msg/sensor_gyro.msg new file mode 100644 index 0000000000..4a252269e8 --- /dev/null +++ b/msg/sensor_gyro.msg @@ -0,0 +1,13 @@ +uint64 timestamp +uint64 error_count +float32 x # angular velocity in the NED X board axis in rad/s +float32 y # angular velocity in the NED Y board axis in rad/s +float32 z # angular velocity in the NED Z board axis in rad/s +float32 temperature # temperature in degrees celcius +float32 range_rad_s +float32 scaling + +int16 x_raw +int16 y_raw +int16 z_raw +int16 temperature_raw diff --git a/src/drivers/drv_gyro.h b/src/drivers/drv_gyro.h index 8e80413ac9..feaa38881f 100644 --- a/src/drivers/drv_gyro.h +++ b/src/drivers/drv_gyro.h @@ -51,25 +51,8 @@ #define GYRO1_DEVICE_PATH "/dev/gyro1" #define GYRO2_DEVICE_PATH "/dev/gyro2" -/** - * gyro report structure. Reads from the device must be in multiples of this - * structure. - */ -struct gyro_report { - uint64_t timestamp; - 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 temperature; /**< temperature in degrees celcius */ - float range_rad_s; - float scaling; - - int16_t x_raw; - int16_t y_raw; - int16_t z_raw; - int16_t temperature_raw; -}; +#include +#define gyro_report sensor_gyro_s /** gyro scaling factors; Vout = (Vin * Vscale) + Voffset */ struct gyro_scale { @@ -81,11 +64,6 @@ struct gyro_scale { float z_scale; }; -/* - * ObjDev tag for raw gyro data. - */ -ORB_DECLARE(sensor_gyro); - /* * ioctl() definitions */