IMU 测量的集成

问题描述

我有一个通过 SPI 接口与 Melopero LSM9DS1 惯性测量单元连接的 RaspBerry PI 4。 RaspBerry 控制两个电机(左/右)的运动,我想获取整合 IMU 测量值的姿态和速度信息。

IMU 驱动程序是一个重复的 python 脚本:

read N IMU samplings
compute the average of accelerometer,gyroscope,magnetometer
send the result with a timestamp to the process which integrates them.

整合策略如下:

imu_m1 = NULL
yaw,pitch,roll = 0,0
vx,vy,vz,= 0,0
while (true)   ​
   ​imu_msg = receive(...)
   ​if (NULL == imu_m1)
      ​imu_m1 = imu_msg
   ​else
      ​dt = imu_msg.timestamp_sec - imu_m1.timestamp_sec
      ​imu_m1 = imu_msg
      ​vx += dt * 
      ​imu_m1.accelerometer_x
      ​vy = //... The same strategy for each value vx,roll,yaw

为了简化,我假设:

  1. 重力都沿 Z 轴方向,所以我只是忽略 Z 轴的速度值;
  2. 残余测量噪声可以忽略不计。

此策略适用于姿态值,但至于速度,我在所有三个轴上得到的值都不可靠。 在制定这个策略时,我可能没有考虑到什么?它基本上是求解常微分方程的显式欧拉方法

​y(n+1) = y(n) + dt*f(t-1,y-1)

哪里

f(t-1,y-1) = imu_m1

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)