[英]why use accelerometer and magnetometer to get compass values
I found several examples and I know HOW to get the compass bearing using accelerometer and magnetometer. 我找到了几个例子,我知道如何使用加速度计和磁力计来获得罗盘轴承。 The problem is that i don't know WHY these two sensors should be used.
问题是我不知道为什么要使用这两个传感器。 can someone explain it to me?
有人可以向我解释一下吗? thanks
谢谢
The need for a magnetometer is pretty obvious. 对磁力计的需求非常明显。 What the compass (even a real one) shows as "north" is indeed the direction of magnetic field.
罗盘(即使是真实的)显示为“北”的确是磁场的方向。 Thus your Android needs to measure the magnetic field somehow in order to know in what direction to draw the arrow.
因此,你的Android需要以某种方式测量磁场,以便知道绘制箭头的方向。
As per accelerometer, you need to know that accelerometers are not only used for measuring acceleration, as their name would suggest, but they also tell you in what direction gravity is pointing. 根据加速度计,你需要知道加速度计不仅用于测量加速度,正如他们的名字所暗示的那样,但它们也告诉你重力指向的方向。 Without one your device would not know where "down" is.
没有你的设备就不会知道“向下”的位置。 For example, every smartphone capable of screen auto-rotation needs an accelerometer.
例如,每个能够进行屏幕自动旋转的智能手机都需要加速度计。
Now why need both for a compass? 现在为什么需要罗盘? Because in determining the position of north, you need to know not only the direction of magnetic field but also the horizontal plane.
因为在确定北方的位置时,不仅需要知道磁场的方向,还需要知道水平面的位置。 You usually don't care whether north is above or below you.
你通常不关心北方是高于还是高于你。 The knowledge of the "down" direction allows you to filter out the unneeded third coordinate.
“向下”方向的知识允许您过滤掉不需要的第三个坐标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.