JeVois  1.16
JeVois Smart Embedded Machine Vision Toolkit
Share this page:

#include <jevois/Core/IMUdata.H>

DMP data (Digital Motion Processor)

The digital motion processor (DMP) inside the ICM-20948 IMU chip can compute a variety of things that range from simply the raw data buffered at a fixed rate to quaternions to activity detection (footsteps, driving, biking, etc). The chip must be operating in DMP mode for this data to be available. In addition, one can configure which data is computed and output by the DMP.

Definition at line 128 of file IMUdata.H.

Public Member Functions

void parsePacket (unsigned char const *packet, size_t siz)
 Populate our fields from a packet received from the DMP. More...
 
float fsync_us () const
 Delay between FSYNC and next IMU data, in microseconds. More...
 
std::vector< std::string > activity ()
 Decode current ongoing activities into a string. More...
 
std::vector< std::string > activity2 ()
 

Static Public Member Functions

static float fix2float (long val)
 Convert a long fixed-point value to float. More...
 

Public Attributes

unsigned short header1
 Header 1 fields that indicate what data is valid. More...
 
unsigned short header2
 Header 2 fields that indicate what data is valid. More...
 
short accel [3]
 Raw accelerometer data (when JEVOIS_DMP_ACCEL in header1) More...
 
short gyro [3]
 Raw gyro data (when JEVOIS_DMP_GYRO in header1) More...
 
short cpass [3]
 Raw compass data (when JEVOIS_DMP_CPASS in header1) More...
 
short gbias [3]
 Raw gyro bias data (when JEVOIS_DMP_GYRO in header1) More...
 
long quat6 [3]
 Quaternion6 data (when JEVOIS_DMP_QUAT6 in header1) More...
 
long quat9 [3]
 Quaternion9 data (when JEVOIS_DMP_QUAT9 in header1) More...
 
long quat9acc
 Quaternion9 accuracy (when JEVOIS_DMP_QUAT9 in header1) More...
 
unsigned long stepts
 Step detection timestamp (when JEVOIS_DMP_PED_STEPDET) More...
 
unsigned short steps
 Number of steps (0..7) detected this cycle (when JEVOIS_DMP_PED_STEPDET) More...
 
long geomag [3]
 Geomag data (when JEVOIS_DMP_GEOMAG in header1) More...
 
long geomagacc
 Geomag accuracy (when JEVOIS_DMP_GEOMAG in header1) More...
 
short gyrobias [3]
 Gyro bias/calibration data (when JEVOIS_DMP_GYRO_CALIBR in header1) More...
 
long cpasscal [3]
 Compass calibration data (when JEVOIS_DMP_CPASS_CALIBR in header1) More...
 
short accelacc
 Accelerometer accuracy data (when JEVOIS_DMP_ACCEL_ACCURACY in header2) More...
 
short gyroacc
 Gyro accuracy data (when JEVOIS_DMP_GYRO_ACCURACY in header2) More...
 
short cpassacc
 Compass accuracy data (when JEVOIS_DMP_CPASS_ACCURACY in header2) More...
 
unsigned short fsync
 Delay between FSYNC received from camera and first subsequent IMU data generated. More...
 
short pickup
 Flip/pickup detection (when JEVOIS_DMP_FLIP_PICKUP in header2) More...
 
unsigned short bacstate
 Activity recognition state (when JEVOIS_DMP_ACT_RECOG in header2) More...
 
long bacts
 Activity recognition timestamp (when JEVOIS_DMP_ACT_RECOG in header2) More...
 
unsigned short odrcnt
 Output data rate counter (always here but unclear what it is) More...
 

Member Function Documentation

◆ activity()

std::vector< std::string > jevois::DMPdata::activity ( )

Decode current ongoing activities into a string.

Requires that JEVOIS_DMP_ACT_RECOG be set in header2 and correct data rates are used. This function returns strings that contain start or stop as a prefix, then each activity. Activities are: drive, walk, run, bike, tilt, still.

Definition at line 233 of file IMUdata.C.

References DMP_BAC_BIKE, DMP_BAC_DRIVE, DMP_BAC_RUN, DMP_BAC_STILL, DMP_BAC_TILT, DMP_BAC_WALK, and jevois::sformat().

◆ activity2()

std::vector< std::string > jevois::DMPdata::activity2 ( )

Requires that JEVOIS_DMP_ACT_RECOG be set in header2 and correct data rates are used. This function returns strings that contain the name of each ongoing event. Warning, it has state, so you should only call this function for any activity-related parsing after you start using it, and you should call it for every reading from the DMP. Activities are: drive, walk, run, bike, tilt, still.

Definition at line 259 of file IMUdata.C.

References DMP_BAC_BIKE, DMP_BAC_DRIVE, DMP_BAC_RUN, DMP_BAC_STILL, DMP_BAC_TILT, and DMP_BAC_WALK.

◆ fix2float()

float jevois::DMPdata::fix2float ( long  val)
static

Convert a long fixed-point value to float.

Definition at line 283 of file IMUdata.C.

◆ fsync_us()

float jevois::DMPdata::fsync_us ( ) const

Delay between FSYNC and next IMU data, in microseconds.

Definition at line 227 of file IMUdata.C.

