ankit.vadict
Member
Hi,
I am knowing that cal array value from 6th index to 15th index for magnetometer calibration and this value we can get from the MotionCal.exe. For 0th index to 5th index value are filling zero value from the MotionCal.exe. Those index getting zero values are for Accelerometer and Gyroscope.
As per my thought this 0th to 5th index values are for offset of Accelerometer and Gyroscope. Is there any way to get these offset values for Accelerometer and Gyroscope?
I want to know that, is it required to calibrate the Accelerometer and Gyroscope? If it required than, which way get the offset values?
Appreciate if any input will be there related to topic.
Thanks,
Ankit
Code:
void readMotionSensor(float& ax, float& ay, float& az, float& gx, float& gy, float& gz, float& mx, float& my, float& mz)
{
if (!newdata) update();
newdata = 0;
ax = (float)accel_mag_raw[0] * G_PER_COUNT - cal[0];
ay = (float)accel_mag_raw[1] * G_PER_COUNT - cal[1];
az = (float)accel_mag_raw[2] * G_PER_COUNT - cal[2];
gx = (float)gyro_raw[0] * DEG_PER_SEC_PER_COUNT - cal[3];
gy = (float)gyro_raw[1] * DEG_PER_SEC_PER_COUNT - cal[4];
gz = (float)gyro_raw[2] * DEG_PER_SEC_PER_COUNT - cal[5];
float x = (float)accel_mag_raw[3] * UT_PER_COUNT - cal[6];
float y = (float)accel_mag_raw[4] * UT_PER_COUNT - cal[7];
float z = (float)accel_mag_raw[5] * UT_PER_COUNT - cal[8];
mx = x * cal[10] + y * cal[13] + z * cal[14];
my = x * cal[13] + y * cal[11] + z * cal[15];
mz = x * cal[14] + y * cal[15] + z * cal[12];
}
As per my thought this 0th to 5th index values are for offset of Accelerometer and Gyroscope. Is there any way to get these offset values for Accelerometer and Gyroscope?
I want to know that, is it required to calibrate the Accelerometer and Gyroscope? If it required than, which way get the offset values?
Appreciate if any input will be there related to topic.
Thanks,
Ankit