Package lejos.robotics.filter
Class IntegrationFilter
- java.lang.Object
-
- lejos.robotics.filter.AbstractFilter
-
- lejos.robotics.filter.IntegrationFilter
-
- All Implemented Interfaces:
SampleProvider
public class IntegrationFilter extends AbstractFilter
Integrates samples over time.
Usefull for example to:- convert gyro output (degrees/second) to azymuth (Degrees)
- Acceleration to speed
- Speed to position
- Author:
- Aswin
-
-
Field Summary
-
Fields inherited from class lejos.robotics.filter.AbstractFilter
sampleSize, source
-
-
Constructor Summary
Constructors Constructor Description IntegrationFilter(SampleProvider source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchSample(float[] sample, int off)Fetches a sample from the source and then integrates it.voidresetTo(float value)Sets the current value of the integrator to the specified value.-
Methods inherited from class lejos.robotics.filter.AbstractFilter
sampleSize
-
-
-
-
Constructor Detail
-
IntegrationFilter
public IntegrationFilter(SampleProvider source)
-
-
Method Detail
-
resetTo
public void resetTo(float value)
Sets the current value of the integrator to the specified value.- Parameters:
value- The value
-
fetchSample
public void fetchSample(float[] sample, int off)Fetches a sample from the source and then integrates it.- Specified by:
fetchSamplein interfaceSampleProvider- Overrides:
fetchSamplein classAbstractFilter- Parameters:
sample- The array to store the sample in.off- The elements of the sample are stored in the array starting at the offset position.- See Also:
AbstractFilter.fetchSample(float[], int)
-
-