◆ parsePacket()

Member Data Documentation

◆ accel

short jevois::DMPdata::accel[3]

Raw accelerometer data (when JEVOIS_DMP_ACCEL in header1)

Definition at line 136 of file IMUdata.H.

Referenced by parsePacket().

◆ accelacc

short jevois::DMPdata::accelacc

Accelerometer accuracy data (when JEVOIS_DMP_ACCEL_ACCURACY in header2)

Definition at line 154 of file IMUdata.H.

Referenced by parsePacket().

◆ bacstate

unsigned short jevois::DMPdata::bacstate

Activity recognition state (when JEVOIS_DMP_ACT_RECOG in header2)

Definition at line 163 of file IMUdata.H.

Referenced by parsePacket().

◆ bacts

long jevois::DMPdata::bacts

Activity recognition timestamp (when JEVOIS_DMP_ACT_RECOG in header2)

Definition at line 164 of file IMUdata.H.

Referenced by parsePacket().

◆ cpass

short jevois::DMPdata::cpass[3]

Raw compass data (when JEVOIS_DMP_CPASS in header1)

Definition at line 138 of file IMUdata.H.

Referenced by parsePacket().

◆ cpassacc

short jevois::DMPdata::cpassacc

Compass accuracy data (when JEVOIS_DMP_CPASS_ACCURACY in header2)

Definition at line 156 of file IMUdata.H.

Referenced by parsePacket().

◆ cpasscal

long jevois::DMPdata::cpasscal[3]

Compass calibration data (when JEVOIS_DMP_CPASS_CALIBR in header1)

Definition at line 152 of file IMUdata.H.

Referenced by parsePacket().

◆ fsync

unsigned short jevois::DMPdata::fsync

Delay between FSYNC received from camera and first subsequent IMU data generated.

Definition at line 158 of file IMUdata.H.

Referenced by parsePacket().

◆ gbias

short jevois::DMPdata::gbias[3]

Raw gyro bias data (when JEVOIS_DMP_GYRO in header1)

Definition at line 139 of file IMUdata.H.

Referenced by parsePacket().

◆ geomag

long jevois::DMPdata::geomag[3]

Geomag data (when JEVOIS_DMP_GEOMAG in header1)

Definition at line 148 of file IMUdata.H.

Referenced by parsePacket().

◆ geomagacc

long jevois::DMPdata::geomagacc

Geomag accuracy (when JEVOIS_DMP_GEOMAG in header1)

Definition at line 149 of file IMUdata.H.

Referenced by parsePacket().

◆ gyro

short jevois::DMPdata::gyro[3]

Raw gyro data (when JEVOIS_DMP_GYRO in header1)

Definition at line 137 of file IMUdata.H.

Referenced by parsePacket().

◆ gyroacc

short jevois::DMPdata::gyroacc

Gyro accuracy data (when JEVOIS_DMP_GYRO_ACCURACY in header2)

Definition at line 155 of file IMUdata.H.

Referenced by parsePacket().

◆ gyrobias

short jevois::DMPdata::gyrobias[3]

Gyro bias/calibration data (when JEVOIS_DMP_GYRO_CALIBR in header1)

Definition at line 151 of file IMUdata.H.

Referenced by parsePacket().

◆ header1

unsigned short jevois::DMPdata::header1

Header 1 fields that indicate what data is valid.

Definition at line 133 of file IMUdata.H.

Referenced by parsePacket().

◆ header2

unsigned short jevois::DMPdata::header2

Header 2 fields that indicate what data is valid.

Definition at line 134 of file IMUdata.H.

Referenced by parsePacket().

◆ odrcnt

unsigned short jevois::DMPdata::odrcnt

Output data rate counter (always here but unclear what it is)

Decode start/stop of activities into a string

Definition at line 166 of file IMUdata.H.

Referenced by parsePacket().

◆ pickup

short jevois::DMPdata::pickup

Flip/pickup detection (when JEVOIS_DMP_FLIP_PICKUP in header2)

Definition at line 161 of file IMUdata.H.

Referenced by parsePacket().

◆ quat6

long jevois::DMPdata::quat6[3]

Quaternion6 data (when JEVOIS_DMP_QUAT6 in header1)

Definition at line 141 of file IMUdata.H.

Referenced by parsePacket().

◆ quat9

long jevois::DMPdata::quat9[3]

Quaternion9 data (when JEVOIS_DMP_QUAT9 in header1)

Definition at line 142 of file IMUdata.H.

Referenced by parsePacket().

◆ quat9acc

long jevois::DMPdata::quat9acc

Quaternion9 accuracy (when JEVOIS_DMP_QUAT9 in header1)

Definition at line 143 of file IMUdata.H.

Referenced by parsePacket().

◆ steps

unsigned short jevois::DMPdata::steps

Number of steps (0..7) detected this cycle (when JEVOIS_DMP_PED_STEPDET)

Definition at line 146 of file IMUdata.H.

Referenced by parsePacket().

◆ stepts

unsigned long jevois::DMPdata::stepts

Step detection timestamp (when JEVOIS_DMP_PED_STEPDET)

Definition at line 145 of file IMUdata.H.

Referenced by parsePacket().


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