对采样得到的陀螺仪和加速度计数据通过DMP处理后得到姿态角(pitch,roll,yaw),然后存入FIFO中,这个过程在你初始化完DMP后就会不受人为控制的持续进行,那么如果你不及时读取FIFO的数据,FIFO数据很快就会溢出,那么就会出现以上的问题啦!
问题出在移植的DMP库里面 在走mpu_dmp_get_data()的时候,里面有个mpu_read_fifo_stream()函数,里面有个if语句是这样的if (fifo_count > (st.hw->max_fifo >> 1)) { ...
使用MPU9250来学习姿态解算最近在使用MPU9250来学习姿态解算,查询了非常多的网上关于MPU6050和MPU9250的资料,发现内置的DMP可以计算出姿态角,可原代码是用在MSP430和STM407上的,手上有块F429的野火板子,移植过程越到非常多的巨坑,现在想记录下来给各位初学者提供一些便利。
if (mpu_read_fifo_stream(dmp.packet_length, fifo_data, more)) return -1; if (dmp.feature_mask & (DMP_FEATURE_LP_QUAT | DMP_FEATURE_6X_LP_QUAT)) { #ifdef FIFO_CORRUPTION_CHECK long quat_q14[4], quat_mag_sq; #endif quat[0] = ((long)fifo_data[0] << 24) | ((long)fifo_...
追踪进去显示在函数mpu_read_fifo_stream(unsigned short length, unsigned char *data, unsigned char *...
int mpu_read_fifo(short *gyro, short *accel, unsigned long *timestamp, unsigned char *sensors, unsigned char *more); int mpu_read_fifo_stream(unsigned short length, unsigned char *data, unsigned char *more); int mpu_reset_fifo(void); int mpu_write_mem(unsigne...
37、s or devices which are sensitive to multiple accesses (such as FIFOs, LCD controller). Or it may disturb the traffic generated by another masters such as LCD-TFT or DMA2D with higher bandwidth consumption when a speculative prefetch happens. In order to protect normal memories from a spec...
(MPU-6050 only) Smallest and thinnest QFN package for portable devices: 4x4x0.9mm Minimal cross-axis sensitivity between the accelerometer and gyroscope axes 1024 byte FIFO buffer reduces power consumption by allowing host processor to read the data in bursts and then go into a low-power mode ...
This propagation may force a premature DMA stream request or create a series of initial interrupt services (if enabled in the configuration). Even a system without any FIFO could raise two consequent data requests when SPI is enabled and data is released from the buffer o...
readFIFOToEnd(); } } Expand Down Expand Up @@ -319,7 +320,6 @@ void ICM20948Sensor::startMotionLoop() { lastData = millis(); working = true; hadData = true; } void ICM20948Sensor::checkSensorTimeout() Expand Down 7 changes: 5 additions & 2 deletions 7 src/sensors/icm20948sens...