Package trclib.dataprocessor
Class TrcDataIntegrator<D>
java.lang.Object
trclib.dataprocessor.TrcDataIntegrator<D>
This class does data integration for sensors that have one or more axes. Some value sensors such as gyros and
accelerometers may need to integrate their data to provide heading from gyro rotation rate, and velocity or
distance from accelerometer acceleration data. This class uses a periodic task to do integration and optionally
double integration.
-
Constructor Summary
ConstructorsConstructorDescriptionTrcDataIntegrator
(String instanceName, TrcSensor<D> sensor, D dataType) Constructor: Creates an instance of the object.TrcDataIntegrator
(String instanceName, TrcSensor<D> sensor, D dataType, boolean doubleIntegration) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptiongetDoubleIntegratedData
(int index) This method returns the last indexed double integrated data.getInputData
(int index) This method returns the last indexed input data.getIntegratedData
(int index) This method returns the last indexed integrated data.void
reset()
This method resets all integratorData and doubleIntegratedData.void
reset
(int index) This method resets the indexed integratedData and doubleIntegratedData.void
setEnabled
(boolean enabled) This method enables the data integrator.toString()
This method returns the instance name.
-
Constructor Details
-
TrcDataIntegrator
public TrcDataIntegrator(String instanceName, TrcSensor<D> sensor, D dataType, boolean doubleIntegration) Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.sensor
- specifies the sensor object that needs integration.dataType
- specifies the data type to be integrated.doubleIntegration
- specifies true to do double integration, false otherwise.
-
TrcDataIntegrator
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.sensor
- specifies the sensor object that needs integration.dataType
- specifies the data type to be integrated.
-
-
Method Details
-
toString
This method returns the instance name. -
setEnabled
public void setEnabled(boolean enabled) This method enables the data integrator. The data integrator is not automatically enabled when created. You must explicitly call this method to enable the data integrator.- Parameters:
enabled
- specifies true for enabling the data processor, disabling it otherwise.
-
reset
public void reset(int index) This method resets the indexed integratedData and doubleIntegratedData.- Parameters:
index
- specifies the index.
-
reset
public void reset()This method resets all integratorData and doubleIntegratedData. -
getInputData
This method returns the last indexed input data.- Parameters:
index
- specifies the index.- Returns:
- the last indexed input data.
-
getIntegratedData
This method returns the last indexed integrated data.- Parameters:
index
- specifies the index.- Returns:
- last indexed integrated data.
-
getDoubleIntegratedData
This method returns the last indexed double integrated data.- Parameters:
index
- specifies the index.- Returns:
- last indexed double integrated data.
-