1

I am developing an Android app that reads data from the magnetic field sensor. I convert the sensor data to the Earth's coordinate system as instructed here and here.

The converted data looks good. However, the X values are always close to zero. The first image below shows the original data and the second one shows the converted data. Please notice that all the axis values change in the first figure. In the second figure, only Y and Z axis change and X is always close to zero. Does anyone know why this happens?

Thanks!

Original magnetic field data

Converted magnetic field data

Community
  • 1
  • 1
jair.jr
  • 597
  • 1
  • 7
  • 13

1 Answers1

0

The data is correct, the x values in world coordinate should be close to 0. This is because the magnetic field sensor vector is assume to lie on the world North-Sky plane, thus the x-coordinate (East coordinate) should be zero. In the first graph, x varies because the device basis varies. Think of a fixed vector but the coordinates represent this vector change. Thus 2 different coordinates may represent the same vector.

Hoan Nguyen
  • 18,033
  • 3
  • 50
  • 54
  • Thank you very much for your help! As stated [here](https://en.wikipedia.org/wiki/Earth%27s_magnetic_field), Earth's magnetic field is represented by a 3-axis vector (North-Sky-East). So it's odd that the android magnetic field sensor lies in 2D (North-Sky) plane and ignores the East coordinate. Do you know why this sensor is implemented like that? Is it a hardware limitation? – jair.jr May 22 '16 at 19:34
  • Yes but at any fixed x the vector lies in the North-Sky plane. I do not know much about hardware but I think what the magnetic sensor does is to measure this vector and so the assumption is sensible to me. – Hoan Nguyen May 23 '16 at 02:54