新手上路
- 积分
- 47
- 金钱
- 47
- 注册时间
- 2017-12-12
- 在线时间
- 12 小时
|
5金钱
使用了DMP motion Driver5.12 和6.12版本 在6050DMP固件里面校准 对偏差寄存器都能读写,但是校准之后通过DMP读FIFI出来的值还是没校准过的存在偏差。主要是下面这个代码:
void run_self_test(void)
{
char temp_result=0x00;
char test_packet[4] = {0};
long gyro[3], accel[3];
unsigned char i = 0;
unsigned short accel_sens;
float gyro_sens;
temp_result = mpu_run_self_test(gyro, accel);
if(1)
{
for(i = 0; i<3; i++)
{
gyro[i] = (long)(gyro[i] * 32.8f); //convert to +-1000dps
accel[i] *=2048.f; //convert to +-16G
accel[i] = accel[i]<<16;
gyro[i] = (long)(gyro[i]<<16);
}
mpu_set_gyro_bias_reg(gyro);
mpu_set_accel_bias_6050_reg(accel);
}
// mpu_get_accel_sens(&accel_sens);
// accel[0] *= accel_sens;
// accel[1] *= accel_sens;
// accel[2] *= accel_sens;
// inv_set_accel_bias(accel, 3);
// mpu_get_gyro_sens(&gyro_sens);
// gyro[0] = (long) (gyro[0] * gyro_sens);
// gyro[1] = (long) (gyro[1] * gyro_sens);
// gyro[2] = (long) (gyro[2] * gyro_sens);
// inv_set_gyro_bias(gyro, 3);
}
有没有弄过DMP校准的同学,校准之后DMP读出来的数据是已经减去过零偏的。6050也换过,好像不行。
|
|