JeVois
1.21
JeVois Smart Embedded Machine Vision Toolkit
|
|
#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.
Public Member Functions | |
void | parsePacket (unsigned char const *packet, size_t siz) |
Populate our fields from a packet received from the DMP. | |
float | fsync_us () const |
Delay between FSYNC and next IMU data, in microseconds. | |
std::vector< std::string > | activity () |
Decode current ongoing activities into a string. | |
std::vector< std::string > | activity2 () |
Static Public Member Functions | |
static float | fix2float (long val) |
Convert a long fixed-point value to float. | |
Public Attributes | |
unsigned short | header1 |
Header 1 fields that indicate what data is valid. | |
unsigned short | header2 |
Header 2 fields that indicate what data is valid. | |
short | accel [3] |
Raw accelerometer data (when JEVOIS_DMP_ACCEL in header1) | |
short | gyro [3] |
Raw gyro data (when JEVOIS_DMP_GYRO in header1) | |
short | cpass [3] |
Raw compass data (when JEVOIS_DMP_CPASS in header1) | |
short | gbias [3] |
Raw gyro bias data (when JEVOIS_DMP_GYRO in header1) | |
long | quat6 [3] |
Quaternion6 data (when JEVOIS_DMP_QUAT6 in header1) | |
long | quat9 [3] |
Quaternion9 data (when JEVOIS_DMP_QUAT9 in header1) | |
long | quat9acc |
Quaternion9 accuracy (when JEVOIS_DMP_QUAT9 in header1) | |
unsigned long | stepts |
Step detection timestamp (when JEVOIS_DMP_PED_STEPDET) | |
unsigned short | steps |
Number of steps (0..7) detected this cycle (when JEVOIS_DMP_PED_STEPDET) | |
long | geomag [3] |
Geomag data (when JEVOIS_DMP_GEOMAG in header1) | |
long | geomagacc |
Geomag accuracy (when JEVOIS_DMP_GEOMAG in header1) | |
short | gyrobias [3] |
Gyro bias/calibration data (when JEVOIS_DMP_GYRO_CALIBR in header1) | |
long | cpasscal [3] |
Compass calibration data (when JEVOIS_DMP_CPASS_CALIBR in header1) | |
short | accelacc |
Accelerometer accuracy data (when JEVOIS_DMP_ACCEL_ACCURACY in header2) | |
short | gyroacc |
Gyro accuracy data (when JEVOIS_DMP_GYRO_ACCURACY in header2) | |
short | cpassacc |
Compass accuracy data (when JEVOIS_DMP_CPASS_ACCURACY in header2) | |
unsigned short | fsync |
Delay between FSYNC received from camera and first subsequent IMU data generated. | |
short | pickup |
Flip/pickup detection (when JEVOIS_DMP_FLIP_PICKUP in header2) | |
unsigned short | bacstate |
Activity recognition state (when JEVOIS_DMP_ACT_RECOG in header2) | |
long | bacts |
Activity recognition timestamp (when JEVOIS_DMP_ACT_RECOG in header2) | |
unsigned short | odrcnt |
Output data rate counter (always here but unclear what it is) | |
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().
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.
|
static |
float jevois::DMPdata::fsync_us | ( | ) | const |
void jevois::DMPdata::parsePacket | ( | unsigned char const * | packet, |
size_t | siz | ||
) |
Populate our fields from a packet received from the DMP.
Definition at line 84 of file IMUdata.C.
References accel, accelacc, bacstate, bacts, cpass, cpassacc, cpasscal, fsync, gbias, geomag, geomagacc, gyro, gyroacc, gyrobias, header1, header2, JEVOIS_DMP_ACCEL, JEVOIS_DMP_ACCEL_ACCURACY, JEVOIS_DMP_ACCEL_ACCURACY_SZ, JEVOIS_DMP_ACCEL_DATA_SZ, JEVOIS_DMP_ACT_RECOG, JEVOIS_DMP_ACT_RECOG_SZ, JEVOIS_DMP_ALS, JEVOIS_DMP_ALS_DATA_SZ, JEVOIS_DMP_CPASS, JEVOIS_DMP_CPASS_ACCURACY, JEVOIS_DMP_CPASS_ACCURACY_SZ, JEVOIS_DMP_CPASS_CALIBR, JEVOIS_DMP_CPASS_CALIBR_DATA_SZ, JEVOIS_DMP_CPASS_DATA_SZ, JEVOIS_DMP_FLIP_PICKUP, JEVOIS_DMP_FLIP_PICKUP_SZ, JEVOIS_DMP_FOOTER_SZ, JEVOIS_DMP_FSYNC, JEVOIS_DMP_FSYNC_SZ, JEVOIS_DMP_GEOMAG, JEVOIS_DMP_GEOMAG_DATA_SZ, JEVOIS_DMP_GYRO, JEVOIS_DMP_GYRO_ACCURACY, JEVOIS_DMP_GYRO_ACCURACY_SZ, JEVOIS_DMP_GYRO_BIAS_DATA_SZ, JEVOIS_DMP_GYRO_CALIBR, JEVOIS_DMP_GYRO_DATA_SZ, JEVOIS_DMP_HEADER2, JEVOIS_DMP_HEADER2_SZ, JEVOIS_DMP_HEADER_SZ, JEVOIS_DMP_PED_STEPDET, JEVOIS_DMP_PED_STEPDET_TIMESTAMP_SZ, JEVOIS_DMP_PED_STEPIND, JEVOIS_DMP_PRESSURE, JEVOIS_DMP_PRESSURE_DATA_SZ, JEVOIS_DMP_QUAT6, JEVOIS_DMP_QUAT6_DATA_SZ, JEVOIS_DMP_QUAT9, JEVOIS_DMP_QUAT9_DATA_SZ, LERROR, odrcnt, pickup, quat6, quat9, quat9acc, steps, and stepts.
Referenced by jevois::ICM20948::getDMP().
short jevois::DMPdata::accel[3] |
Raw accelerometer data (when JEVOIS_DMP_ACCEL in header1)
Definition at line 137 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::accelacc |
Accelerometer accuracy data (when JEVOIS_DMP_ACCEL_ACCURACY in header2)
Definition at line 155 of file IMUdata.H.
Referenced by parsePacket().
unsigned short jevois::DMPdata::bacstate |
Activity recognition state (when JEVOIS_DMP_ACT_RECOG in header2)
Definition at line 164 of file IMUdata.H.
Referenced by parsePacket().
long jevois::DMPdata::bacts |
Activity recognition timestamp (when JEVOIS_DMP_ACT_RECOG in header2)
Definition at line 165 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::cpass[3] |
Raw compass data (when JEVOIS_DMP_CPASS in header1)
Definition at line 139 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::cpassacc |
Compass accuracy data (when JEVOIS_DMP_CPASS_ACCURACY in header2)
Definition at line 157 of file IMUdata.H.
Referenced by parsePacket().
long jevois::DMPdata::cpasscal[3] |
Compass calibration data (when JEVOIS_DMP_CPASS_CALIBR in header1)
Definition at line 153 of file IMUdata.H.
Referenced by parsePacket().
unsigned short jevois::DMPdata::fsync |
Delay between FSYNC received from camera and first subsequent IMU data generated.
Definition at line 159 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::gbias[3] |
Raw gyro bias data (when JEVOIS_DMP_GYRO in header1)
Definition at line 140 of file IMUdata.H.
Referenced by parsePacket().
long jevois::DMPdata::geomag[3] |
Geomag data (when JEVOIS_DMP_GEOMAG in header1)
Definition at line 149 of file IMUdata.H.
Referenced by parsePacket().
long jevois::DMPdata::geomagacc |
Geomag accuracy (when JEVOIS_DMP_GEOMAG in header1)
Definition at line 150 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::gyro[3] |
Raw gyro data (when JEVOIS_DMP_GYRO in header1)
Definition at line 138 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::gyroacc |
Gyro accuracy data (when JEVOIS_DMP_GYRO_ACCURACY in header2)
Definition at line 156 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::gyrobias[3] |
Gyro bias/calibration data (when JEVOIS_DMP_GYRO_CALIBR in header1)
Definition at line 152 of file IMUdata.H.
Referenced by parsePacket().
unsigned short jevois::DMPdata::header1 |
Header 1 fields that indicate what data is valid.
Definition at line 134 of file IMUdata.H.
Referenced by parsePacket().
unsigned short jevois::DMPdata::header2 |
Header 2 fields that indicate what data is valid.
Definition at line 135 of file IMUdata.H.
Referenced by parsePacket().
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 167 of file IMUdata.H.
Referenced by parsePacket().
short jevois::DMPdata::pickup |
Flip/pickup detection (when JEVOIS_DMP_FLIP_PICKUP in header2)
Definition at line 162 of file IMUdata.H.
Referenced by parsePacket().
long jevois::DMPdata::quat6[3] |
Quaternion6 data (when JEVOIS_DMP_QUAT6 in header1)
Definition at line 142 of file IMUdata.H.
Referenced by parsePacket().
long jevois::DMPdata::quat9[3] |
Quaternion9 data (when JEVOIS_DMP_QUAT9 in header1)
Definition at line 143 of file IMUdata.H.
Referenced by parsePacket().
long jevois::DMPdata::quat9acc |
Quaternion9 accuracy (when JEVOIS_DMP_QUAT9 in header1)
Definition at line 144 of file IMUdata.H.
Referenced by parsePacket().
unsigned short jevois::DMPdata::steps |
Number of steps (0..7) detected this cycle (when JEVOIS_DMP_PED_STEPDET)
Definition at line 147 of file IMUdata.H.
Referenced by parsePacket().
unsigned long jevois::DMPdata::stepts |
Step detection timestamp (when JEVOIS_DMP_PED_STEPDET)
Definition at line 146 of file IMUdata.H.
Referenced by parsePacket().