问题描述
我有一块带有 mpu6050 的 stm32 板。从 mpu6050 读取的数据涉及计算运动学,我不确定它是什么。 下面的代码是github上找到的stm32的mpu6050的驱动https://github.com/suhetao/stm32f4_mpu9250/blob/master/Libraries/eMPL/inv_mpu.c
/**
* @brief Get one packet from the FIFO.
* If @e sensors does not contain a particular sensor,disregard the data
* returned to that pointer.
* \n @e sensors can contain a combination of the following flags:
* \n INV_X_GYRO,INV_Y_GYRO,INV_Z_GYRO
* \n INV_XYZ_GYRO
* \n INV_XYZ_ACCEL
* \n If the FIFO has no new data,@e sensors will be zero.
* \n If the FIFO is disabled,@e sensors will be zero and this function will
* return a non-zero error code.
* @param[out] gyro Gyro data in hardware units.
* @param[out] accel Accel data in hardware units.
* @param[out] timestamp Timestamp in milliseconds.
* @param[out] sensors Mask of sensors read from FIFO.
* @param[out] more Number of remaining packets.
* @return 0 if successful.
*/
int mpu_read_fifo(short *gyro,short *accel,unsigned long *timestamp,unsigned char *sensors,unsigned char *more)
据说gyro[]是以硬件为单位的陀螺数据。这是什么意思或什么是 gryo 数据?是 RPY 还是类似的东西?
后来让我困惑的是这段代码是通过这种方式计算运动学的
Gyro_K = 0.004; // Ratio of Gyro
w1 = Vx + L*Vz + gyro[2] * Gyro_K;
w2 = -(Vx - L*Vz + gyro[2] * Gyro_K);
这是一个差动驱动模型。 w1 和 w2 是两个车轮的速度。在这种情况下,陀螺仪 [2] 的含义对于理解这种运动学非常重要。任何人都可以提供一点帮助。谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)