Robot Control Library
rc_mpu_data_t Struct Reference

data struct populated with new sensor data More...

#include <rc/mpu.h>

Data Fields

base sensor readings in real units
double accel [3]
 accelerometer (XYZ) in units of m/s^2 More...
 
double gyro [3]
 gyroscope (XYZ) in units of degrees/s More...
 
double mag [3]
 magnetometer (XYZ) in units of uT More...
 
double temp
 thermometer, in units of degrees Celsius More...
 
16 bit raw adc readings and conversion rates
int16_t raw_gyro [3]
 raw gyroscope (XYZ)from 16-bit ADC More...
 
int16_t raw_accel [3]
 raw accelerometer (XYZ) from 16-bit ADC More...
 
double accel_to_ms2
 conversion rate from raw accelerometer to m/s^2 More...
 
double gyro_to_degs
 conversion rate from raw gyroscope to degrees/s More...
 
DMP data
double dmp_quat [4]
 normalized quaternion from DMP based on ONLY Accel/Gyro More...
 
double dmp_TaitBryan [3]
 Tait-Bryan angles (roll pitch yaw) in radians from DMP based on ONLY Accel/Gyro. More...
 
int tap_detected
 set to 1 if there was a tap detect on the last dmp sample, reset to 0 on next sample More...
 
int last_tap_direction
 direction of last tap, 1-6 corresponding to X+ X- Y+ Y- Z+ Z- More...
 
int last_tap_count
 current counter of rapid consecutive taps More...
 
fused DMP data filtered with magnetometer
double fused_quat [4]
 fused and normalized quaternion More...
 
double fused_TaitBryan [3]
 fused Tait-Bryan angles (roll pitch yaw) in radians More...
 
double compass_heading
 fused heading filtered with gyro and accel data, same as Tait-Bryan yaw More...
 
double compass_heading_raw
 unfiltered heading from magnetometer More...
 

Detailed Description

data struct populated with new sensor data

This is the container for holding the sensor data. The user is intended to make their own instance of this struct and pass its pointer to imu read functions. new data will then be written back into the user's instance of the data struct.

Examples:
rc_altitude.c, rc_balance.c, rc_test_dmp.c, rc_test_dmp_tap.c, and rc_test_mpu.c.

Field Documentation

◆ accel

double accel[3]

accelerometer (XYZ) in units of m/s^2

Examples:
rc_altitude.c, rc_test_dmp.c, and rc_test_mpu.c.

◆ gyro

double gyro[3]

gyroscope (XYZ) in units of degrees/s

Examples:
rc_test_dmp.c, and rc_test_mpu.c.

◆ mag

double mag[3]

magnetometer (XYZ) in units of uT

Examples:
rc_test_mpu.c.

◆ temp

double temp

thermometer, in units of degrees Celsius

Examples:
rc_test_dmp.c, and rc_test_mpu.c.

◆ raw_gyro

int16_t raw_gyro[3]

raw gyroscope (XYZ)from 16-bit ADC

Examples:
rc_test_mpu.c.

◆ raw_accel

int16_t raw_accel[3]

raw accelerometer (XYZ) from 16-bit ADC

Examples:
rc_test_mpu.c.

◆ accel_to_ms2

double accel_to_ms2

conversion rate from raw accelerometer to m/s^2

◆ gyro_to_degs

double gyro_to_degs

conversion rate from raw gyroscope to degrees/s

◆ dmp_quat

double dmp_quat[4]

normalized quaternion from DMP based on ONLY Accel/Gyro

Examples:
rc_altitude.c, and rc_test_dmp.c.

◆ dmp_TaitBryan

double dmp_TaitBryan[3]

Tait-Bryan angles (roll pitch yaw) in radians from DMP based on ONLY Accel/Gyro.

Examples:
rc_balance.c, and rc_test_dmp.c.

◆ tap_detected

int tap_detected

set to 1 if there was a tap detect on the last dmp sample, reset to 0 on next sample

◆ last_tap_direction

int last_tap_direction

direction of last tap, 1-6 corresponding to X+ X- Y+ Y- Z+ Z-

◆ last_tap_count

int last_tap_count

current counter of rapid consecutive taps

◆ fused_quat

double fused_quat[4]

fused and normalized quaternion

Examples:
rc_test_dmp.c.

◆ fused_TaitBryan

double fused_TaitBryan[3]

fused Tait-Bryan angles (roll pitch yaw) in radians

Examples:
rc_test_dmp.c.

◆ compass_heading

double compass_heading

fused heading filtered with gyro and accel data, same as Tait-Bryan yaw

Examples:
rc_test_dmp.c.

◆ compass_heading_raw

double compass_heading_raw

unfiltered heading from magnetometer

Examples:
rc_test_dmp.c.

The documentation for this struct was generated from the following file: