Package ftclib.archive
Class FtcAndroidGyro
- All Implemented Interfaces:
TrcOdometrySensor
This class implements the Android gyro extending TrcGyro. It provides implementation of the abstract methods in
TrcGyro. It supports 3 axes: x, y and z. It provides rotation data for all 3 axes. However, it doesn't provide
any heading data.
-
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
FieldsFields 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
ConstructorsConstructorDescriptionFtcAndroidGyro
(String instanceName) Constructor: Creates an instance of the object.FtcAndroidGyro
(String instanceName, 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.getRawYData
(TrcGyro.DataType dataType) This method returns the raw data of the specified type for the y-axis.getRawZData
(TrcGyro.DataType dataType) This method returns the raw data of the specified type for the z-axis.void
setEnabled
(boolean enabled) This method enables/disables the sensor.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, 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
-
sensor
-
-
Constructor Details
-
FtcAndroidGyro
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.filters
- specifies an array of filters to use for filtering sensor noise, one for each axis. Since we have 3 axes, the array should have 3 elements. If no filters are used, it can be set to null.
-
FtcAndroidGyro
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) This method enables/disables the sensor.- Overrides:
setEnabled
in classTrcGyro
- Parameters:
enabled
- specifies true if enabling, false otherwise.
-
calibrate
public void calibrate()This method calibrates the sensor. If the sensor is not enabled, it must enable it first before starting calibration. It will disable the sensor if it was disabled before calibration. -
getRawXData
This method returns the raw data of the specified type for the x-axis.- Specified by:
getRawXData
in classTrcGyro
- Parameters:
dataType
- specifies the data type.- Returns:
- raw data of the specified type for the x-axis.
-
getRawYData
This method returns the raw data of the specified type for the y-axis.- Specified by:
getRawYData
in classTrcGyro
- Parameters:
dataType
- specifies the data type.- Returns:
- raw data of the specified type for the y-axis.
-
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.
-