使用加速度计+陀螺仪的汽车小模型位置计算

编程入门 行业动态 更新时间:2024-10-26 06:27:05
本文介绍了使用加速度计+陀螺仪的汽车小模型位置计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

以上公式基于本文档: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.

更多推荐

使用加速度计+陀螺仪的汽车小模型位置计算

本文发布于:2023-10-08 02:02:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1471190.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加速度计   陀螺仪   模型   位置   汽车

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!