高级会员
- 积分
- 513
- 金钱
- 513
- 注册时间
- 2016-3-16
- 在线时间
- 166 小时
|
楼主 |
发表于 2016-3-16 17:01:50
|
显示全部楼层
忘了说还有,我调用了应美盛的motion_driver_6.12的dmp库,但是得到的yaw角还是有漂移,平均四分钟漂一度,pitch和roll都很稳定,请问是不是在配置dmp库中有什么问题呢?
配置如下:[mw_shl_code=c,true]bool MPU9150_Conf(void)
{
int result=0;
result=mpu_init();
if(!result)
{
#if defined MPU6050 || defined MPU6500
result = mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL); //mpu_set_sensor
result |= mpu_configure_fifo(INV_XYZ_GYRO | INV_XYZ_ACCEL); //mpu_configure_fifo
#elif defined MPU9150 || defined MPU9250
result = mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL | INV_XYZ_COMPASS);
result |= mpu_configure_fifo(INV_XYZ_GYRO | INV_XYZ_ACCEL | INV_XYZ_COMPASS);
#endif
result |= mpu_set_sample_rate(DEFAULT_MPU_HZ); //mpu_set_sample_rate
result |= dmp_load_motion_driver_firmware(); //dmp_load_motion_driver_firmvare
result |= dmp_set_orientation(inv_orientation_matrix_to_scalar(gyro_orientation));
//dmp_set_orientation
result |= dmp_enable_feature(DMP_FEATURE_6X_LP_QUAT | DMP_FEATURE_TAP |
DMP_FEATURE_ANDROID_ORIENT | DMP_FEATURE_SEND_RAW_ACCEL | DMP_FEATURE_SEND_CAL_GYRO |
DMP_FEATURE_GYRO_CAL); //dmp_enable_feature
result |= dmp_set_fifo_rate(DEFAULT_MPU_HZ); //dmp_set_fifo_rate
run_self_test(); //run_self_test
result |= mpu_set_dmp_state(1);
}
return result;
}[/mw_shl_code] |
|