简体   繁体   English

为什么使用加速度计和磁力计来获得罗盘值

[英]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.

相关问题 加速度计和磁力计传感器融合以获得陀螺仪数据 - Accelerometer and Magnetometer sensor fusion to get Gyroscopic Data 如何在Android中获取原始加速度计和磁力计数据? - How to get raw accelerometer and Magnetometer data in Android? 通过gluon CharmDown服务从指南针和加速度计传感器获取值 - Get values from compass and accelerometer sensors, with gluon CharmDown services 不同的传感器(磁力计,加速度计)如何工作以制作指南针-Android(Java) - How does different sensor(magnetometer, accelerometer) work to make compass - Android (Java) 如何在同一Java类中将两个传感器管理器用于加速度计和磁力计 - How to use Two Sensor Manager for Accelerometer and Magnetometer in the same Java class 加速度计和磁力计的Android Tilt问题 - Android Tilt issue with Accelerometer and Magnetometer Android加速度计和磁力计同时读取 - Android Accelerometer and Magnetometer readings simultaneously 及时获取加速度计值 - Get accelerometer values in time 是否可以将加速度计和数字罗盘组合在一起以得到精美的陀螺仪? - Is it possible to combine an Accelerometer and Digital Compass to get a fine Gyroscope? 完整的运动传感器图表-加速度计,陀螺仪和磁力计 - Meaningfull charts for Motion Sensors - Accelerometer, Gyroscope and Magnetometer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM