-
Notifications
You must be signed in to change notification settings - Fork 0
Orientation
Suraj Swarnapuri edited this page May 5, 2019
·
3 revisions
BNav uses the android.sensors package to gather orientation data
- static SensorManager _sensorManager;
-
- access sensor information
- Sensor _accelerometer;
- Sensor _magnetometer;
- float[] _r = new float[9];
-
- matrix to define orientation
- float[] _orientation
-
- stores x, y and z data
- float[] _lastAccelerometer
- float[] _lastMagnetometer
- boolean _lastAccelerometerSet
- boolean _lastMagnetometerSet
- double heading
-
- angle of current direction
- String turnDirection(double heading, double bearing)
-
- returns direction given heading and bearing
- double convertRadiantoDegree(double rad)
-
- convert radians to degrees (0,360]
- void onSensorChanged(SensorEvent event)
-
- reading orientation data and stores heading