IMU 速度估计的代码示例
您是否知道在哪里可以找到根据 IMU(惯性测量单元、加速度计 + 陀螺仪 + 磁力计)数据进行速度估计的代码/示例?
我根据 IMU 静止的数据计算了偏差。我想用某种滤波器(卡尔曼/互补)实现速度估计,到目前为止找不到任何滤波器。
我还有相机速度估计,也许它可以作为某种融合提供帮助?
Do you maybe know where I can find code/example for velocity estimation from IMU (Inertial Measurement Unit, accelerometer + gyro + magnetometer) data?
I calculated biases from data where IMU stands still. I want to implement velocity estimation with some kind of filter (Kalman/Complementary), so far couldn't find any.
I also have camera velocity estimation, maybe it can help as some kind of fusion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有完全适合您的情况的示例代码。但这种方法可以帮助(基于过去的经验),
卡尔曼滤波器:
状态和控制输入:
数组
控制输入不必是发送到执行器的实际命令。
在这种情况下,控制输入可以是净力或净加速度,即
加速度计数据(即比力)+重力加速度
预测方程:
预测方程根据当前状态和控制输入预测下一个时间步的状态。
此MathWorks 文档为与 IMU 相关的预测方程提供了很好的参考。
观察/测量模型:
将测量与状态联系起来。
Accel 数据已用于预测。这里忽略它。
陀螺仪数据为 [gx, gy, gz] = [omega_x + gyro_bias_x, ....] + 错误
处理磁力计的一种方法是从中获取偏航角 - arctan(y/x),然后使用 yaw_mag 作为测量值。
相机数据为 [vx_cam, vy_cam, vz_cam] = [Vx, Vy, Vx] + 错误
最后追加所有行并将其转换为 Y=C*X + 噪声形式。
Y 表示来自不同传感器的测量值,X 表示状态。
在这种情况下,Y 将为 [gx, gy, gz, yaw_mag, vx,cam, vy_cam, vz_cam]。
免责声明:我是 MathWorks 员工,链接来自 MathWorks 文档。
I don't have an example code that exactly works for your case. But this approach can help (based on past experience),
Kalman filter:
States and Control inputs:
States could be a array containing
Control inputs need not be the actual commands that are being sent to your actuators.
In this case, control inputs can be the net force or net acceleration which is,
Accelerometer data (Which is specific force) + Acceleration due to gravity
Prediction equations:
Prediction equations predict the states for next time step based on current states and control inputs.
This MathWorks documentation has a good reference for prediction equations relevant to IMU.
Observation/measurement model:
Relates measurements with states.
Accel data is already used in prediction. Ignore it here.
Gyro data is [gx, gy, gz] = [omega_x + gyro_bias_x, ....] + errors
One way to handle magnetometer is to obtain yaw angle from it - arctan(y/x) and then use the yaw_mag as measurement.
Camera data is [vx_cam, vy_cam, vz_cam] = [Vx, Vy, Vx] + errors
Finally append all the rows and bring it to Y=C*X + noise form.
Y denotes the measurements from different sensors and X represents the states.
Y would be [gx, gy, gz, yaw_mag, vx,cam, vy_cam, vz_cam] in this case.
Disclaimer: I am a MathWorks employee and links are shared from MathWorks documentation.