使用加速度计+陀螺仪的汽车小模型位置计算 [英] Position calculation of small model of a car using Accelerometer + Gyroscope

查看:111
本文介绍了使用加速度计+陀螺仪的汽车小模型位置计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想计算一个小型遥控车的位置(相对于起始位置).汽车在平坦的表面上移动,例如:房间地板.现在,我正在使用加速度计和陀螺仪.准确地说是这个板 --> http://www.sparkfun.com/products/9623

I wish to calculate position of a small remote controlled car (relative to starting position). The car moves on a flat surface for example: a room floor. Now, I am using an accelerometer and a gyroscope. To be precise this board --> http://www.sparkfun.com/products/9623

作为第一步,我只是在 x 和 y 轴上获取了加速度计数据(因为汽车在表面上移动),然后对数据进行双重积分以获得位置.我使用的公式是:

As a first step I just took the accelerometer data in x and y axes (since car moves on a surface) and double integrated the data to get position. The formulae I used were:

vel_new = vel_old + ( acc_old + ( (acc_new - acc_old ) / 2.0 ) ) * SAMPLING_TIME;
pos_new = pos_old + ( vel_old + ( (vel_new - vel_old ) / 2.0 ) ) * SAMPLING_TIME;
vel_old = vel_new;
pos_old = pos_new;
acc_new = measured value from accelerometer

以上公式基于本文档:http://perso-etis.ensea.fr/~pierandr/cours/M1_SIC/AN3397.pdf

然而,这是一个可怕的错误.

However this is giving horrible error.

阅读本论坛上的其他类似问题后,我发现我需要以某种方式使用陀螺仪从上述加速度值中减去重力分量(每次来自acc_new).这个想法在 Google Tech Talks 视频中得到了很好的解释 Android 设备上的传感器融合:运动处理的革命 时间 23:49.

After reading other similar questions on this forum, I found out that I need to subtract the component of Gravity from above acceleration values (everytime from acc_new) by using gyroscope somehow. This idea is very well explained in Google Tech Talks video Sensor Fusion on Android Devices: A Revolution in Motion Processing at time 23:49.

现在我的问题是如何减去那个重力分量?我从陀螺仪获得角速度.如何将其转换为加速度,以便从加速度计的输出中减去它?

Now my problem is how to subtract that gravity component? I get angular velocity from gyroscope. How do I convert it into acceleration so that I can subtract it from the output of accelerometer?

推荐答案

不行,这些传感器是不够准确,无法计算位置.

It won't work, these sensors are not accurate enough to calculate the position.

原因也在您所指的视频中进行了说明.

The reason is also explained in the video you are referring to.

您能做的最好的事情就是根据车轮的转速获得速度.如果您还知道属于速度的航向,则可以对速度进行积分以获得位置.远非完美,但它应该可以为您提供对位置的合理估计.

The best you could do is to get the velocity based on the rpm of the wheels. If you also know the heading that belongs to the velocity, you can integrate the velocity to get position. Far from perfect but it should give you a reasonable estimate of the position.

我不知道您如何获得汽车的航向,这取决于您拥有的硬件.

I do not know how you could get the heading of the car, it depends on the hardware you have.

这篇关于使用加速度计+陀螺仪的汽车小模型位置计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