简体   繁体   English

不同的传感器(磁力计,加速度计)如何工作以制作指南针-Android(Java)

[英]How does different sensor(magnetometer, accelerometer) work to make compass - Android (Java)

I have to implement a compass in Java (Eclipse) for Android Platform. 我必须在Android平台的Java(Eclipse)中实现指南针。

I am required to use NOT the phone's sensor, but a sensor that I am given (Sensortag cc2541) 我不需要使用手机的传感器,而要使用我得到的传感器(Sensortag cc2541)

This sensor has: 该传感器具有:

Magnetometer, Accelerometer, Gyroscope, etc.. 磁力计,加速度计,陀螺仪等。

So I was wondering in order to make a compass, which sensors do I exactly need? 所以我想知道制作一个指南针时,我到底需要哪些传感器? I am a bit lost. 我有点迷路。 So the magnetometer returns Point 3D (xyz). 因此,磁力计返回Point 3D(xyz)。 The accelerometer returns Point 3D as well. 加速度计也返回Point 3D。

I just need a basic explanation on which sensors and how are they going to function for the creation of a compass 我只需要基本说明一下哪些传感器以及它们如何工作以创建指南针

For a simple compass, just Magnetometer is needed. 对于一个简单的指南针,只需要磁力计 It gives you the vector of which it thinks to be north. 它为您提供了它认为是北的向量。

Accelerometer and Gyroscope can help you with the calculation by determining how the device is positioned. 加速度计和陀螺仪可以通过确定设备的位置来帮助您进行计算。

Point3D is just a vector. Point3D只是一个向量。 You will need to know some vector math to fully understand and do calculations. 您将需要了解一些矢量数学以完全理解并进行计算。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM