com.yobotics.simulationconstructionset.util.math.filter
Class AlphaFilteredYoVariable

java.lang.Object
  extended by com.yobotics.simulationconstructionset.YoVariable
      extended by com.yobotics.simulationconstructionset.util.math.filter.AlphaFilteredYoVariable
All Implemented Interfaces:
Observable, java.io.Serializable
Direct Known Subclasses:
RampedAlphaFilteredYoVariable

public class AlphaFilteredYoVariable
extends YoVariable

Author:
jrebula

LittleDogVersion06: us.ihmc.LearningLocomotion.Version06.util.YoAlphaFilteredVariable, 9:34:00 AM, Aug 29, 2006

A YoAlphaFilteredVariable is a filtered version of an input YoVar. Either a YoVariable holding the unfiltered val is passed in to the constructor and update() is called every tick, or update(double) is called every tick. The YoAlphaFilteredVariable updates it's val with the current filtered version using

            filtered_{n} = alpha * filtered_{n-1} + (1 - alpha) * raw_{n}
         
For alpha=0 -> no filtered For alpha=1 -> 100% filtered, no use of raw signal
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.yobotics.simulationconstructionset.YoVariable
MAX_LENGTH_SHORT_NAME, val
 
Constructor Summary
AlphaFilteredYoVariable(java.lang.String name, YoVariableRegistry registry, double alpha)
           
AlphaFilteredYoVariable(java.lang.String name, YoVariableRegistry registry, double alpha, YoVariable positionVariable)
           
AlphaFilteredYoVariable(java.lang.String name, YoVariableRegistry registry, YoVariable alphaVariable)
           
AlphaFilteredYoVariable(java.lang.String name, YoVariableRegistry registry, YoVariable alphaVariable, YoVariable positionVariable)
           
 
Method Summary
static double computeAlphaGivenBreakFrequency(double breakFrequencyInHetrz, double dt)
           
 void reset()
           
 void set(double value)
          Set the value of this YoVariable.
 void setAlpha(double alpha)
           
 void update()
           
 void update(double currentPosition)
           
 
Methods inherited from class com.yobotics.simulationconstructionset.YoVariable
addObserver, fullNameEndsWith, getBooleanValue, getDescription, getDoubleValue, getEnumValue, getFullNameWithNameSpace, getIntegerValue, getManualScalingMax, getManualScalingMin, getName, getName, getNameAndValue, getShortName, getValue, getYoVariableRegistry, getYoVariableType, hasSameFullName, notifyObservers, removeAllObservers, removeObserver, set, set, set, setManualScalingMinMax, toString, valueEquals, valueEquals, valueEquals, valueEquals
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlphaFilteredYoVariable

public AlphaFilteredYoVariable(java.lang.String name,
                               YoVariableRegistry registry,
                               double alpha)

AlphaFilteredYoVariable

public AlphaFilteredYoVariable(java.lang.String name,
                               YoVariableRegistry registry,
                               YoVariable alphaVariable)

AlphaFilteredYoVariable

public AlphaFilteredYoVariable(java.lang.String name,
                               YoVariableRegistry registry,
                               double alpha,
                               YoVariable positionVariable)

AlphaFilteredYoVariable

public AlphaFilteredYoVariable(java.lang.String name,
                               YoVariableRegistry registry,
                               YoVariable alphaVariable,
                               YoVariable positionVariable)
Method Detail

reset

public void reset()

update

public void update()

update

public void update(double currentPosition)

setAlpha

public void setAlpha(double alpha)

computeAlphaGivenBreakFrequency

public static double computeAlphaGivenBreakFrequency(double breakFrequencyInHetrz,
                                                     double dt)

set

public void set(double value)
Description copied from class: YoVariable
Set the value of this YoVariable. All four types are represented via the same interal double. If of integer type this value is cast as an int whenever accessed. It represents the ordinal if of enum type. Boolean values are triggered around the 0.5 threshold with < 0.5 being false and greater or equal being true.

Overrides:
set in class YoVariable
Parameters:
value - double value to store