org.wiigee.filter
Class IdleStateFilter

java.lang.Object
  extended by org.wiigee.filter.Filter
      extended by org.wiigee.filter.IdleStateFilter

public class IdleStateFilter
extends Filter

Filters if the wiimote is not moved in any way. Be careful in using this filter together with a HighPassFilter.


Constructor Summary
IdleStateFilter()
          Since an acceleration sensor usually provides information even if it doesn't move, this filter removes the data if it's in the idle state.
 
Method Summary
 double[] filterAlgorithm(double[] vector)
          A filter receives a triple of acceleration values within the variable 'vector'.
 double getSensivity()
           
 void reset()
           
 void setSensivity(double sensivity)
          Defines the absolute value when the wiimote should react to acceleration.
 
Methods inherited from class org.wiigee.filter.Filter
filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdleStateFilter

public IdleStateFilter()
Since an acceleration sensor usually provides information even if it doesn't move, this filter removes the data if it's in the idle state.

Method Detail

reset

public void reset()
Specified by:
reset in class Filter

filterAlgorithm

public double[] filterAlgorithm(double[] vector)
Description copied from class: Filter
A filter receives a triple of acceleration values within the variable 'vector'. It's encoded as vector[0]=x, vector[1]=y, vector[2]=z. This is not an object since the processing of the filter should be really fast, since every acceleration of the wiimote passes the filter.

Specified by:
filterAlgorithm in class Filter
Returns:

setSensivity

public void setSensivity(double sensivity)
Defines the absolute value when the wiimote should react to acceleration. This is a parameter for the first of the two filters: idle state filter. For example: sensivity=0.2 makes the wiimote react to acceleration where the absolute value is equal or greater than 1.2g. The default value 0.1 should work well. Only change if you are sure what you're doing.

Parameters:
sensivity - acceleration data values smaller than this value wouldn't be detected.

getSensivity

public double getSensivity()