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

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

问题描述

我希望计算一辆小型遥控车的位置(相对于起始位置).汽车在平坦的表面上移动,例如:房间地板. 现在,我正在使用加速度计和陀螺仪.确切地说,此公告板-> 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

The above formulae are based on this document: 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天全站免登陆