方向传感器和加速度传感器之间的区别
我想了解设备任何位置/移动的 X、Y 和 Z 轴的值,以便我可以将这些值用于进一步的工作。正如我搜索的那样,有两种方法:方向传感器(给出角度值,如方位角、俯仰角和滚动角)和加速度计(给出 x、y 和 z 1 到 10 之间的值)。
根据我的理解,两者对于我的要求是相同的。我找不到他们之间的区别。请任何人都能详细地向我解释我的目标。我应该使用哪个传感器?
I want to know about the values of X,Y and Z axis for any position/movement of device so I can use these values for my further work. As I searched there are two methods, Orientation Sensor(gives value in degree,as azimuth,pitch and roll) and Accelerometer(gives values between 1 to 10 for x,y and z).
As per my understanding both are same for my requirement. I can't find difference between them. Please can any one clear me about them in detail w.r.t my aim. which sensor should I use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
两者之间存在差异:
加速度计检测空间加速度。之所以总是检测到向下9.8m/s^2的加速度,是因为重力相当于空间中的加速度。
方向检测设备的轴是否偏离现实世界;它检测与磁北的倾斜度和角度。请注意,此传感器已弃用,Google 建议您使用加速计和磁力计来计算方向。
There are differences between both:
Accelerometer detects acceleration in space. The reason why it will always detect an acceleration of 9.8m/s^2 downwards is because gravity is equivalent to acceleration in space.
Orientation detects if your device's axis are rotated from the real-world; it detects tilts and and degrees from the magnetic North. Please note that this sensor is deprecated and Google recommends you use the accelerometer and magnetometer to calculate orientation.
您需要加速度计来检测运动。所以你应该使用这个,因为你的目标是了解这个动作。
方向传感器提供有关其相对于参考平面的位置的信息。所以你可以用它来查看设备是否倾斜、颠倒或类似的情况。
You'll need the accelerometer to detect movement. So you should use this one, since your aim is to know this movement.
The orientation sensor gives information about its position compared to a reference plane. So you could use this to see of the device is tilted, upside down or something like that.
当我们将手机倾斜到不同位置时,加速度计显示固定值。因此,很难依靠该传感器来检查速度/运动峰值。因为手机倾斜和手机移动的 x、y、z 读数相同。我们怎样才能区分读数呢?
Accelerometer shows fixed value when we tilt the phone in different position. So, it is difficult to depend this sensor to check the speed/movement-spikes. Because, same x,y,z reading for phone tilt and phone movement. How can we differentiate the readings?