Package ftclib.archive
Class FtcMRGyro
- All Implemented Interfaces:
TrcOdometrySensor
This class implements the Modern Robotics gyro extending TrcGyro. It provides implementation of the abstract
methods in TrcGyro. The Modern Robotics gyro supports 3 axes: x, y and z. It provides rotation rate data for
all 3 axes. However, it only provides heading data for the z-axis and the heading data is wrap-around.
-
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.hardware.modernrobotics.ModernRoboticsI2cGyro
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
Constructors -
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
This method overrides the TrcGyro class.void
This method overrides the TrcGyro class.void
This method overrides the TrcGyro class and calls its own.Methods inherited from class trclib.sensor.TrcGyro
getName, getOdometry, getRawData, getXHeading, getXRotationRate, getYHeading, getYRotationRate, getZHeading, getZRotationRate, printElapsedTime, resetOdometry, resetXWrapValueConverter, resetYWrapValueConverter, 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
-
gyro
private final com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cGyro gyro
-
-
Constructor Details
-
FtcMRGyro
public FtcMRGyro(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 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.
-
FtcMRGyro
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.
-
FtcMRGyro
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.
-
-
Method Details
-
calibrate
public void calibrate()This method calibrates the sensor. -
resetXIntegrator
public void resetXIntegrator()This method overrides the TrcGyro class. It doesn't have an x-integrator.- Overrides:
resetXIntegrator
in classTrcGyro
-
resetYIntegrator
public void resetYIntegrator()This method overrides the TrcGyro class. It doesn't have an y-integrator.- Overrides:
resetYIntegrator
in classTrcGyro
-
resetZIntegrator
public void resetZIntegrator()This method overrides the TrcGyro class and calls its own.- Overrides:
resetZIntegrator
in classTrcGyro
-
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.
-