Package ftclib.sensor
Class FtcAnalogGyro
- All Implemented Interfaces:
TrcOdometrySensor
This class implements an Analog gyro extending TrcGyro. It provides implementation of the abstract methods in
TrcGyro. It supports only the z axis. The hardware provides rotation rate data but not heading and it does not
support built-in calibration.
-
Nested Class Summary
Nested classes/interfaces inherited from class trclib.sensor.TrcGyro
TrcGyro.DataType, TrcGyro.GyroData
Nested classes/interfaces inherited from class trclib.sensor.TrcSensor
TrcSensor.DataSource<D>, TrcSensor.SensorData<T>
Nested classes/interfaces inherited from interface trclib.sensor.TrcOdometrySensor
TrcOdometrySensor.Odometry
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.qualcomm.robotcore.hardware.AnalogInput
private final double
Fields inherited from class trclib.sensor.TrcGyro
GYRO_HAS_X_AXIS, GYRO_HAS_Y_AXIS, GYRO_HAS_Z_AXIS, GYRO_INTEGRATE
Fields inherited from class trclib.sensor.TrcSensor
instanceName, tracer
-
Constructor Summary
ConstructorsConstructorDescriptionFtcAnalogGyro
(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, double voltPerDegPerSec, TrcFilter[] filters) Constructor: Creates an instance of the object.FtcAnalogGyro
(String instanceName, double voltPerDegPerSec) Constructor: Creates an instance of the object.FtcAnalogGyro
(String instanceName, double voltPerDegPerSec, TrcFilter[] filters) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method calibrates the sensor.getRawXData
(TrcGyro.DataType dataType) This method returns the raw data of the specified type for the x-axis which is not supported.getRawYData
(TrcGyro.DataType dataType) This method returns the raw data of the specified type for the y-axis which is not supported.getRawZData
(TrcGyro.DataType dataType) This method returns the raw data of the specified type for the z-axis.Methods inherited from class trclib.sensor.TrcGyro
getName, getOdometry, getRawData, getXHeading, getXRotationRate, getYHeading, getYRotationRate, getZHeading, getZRotationRate, printElapsedTime, resetOdometry, resetXIntegrator, resetXWrapValueConverter, resetYIntegrator, resetYWrapValueConverter, resetZIntegrator, resetZWrapValueConverter, setElapsedTimerEnabled, setEnabled, setXInverted, setXScale, setXValueRange, setYInverted, setYScale, setYValueRange, setZInverted, setZScale, setZValueRange, toString
Methods inherited from class trclib.sensor.TrcSensor
calibrate, calibrate, getNumAxes, getProcessedData, isCalibrating, setInverted, setScale, setScaleAndOffset
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface trclib.sensor.TrcOdometrySensor
getOdometries, getOdometry
-
Field Details
-
voltPerDegPerSec
private final double voltPerDegPerSec -
gyro
private final com.qualcomm.robotcore.hardware.AnalogInput gyro
-
-
Constructor Details
-
FtcAnalogGyro
public FtcAnalogGyro(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, double voltPerDegPerSec, TrcFilter[] filters) Constructor: Creates an instance of the object.- Parameters:
hardwareMap
- specifies the global hardware map.instanceName
- specifies the instance name.voltPerDegPerSec
- specifies the rotation rate scale.filters
- specifies an array of filters to use for filtering sensor noise, one for each axis. Since we only have 1 axis, the array should have 1 element. If no filters are used, it can be set to null.
-
FtcAnalogGyro
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.voltPerDegPerSec
- specifies the rotation rate scale.filters
- specifies an array of filters to use for filtering sensor noise, one for each axis. Since we only have 1 axis, the array should have 1 element. If no filters are used, it can be set to null.
-
FtcAnalogGyro
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.voltPerDegPerSec
- specifies the rotation rate scale.
-
-
Method Details
-
calibrate
public void calibrate()This method calibrates the sensor. -
getRawXData
This method returns the raw data of the specified type for the x-axis which is not supported.- Specified by:
getRawXData
in classTrcGyro
- Parameters:
dataType
- specifies the data type.- Returns:
- throws UnsupportedOperation exception.
-
getRawYData
This method returns the raw data of the specified type for the y-axis which is not supported.- Specified by:
getRawYData
in classTrcGyro
- Parameters:
dataType
- specifies the data type.- Returns:
- throws UnsupportedOperation exception.
-
getRawZData
This method returns the raw data of the specified type for the z-axis.- Specified by:
getRawZData
in classTrcGyro
- Parameters:
dataType
- specifies the data type.- Returns:
- raw data of the specified type for the z-axis in degrees per second.
-