¡@

Home 

2014/10/16 ¤W¤È 08:10:59

android Programming Glossary: calculatefilteredangle

Android getOrientation() method returns bad results

http://stackoverflow.com/questions/10192057/android-getorientation-method-returns-bad-results

... y is the current filtered angle value private float calculateFilteredAngle float x float y final float alpha 0.1f float diff x y here we.. 180 180 bounds y restrictAngle y return y The function calculateFilteredAngle float x float y can then be called periodically using something.. angle from getOrientation ... function filteredAzimuth calculateFilteredAngle azimuth filteredAzimuth Using this method the filter would not..

Android getOrientation() method returns bad results

http://stackoverflow.com/questions/10192057/android-getorientation-method-returns-bad-results

360 return tmpAngle x is a raw angle value from getOrientation ... y is the current filtered angle value private float calculateFilteredAngle float x float y final float alpha 0.1f float diff x y here we ensure that abs diff 180 diff restrictAngle diff y alpha diff.. diff restrictAngle diff y alpha diff ensure that y stays within 180 180 bounds y restrictAngle y return y The function calculateFilteredAngle float x float y can then be called periodically using something like this example for azimuth angle from getOrientation.. periodically using something like this example for azimuth angle from getOrientation ... function filteredAzimuth calculateFilteredAngle azimuth filteredAzimuth Using this method the filter would not misbehave like the averaging filter as mentioned by the OP...