- MPU9255
- MPU9250
- MPU6886
- MPU6515
- MPU6500
- MPU6050
- ICM20689
- ICM20690
- BMI055
- BMX055 (Magnetometer currently untested)
- BMI160
- LSM6DS3 (And some of it's variants)
- LSM6DSL (currently untested)
- QMI8658
Supported Magnetometers:
- QMC5883L
- HMC5883L
- AK8975
Supported IMU + Mag Stacking combos (All of them expect IMU address for initialization):
-
MPU6515 + QMC5883L (uses type MPU6515_QMC5883L)
-
MPU6500 + QMC5883L (uses type MPU6500_QMC5883L)
-
MPU6050 + QMC5883L (uses type MPU6050_QMC5883L)
-
ICM20689 + QMC5883L (uses type ICM20689_QMC5883L)
-
ICM20690 + QMC5883L (uses type ICM20690_QMC5883L)
-
BMI055 + QMC5883L (uses type BMI055_QMC5883L)
-
BMI160 + QMC5883L (uses type BMI160_QMC5883L)
-
LSM6DS3 + QMC5883L (uses type LSM6DS3_QMC5883L)
-
LSM6DSL + QMC5883L (uses type LSM6DSL_QMC5883L)
-
QMI8658 + QMC5883L (uses type QMI8658_QMC5883L)
-
MPU6515 + HMC5883L (uses type MPU6515_HMC5883L)
-
MPU6500 + HMC5883L (uses type MPU6500_HMC5883L)
-
MPU6050 + HMC5883L (uses type MPU6050_HMC5883L)
-
ICM20689 + HMC5883L (uses type ICM20689_HMC5883L)
-
ICM20690 + HMC5883L (uses type ICM20690_HMC5883L)
-
BMI055 + HMC5883L (uses type BMI055_HMC5883L)
-
BMI160 + HMC5883L (uses type BMI160_HMC5883L)
-
LSM6DS3 + HMC5883L (uses type LSM6DS3_HMC5883L)
-
LSM6DSL + HMC5883L (uses type LSM6DSL_HMC5883L)
-
QMI8658 + HMC5883L (uses type QMI8658_HMC5883L)
-
MPU6515 + AK8975 (uses type MPU6515_AK8975)
-
MPU6500 + AK8975 (uses type MPU6500_AK8975)
-
MPU6050 + AK8975 (uses type MPU6050_AK8975)
-
ICM20689 + AK8975 (uses type ICM20689_AK8975)
-
ICM20690 + AK8975 (uses type ICM20690_AK8975)
-
BMI055 + AK8975 (uses type BMI055_AK8975)
-
BMI160 + AK8975 (uses type BMI160_AK8975)
-
LSM6DS3 + AK8975 (uses type LSM6DS3_AK8975)
-
LSM6DSL + AK8975 (uses type LSM6DSL_AK8975)
-
QMI8658 + AK8975 (uses type QMI8658_AK8975)
Planned:
- BNO080 (probably soonish)
- GY-85
- BMM150
- BNO055 (the one I bought is DOA... might take a bit)
- ICM20948
- BMI270 (if I can get my hands on one)
-
AccelData
Contains all three axis of Accelerometer data, these are namedaccelX
,accelY
andaccelZ
-
GyroData
Contains all three axis of Gyroscope data, these are namedgyroX
,gyroY
andgyroZ
-
MagData
Contains all three axis of Magnetometer data, these are namedmagX
,magY
andmagZ
-
Quaternion
Contains Quaternion data, the components are namedqW
,qX
,qY
andqZ
-
CalData
Contains a boolean component namedvalid
that must be set totrue
if the data is valid, it contains float array namedaccelBias
for accelerometer biases, one namedgyroBias
for gyroscope bias, one namedmagBias
for magnetometer biases and one namedmagScale
for magnetometer scaling.
-
init
Takes in acalData
function and abyte
address, this function initializes the IMU, it defaults to the maximum ranges allowed by the IMU. This function will return a 0 if initialization was successful and a negative number if it failed to connect to the IMU. -
update
Reads new IMU data if available. -
getAccel
Takes in a pointer toAccelData
and copies new accelerometer data to it, should be called after update. -
getGyro
Takes in a pointer toGyroData
and copies new gyroscope data to it, should be called after update. -
getMag
Takes in a pointer toMagData
and copies new magnetometer data to it, should be called after update. Will only return new magnetometer data if the IMU has a magnetometer. -
getQuat
Takes in a pointer to aQuaternion
and copies new quaternion data to it, should be called after update. Will only return new Quaternion data if the IMU has a Quaternion output. -
getTemp
Returns temperature float data in °C, should be called after update, isn't very accurate. -
setGyroRange
Takes in an integer with the dps range wanted, (for example 2000 for ±2000dps), returns 0 if successful, returns -1 if the input range is not valid. -
setAccelRange
Takes in an integer with the dps range wanted, (for example 8 for ±8g), returns 0 if successful, returns -1 if the input range is not valid. -
setIMUGeometry
Takes in an integer with the wanted geometry index, rotates IMU measurements to match vr headset IMU mount. (see chart below). -
calibrateAccelGyro
Takes in a pointer to calibration data and runs a Accelerometer and Gyroscope calibration, storing the new accelerometer and gyroscope calibration data in it. the IMU should be kept completely still and level during this. -
calibrateMag
Takes in a pointer to Calibration data and runs a Accelerometer and Gyroscope calibration, storing the new accelerometer and gyroscope calibration data in it. the IMU should be moved in a figure eight pattern while calibrating, calibration takes around 15 seconds. -
hasMagnetometer
Returns true if the IMU has a magnetometer. -
hasTemperature
Returns true if the IMU has a thermometer. -
hasQuatOutput
Returns true if the IMU has a direct quaternion output. -
IMUName
Returns a string containing the IMU's name. -
IMUType
Returns a string containing the IMU's type. -
IMUManufacturer
Returns a string containing the IMU's manufacturer.