Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/F_AK8963.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int AK8963::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
calibration.magScale[0] = 1.f;
calibration.magScale[1] = 1.f;
calibration.magScale[2] = 1.f;
Expand Down Expand Up @@ -183,4 +183,4 @@ void AK8963::calibrateMag(calData* cal)
cal->magScale[0] = avg_rad / ((float)mag_scale[0]);
cal->magScale[1] = avg_rad / ((float)mag_scale[1]);
cal->magScale[2] = avg_rad / ((float)mag_scale[2]);
}
}
4 changes: 2 additions & 2 deletions src/F_AK8963.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class AK8963 : public IMUBase {

int geometryIndex = 0;
float temperature = 0.f;
MagData mag = { 0 };
MagData mag = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down Expand Up @@ -113,7 +113,7 @@ class AK8963 : public IMUBase {
} // Put read results in the Rx buffer
}

float factoryMagCal[3] = { 0 };
float factoryMagCal[3] = { 0, 0, 0 };

bool dataAvailable(){ return (readByte(AK8963_ADDRESS, AK8963_ST1) & 0x01);}
};
Expand Down
4 changes: 2 additions & 2 deletions src/F_AK8975.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int AK8975::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
calibration.magScale[0] = 1.f;
calibration.magScale[1] = 1.f;
calibration.magScale[2] = 1.f;
Expand Down Expand Up @@ -192,4 +192,4 @@ void AK8975::calibrateMag(calData* cal)
cal->magScale[0] = avg_rad / ((float)mag_scale[0]);
cal->magScale[1] = avg_rad / ((float)mag_scale[1]);
cal->magScale[2] = avg_rad / ((float)mag_scale[2]);
}
}
4 changes: 2 additions & 2 deletions src/F_AK8975.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class AK8975 : public IMUBase {

int geometryIndex = 0;
float temperature = 0.f;
MagData mag = { 0 };
MagData mag = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down Expand Up @@ -113,7 +113,7 @@ class AK8975 : public IMUBase {
} // Put read results in the Rx buffer
}

float factoryMagCal[3] = { 0 };
float factoryMagCal[3] = { 0, 0, 0 };

bool dataAvailable()
{
Expand Down
4 changes: 2 additions & 2 deletions src/F_BMI055.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int BMI055::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -304,4 +304,4 @@ void BMI055::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1];
cal->gyroBias[2] = (float)gyro_bias[2];
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_BMI055.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class BMI055 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;

Expand Down
4 changes: 2 additions & 2 deletions src/F_BMI160.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int BMI160::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -277,4 +277,4 @@ void BMI160::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1];
cal->gyroBias[2] = (float)gyro_bias[2];
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_BMI160.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ class BMI160 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
8 changes: 2 additions & 6 deletions src/F_BMX055.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int BMX055::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
calibration.magScale[0] = 1.f;
calibration.magScale[1] = 1.f;
calibration.magScale[2] = 1.f;
Expand Down Expand Up @@ -356,17 +356,13 @@ void BMX055::calibrateMag(calData* cal)
{
int16_t MagCount[3];
uint8_t rawDataMag[6];
float magReading[3];

readBytes(MagAddress, BMX055_MAG_X_LSB, 6, &rawDataMag[0]); // Read the 6 raw magnetometer data registers into data array

MagCount[0] = ((rawDataMag[1] << 8) | (rawDataMag[0] & 0xF8)) >> 3; // Turn the MSB and LSB into a signed 13-bit value
MagCount[1] = ((rawDataMag[3] << 8) | (rawDataMag[2] & 0xF8)) >> 3;
MagCount[2] = ((rawDataMag[5] << 8) | (rawDataMag[4] & 0xFE)) >> 1; // Turn the MSB and LSB into a signed 15-bit value

magReading[1] = (float)(MagCount[0] * mResXY);
magReading[2] = (float)(MagCount[1] * mResXY);
magReading[3] = (float)(MagCount[2] * mResZ);

for (int jj = 0; jj < 3; jj++)
{
Expand Down Expand Up @@ -396,4 +392,4 @@ void BMX055::calibrateMag(calData* cal)
cal->magScale[0] = avg_rad / ((float)mag_scale[0]);
cal->magScale[1] = avg_rad / ((float)mag_scale[1]);
cal->magScale[2] = avg_rad / ((float)mag_scale[2]);
}
}
6 changes: 3 additions & 3 deletions src/F_BMX055.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ class BMX055 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
MagData mag = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };
MagData mag = { 0, 0, 0 };

calData calibration;

