Package ftclib.sensor
Class FtcOpticalDistanceSensor
This class implements the Modern Robotics Optical Distance sensor extending TrcAnalogInput. It provides
implementation of the abstract methods in TrcAnalogInput.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class trclib.sensor.TrcSensor
TrcSensor.DataSource<D>, TrcSensor.SensorData<T>
-
Field Summary
FieldsFields inherited from class trclib.sensor.TrcSensor
instanceName, tracer
-
Constructor Summary
ConstructorsConstructorDescriptionFtcOpticalDistanceSensor
(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, TrcFilter[] filters) Constructor: Creates an instance of the object.FtcOpticalDistanceSensor
(String instanceName) Constructor: Creates an instance of the object.FtcOpticalDistanceSensor
(String instanceName, TrcFilter[] filters) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method calibrates the sensor.getRawData
(int index, FtcOpticalDistanceSensor.DataType dataType) This method returns the raw sensor data of the specified type.Methods inherited from class trclib.sensor.TrcSensor
calibrate, calibrate, getNumAxes, getProcessedData, isCalibrating, setInverted, setScale, setScaleAndOffset, toString
-
Field Details
-
sensor
public com.qualcomm.robotcore.hardware.OpticalDistanceSensor sensor
-
-
Constructor Details
-
FtcOpticalDistanceSensor
public FtcOpticalDistanceSensor(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, TrcFilter[] filters) Constructor: Creates an instance of the object.- Parameters:
hardwareMap
- specifies the global hardware map.instanceName
- specifies the instance name.filters
- specifies an array of filter objects, one for each axis, to filter sensor data. If no filter is used, this can be set to null.
-
FtcOpticalDistanceSensor
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.filters
- specifies an array of filter objects, one for each axis, to filter sensor data. If no filter is used, this can be set to null.
-
FtcOpticalDistanceSensor
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.
-
-
Method Details
-
calibrate
public void calibrate()This method calibrates the sensor. -
getRawData
public TrcSensor.SensorData<Double> getRawData(int index, FtcOpticalDistanceSensor.DataType dataType) This method returns the raw sensor data of the specified type.- Specified by:
getRawData
in classTrcSensor<FtcOpticalDistanceSensor.DataType>
- Parameters:
index
- specifies the data index.dataType
- specifies the data type.- Returns:
- raw sensor data of the specified type.
-