Compass & Accelerometer Tilt Compensation example
Hi there,
I am building an app that uses the compass to display directions in 3D space. The problem I have is that the bearings change when the device is tilted forwards and backwards making the direction useless. I have read many articles that say you can compensate for this by using the accelerometer and passing all the data through a rotation matrix but I can't find any actual examples for me to get my head around. Would anybody be able to give me a simple example of how I can achieve this? Thank you very much for your help.
-
The Gyroscope will continue to operate as it does, however we are moving further development to a new ANE to better reflect the usage, i.e. the combination of all sensors into a device motion extension.
This extension will be released in the coming weeks.
-
Mike commented
The Gyroscope ANE works great for my needs but in the latest package you state that many of the api features have been deprecated and suggest that we use the Device Motion ANE instead - do you guys have any time frame of when this new ANE will be available?
Thanks very much!
-
Mike commented
Thank you very much for your answer.
-
Hi,
You should look at our Gyroscope ANE in our current package to automatically handle this for you. It uses a sensor fusion algorithm to combine all the devices sensors.
We're currently going through a big rewrite of the Gyroscope to improve this and we will soon be releasing a DeviceMotion ANE which will encompass all of this functionality.
If you're looking to do it yourself, you should be able to get the information out of our extensions and do the processing. There are a lot of tutorials out there, the most simplest method is using a "Complimentary filter" in which you combine a low and a high pass filter. The best method is the "Kalman filter".
Cheers,
Michael -
Mike commented
I should say I am using the Distriqt ANEs!