mpu6050 报错fifo overflow解决办法

    最近ros计划介入imu消息,使用arduino 接口mpu6050,再通过串口介入ros。使用的是https://github.com/fsteinhardt/mpu6050_serial_to_imu中的开源代码。调试的时候一切都很顺利,但后来发现过一段时间就不发消息利,arduino程序报fifo overflow,后续卡死;找到的解决方法是;将arduino库中的头文件MPU6050_6Axis_MotionApps20.h中305行最后一个数字变大

   0x02,   0x16,   0x02,   0x00, 0x07               //(0x07 -> 16Mhz) D_0_22 inv_set_fifo_rate (0x06 for first 8mhz board) (0x09 for 8Mhz board from Binoy)

    // This very last 0x01 WAS a 0x09, which drops the FIFO rate down to 20 Hz. 0x07 is 25 Hz,
    // 0x01 is 100Hz. Going faster than 100Hz (0x00=200Hz) tends to result in very noisy data.
    // DMP output frequency is calculated easily using this equation: (200Hz / (1 + value))

    // It is important to make sure the host processor can keep up with reading and processing
    // the FIFO output at the desired rate. Handling FIFO overflow cleanly is also a good idea.

这个数字关系到ros平台imu topic 的频率,根据硬件性能,设置相应的数值即可,测试不报错就可以啦。


评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值