KalmanFilter

Version: 1.0.0.0

class KalmanFilter

class ForestIndieGames.Muvslide.KalmanFilter

Simplified version of a Kalman Filter used to reduce the noise of the motion signals.

Every MuvslideConnection instance contains two instances of this class, one for the orientation and one for the acceleration.

The default Q and R parameters are for the orientation filter are: Q=0.001, R=0.005.

The default Q and R parameters are for the accelerometer filter (linear speed) are: Q=0.001, R=1.

Even when understanding Kalman filters can be a rewarding mathematical adventure, the easier way to adjust the filter parameters is by trial and error.

You cannot create new instances of this class; neither inherit from it.


Methods

SetEnabled

void SetEnabled (bool value)

Use this method to enable or disable the filter. By default, the filter is active.

When disabled, the information is returned to the caller without any filtering.

Parameters

Parameter Description
bool value Send 'false' to disable the filter.

 

SetQ

void SetQ (float newQ)

Set a new Q value for the filter. The default Q value for the filters is 0.001.

Even when understanding Kalman filters can be a rewarding mathematical adventure, the easier way to adjust the filter parameters is by trial and error.

Parameters

Parameter Description
float newQ New Q value

 

SetR

void SetR (float newR)

Set a new R value for the filter. The default R value for the orientation filter is 0.005 and 1 for the acceleration filter.

Even when understanding Kalman filters can be a rewarding mathematical adventure, the easier way to adjust the filter parameters is by trial and error.

Parameters

Parameter Description
float newR New R value