Hi, If you are moving & have a gps fix then use http://developer.android.com/reference/android/location/Location.html#getBearing()
Gyroscope measure angular speed, read http://developer.android.com/reference/android/hardware/SensorEvent.html see Sensor.TYPE_GYROSCOPE: Otherwise you can just use integration to filter & smooth the (compass) azimuth, remember to add declination if you want true north not magnetic north. This integration could also be influenced from your gyroscope readings... Regards On Nov 10, 2:47 am, Ferro Francesco <[email protected]> wrote: > Hello everybody, > > I'm trying to get the best heading estimation of my phone. To be more > precise, I'm only interested on the Azimuth value (angle from the > north). > > the API offer ready to use function like > > TYPE_ORIENTATION (Deprecated): the result is shit :), it's very > unstable and not very precise.. > > there is SensorManager.getOrienation(matrix,orient): So here android > compute a matrix rotation based on the accel + magneto and then > extract the orientation from the rotationmatrix, and the result is > quit shit too.. Whenever my phone is near a magnetic perturbation the > heading become completly wrong... > > I have read on this group that there is the TYPE_ROTATION_VECTOR that > fuse the accelerometer + compass. I have tried this and it's not too > bad. It's sure, better that only using the accelerometer (+magneto) > with .getOrientation but it's still not very accurate when the phone > is near a magnetic perturbation.... > > There is the TYPE_GYROSCOPE that if you integrate the value by hand it > gives you the actual angle, but this not very good because of the > integration drift, and if my phone stand still on a table I can see > the angle moving every seconds... > > So now my question is.. How can I fuse (Exactly like > TYPE_ROTATION_VECTOR does) the accelerometer with the gyroscope (+ > compass why not)? That would be MOOOORE precise that fuse it with the > compass no ?? > > Thank you ! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

