Monday, 15 December 2014

Using Accelerometers and Magnetic Field Sensor Together.

- The SensorManager provides some methods that allow us to combine the compass sensor and accelerometers to figure out orientation.

- You can't use just the compass sensor alone to do the job.So SensorManager provides a method
called getRoatationMatrix(),which takes the values from the accelerometers and from the compass
and returns a matrix that can be used to determine orientation.

- Another SensorManager method,getOrientation(), takes the rotation matrix from the previous step
and gives an orientation matrix.

- The values from the orientation matrix tell us our device's rotation to the Earth's Magnetic north,
as well asthe device's pitch and roll relative to the ground.

No comments:

Post a Comment