Expand Down
4 changes: 2 additions & 2 deletions src/F_HMC5883L.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int HMC5883L::init(calData cal, uint8_t address)
//load cal
if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
calibration.magScale[0] = 1.f;
calibration.magScale[1] = 1.f;
calibration.magScale[2] = 1.f;
Expand Down Expand Up @@ -170,4 +170,4 @@ void HMC5883L::calibrateMag(calData* cal)
cal->magScale[0] = avg_rad / ((float)mag_scale[0]);
cal->magScale[1] = avg_rad / ((float)mag_scale[1]);
cal->magScale[2] = avg_rad / ((float)mag_scale[2]);
}
}
2 changes: 1 addition & 1 deletion src/F_HMC5883L.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class HMC5883L : public IMUBase {
private:
float mRes = 10. * 819.2f / 2048.f; //mRes value for full range (+-819.2uT scaled * 10) readings (12 bit)
int geometryIndex = 0;
MagData mag = { 0 };
MagData mag = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
4 changes: 2 additions & 2 deletions src/F_ICM20689.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int ICM20689::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -324,4 +324,4 @@ void ICM20689::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1] / (float)gyrosensitivity;
cal->gyroBias[2] = (float)gyro_bias[2] / (float)gyrosensitivity;
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_ICM20689.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class ICM20689 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
4 changes: 2 additions & 2 deletions src/F_ICM20690.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int ICM20690::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -324,4 +324,4 @@ void ICM20690::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1] / (float)gyrosensitivity;
cal->gyroBias[2] = (float)gyro_bias[2] / (float)gyrosensitivity;
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_ICM20690.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ class ICM20690 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
4 changes: 2 additions & 2 deletions src/F_IMU_Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int IMU_Generic::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
calibration.magScale[0] = 1.f;
calibration.magScale[1] = 1.f;
calibration.magScale[2] = 1.f;
Expand Down Expand Up @@ -474,4 +474,4 @@ void IMU_Generic::calibrateMag(calData* cal)
cal->magScale[0] = avg_rad / ((float)mag_scale[0]);
cal->magScale[1] = avg_rad / ((float)mag_scale[1]);
cal->magScale[2] = avg_rad / ((float)mag_scale[2]);
}
}
8 changes: 4 additions & 4 deletions src/F_IMU_Generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ class IMU_Generic : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
MagData mag = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };
MagData mag = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down Expand Up @@ -246,7 +246,7 @@ class IMU_Generic : public IMUBase {
} // Put read results in the Rx buffer
}

float factoryMagCal[3] = { 0 };
float factoryMagCal[3] = { 0, 0, 0 };

bool dataAvailable(){ return (readByte(IMUAddress, IMU_Generic_INT_STATUS) & 0x01);}
};
Expand Down
4 changes: 2 additions & 2 deletions src/F_LSM6DS3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int LSM6DS3::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -257,4 +257,4 @@ void LSM6DS3::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1];
cal->gyroBias[2] = (float)gyro_bias[2];
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_LSM6DS3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ class LSM6DS3 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
4 changes: 2 additions & 2 deletions src/F_LSM6DSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int LSM6DSL::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -258,4 +258,4 @@ void LSM6DSL::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1];
cal->gyroBias[2] = (float)gyro_bias[2];
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_LSM6DSL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class LSM6DSL : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
4 changes: 2 additions & 2 deletions src/F_MPU6050.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int MPU6050::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -321,4 +321,4 @@ void MPU6050::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1] / (float)gyrosensitivity;
cal->gyroBias[2] = (float)gyro_bias[2] / (float)gyrosensitivity;
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_MPU6050.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class MPU6050 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
4 changes: 2 additions & 2 deletions src/F_MPU6500.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int MPU6500::init(calData cal, uint8_t address)

if (cal.valid == false)
{
calibration = { 0 };
calibration = {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}};
}
else
{
Expand Down Expand Up @@ -325,4 +325,4 @@ void MPU6500::calibrateAccelGyro(calData* cal)
cal->gyroBias[1] = (float)gyro_bias[1] / (float)gyrosensitivity;
cal->gyroBias[2] = (float)gyro_bias[2] / (float)gyrosensitivity;
cal->valid = true;
}
}
4 changes: 2 additions & 2 deletions src/F_MPU6500.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ class MPU6500 : public IMUBase {
int geometryIndex = 0;

float temperature = 0.f;
AccelData accel = { 0 };
GyroData gyro = { 0 };
AccelData accel = { 0, 0, 0 };
GyroData gyro = { 0, 0, 0 };

calData calibration;
uint8_t IMUAddress;
Expand Down
Loading