Make azimuth less shaky

i work on making a compass but its more shaky than stable due to azimuth there is any way to make azimuth more stable
shaky

When I rounded the azimuth value it is ok?

its already round it

Then what is the problem


If you mean that use round the azimuth value I already done it , but if you look to this video you ll notice the compass not stable due to azimuth number shaky

Are you holding you device when you take an azimuth?

From * OrientationSensor

  • Azimuth : 0 degree when the top of the device is pointing north, 90 degrees when it is pointing east, 180 degrees when it is pointing south, 270 degrees when it is pointing west, etc.

These measurements assume that the device itself is not moving.

Place the device on a stable surface and try again. Is the azimuth changing dramatically?

You post the bearing when the OrientationChanged event is triggered. This means, every time your device moves slightly, it will trigger the event and post the azimuth.

You might be able to ameliorate the swinging. Try placing the code that indicates a change in a Clock.Timer event handler. The Clock will allow you to only report the changes every 5 or so seconds (depending on how frequently the Clock fires) and give the appearance of stability.

I put the device on stable position and still azimuth read values very rapidly as you see in this video

as @SteveJG suggested, use a Clock rather than the OrientationChanged event

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

Use a clock change every 1 second

Many Thanks to all,, Solved

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.