简体   繁体   English

如何使用加速度计找到沿x轴的线性加速度

[英]How to find Linear acceleration along x-axis using accelerometer

I am currently working on an android app in which I want to get acceleration along only x-axis. 我目前正在开发一个Android应用,该应用中我仅想沿x轴获得加速度。 There are some confusions in mind which I want to clear. 我想清除一些困惑。

  1. First confusion is regarding the output of accelerometer's x-axis data. 第一个困惑是关于加速度计x轴数据的输出。 Is it the acceleration or the velocity. 是加速度还是速度。 (Pardon me on bad physics concepts) . (请原谅我不好的物理概念)
  2. Second confusion is that when I get the isolated reading of x-axis I get a change when phone tilts. 第二个困惑是,当我得到x轴的孤立读数时,当手机倾斜时会发生变化。 I don't want that. 我不要 I want the reading only when I move the phone horizontally. 我只在水平移动手机时才需要阅读。
  3. Third problem is that I want to get the speed of phone's movement along x-axis by using above data. 第三个问题是我想通过使用上述数据来获得手机沿x轴移动的速度。 Is it possible? 可能吗?

I still doesn't know whether any of above is possible or not. 我仍然不知道以上任何一种方法是否可行。 Kindly enlighten me if it is? 请给我个启发吗?

It might be possible if your requirements allow for drift... 如果您的要求允许漂移,则有可能...

  1. The accelerometer outputs acceleration. 加速度计输出加速度。
  2. Are you certain your not moving it at all in the x-axis direction during rotation? 您确定旋转过程中根本不沿x轴移动它吗? Also you may be seeing gravity come into play if the rotation aligns the X-axis with gravity's pull. 另外,如果旋转将X轴与重力的拉力对齐,您可能会发现重力起作用。 You will need to filter this out. 您将需要过滤掉它。
  3. Your primary issue with this one will be that accelerometer data is very noisy and due to the double integral you will need to do to get the distance traveled (or even the single integral to get the velocity) you will experience drift.. If your requirements are tolerant of drift, then it can definitely work. 与此相关的主要问题是,加速度计数据非常嘈杂,由于需要双重积分才能获得行进的距离(甚至需要获得单个积分才能获得速度),所以您会遇到漂移。容忍漂移,那么它肯定可以工作。

Edit: Place to start: https://developer.android.com/guide/topics/sensors/sensors_overview.html 编辑:开始的地方: https//developer.android.com/guide/topics/sensors/sensors_overview.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在使用ObjectAnimator时沿x轴移动按钮 - How to move a button along x-axis while using ObjectAnimator X轴上的android加速度计 - android Accelerometer on X-Axis 如何使用Android中的AcceleroMeter正确计算线性加速度 - How to properly calculate linear acceleration using AcceleroMeter in Android 如何使用传感器加速度计数据沿X轴和Y轴移动ImageView - How to move an ImageView along X and Y axis with Sensor Accelerometer Data 加速度计,重力和线性加速度查询 - Accelerometer, Gravity and Linear Acceleration Query 当X轴发生变化时,Android加速度计会发出提示音 - Android accelerometer plays a beep when x-axis changes 如何使用 MP 图表获取选定的条形 x 轴名称(字符串添加到 x 轴)? - How to get selected bar x-axis name(Strings added to x-axis) using MP Chart? 如何沿X轴移动独立于Sprite的设备(libgdx) - How to move a sprite device-independent along the x-axis (libgdx) 如何使用AChartEngine动态线图和X轴自动平移(滚动)? - How to do auto Pan (scrolling) with AChartEngine dynamic line graph along with X-axis? AndroidPlot - 使图表可以与x轴标签一起滚动 - AndroidPlot - Make graph scrollable along with x-axis labels
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM