Package trclib.sensor
Class TrcAnalogSensor
java.lang.Object
trclib.sensor.TrcSensor<TrcAnalogInput.DataType>
trclib.sensor.TrcAnalogInput
trclib.sensor.TrcAnalogSensor
This class implements a platform independent generic analog sensor. Anything that produces analog data can use
this class to make itself an analog sensor that conforms to the TrcSensor class which can be used as an analog
trigger. To make itself an analog sensor, it inherits from the AnalogInput class and thus must provide the
getRawData abstract method required by TrcAnalogInput. In getRawData, it will call the AnalogDataSource
provided in its constructor to get the raw data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
This interface is used by this class to get the analog data from the provider.Nested classes/interfaces inherited from class trclib.sensor.TrcAnalogInput
TrcAnalogInput.DataType
Nested classes/interfaces inherited from class trclib.sensor.TrcSensor
TrcSensor.DataSource<D>, TrcSensor.SensorData<T>
-
Field Summary
FieldsFields inherited from class trclib.sensor.TrcAnalogInput
ANALOGINPUT_DOUBLE_INTEGRATE, ANALOGINPUT_INTEGRATE, getInputElapsedTimer
-
Constructor Summary
ConstructorsConstructorDescriptionTrcAnalogSensor
(String instanceName, TrcAnalogSensor.AnalogDataSource dataSource) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptiongetRawData
(int index, TrcAnalogInput.DataType dataType) This abstract method returns the raw data with the specified index and type.Methods inherited from class trclib.sensor.TrcAnalogInput
getData, getDoubleIntegratedData, getIntegratedData, getNormalizedData, printElapsedTime, resetIntegrator, setElapsedTimerEnabled, setEnabled, setInverted, setScale, setScaleAndOffset, toString
Methods inherited from class trclib.sensor.TrcSensor
calibrate, calibrate, getNumAxes, getProcessedData, isCalibrating, setInverted, setScale, setScaleAndOffset
-
Field Details
-
dataSource
-
-
Constructor Details
-
TrcAnalogSensor
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.dataSource
- specifies the analog data provider.
-
-
Method Details
-
getRawData
This abstract method returns the raw data with the specified index and type.- Specified by:
getRawData
in classTrcAnalogInput
- Parameters:
index
- specifies the data index (not used because AnalogSensor has only one axis).dataType
- specifies the data type (not used because AnalogSensor only returns raw data).- Returns:
- raw data from the analog data source.
-