Package frclib.sensor
Class FrcAHRSGyro
- All Implemented Interfaces:
TrcOdometrySensor
-
Nested Class Summary
Nested classes/interfaces inherited from class trclib.sensor.TrcGyro
TrcGyro.DataType, TrcGyro.GyroDataNested 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_INTEGRATEFields inherited from class trclib.sensor.TrcSensor
instanceName, tracer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.util.sendable.SendableThis method creates a GyroInfo object and returns it.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.This method returns the heading of the x-axis.This method returns the rotation rate on the x-axis.This method returns the heading of the y-axis.This method returns the rotation rate on the y-axis.This method returns the heading of the z-axis.This method returns the rotation rate on the z-axis.voidThis method resets the integrator on the x-axis.voidThis method resets the integrator on the y-axis.voidThis method resets the integrator on the z-axis.voidsetXInverted(boolean inverted) This method inverts the x-axis.voidsetYInverted(boolean inverted) This method inverts the y-axis.voidsetZInverted(boolean inverted) This method inverts the z-axis.Methods inherited from class trclib.sensor.TrcGyro
getName, getOdometry, getRawData, printElapsedTime, resetOdometry, resetXWrapValueConverter, resetYWrapValueConverter, resetZWrapValueConverter, setElapsedTimerEnabled, setEnabled, setXScale, setXValueRange, setYScale, setYValueRange, setZScale, setZValueRange, toStringMethods inherited from class trclib.sensor.TrcSensor
calibrate, calibrate, getNumAxes, getProcessedData, isCalibrating, setInverted, setScale, setScaleAndOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface trclib.sensor.TrcOdometrySensor
getOdometries, getOdometry
-
Field Details
-
ahrs
public com.studica.frc.AHRS ahrs
-
-
Constructor Details
-
Method Details
-
getGyroSendable
public edu.wpi.first.util.sendable.Sendable getGyroSendable()This method creates a GyroInfo object and returns it.- Returns:
- created GyroInfo object.
-
getRawXData
This method returns the raw data of the specified type for the x-axis which is not supported.- Specified by:
getRawXDatain 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 which is not supported.- Specified by:
getRawYDatain 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:
getRawZDatain classTrcGyro- Parameters:
dataType- specifies the data type.- Returns:
- raw data of the specified type for the z-axis.
-
setXInverted
public void setXInverted(boolean inverted) This method inverts the x-axis. This is useful if the orientation of the gyro x-axis is such that the data goes the wrong direction.- Overrides:
setXInvertedin classTrcGyro- Parameters:
inverted- specifies true to invert x-axis, false otherwise.
-
setYInverted
public void setYInverted(boolean inverted) This method inverts the y-axis. This is useful if the orientation of the gyro y-axis is such that the data goes the wrong direction.- Overrides:
setYInvertedin classTrcGyro- Parameters:
inverted- specifies true to invert y-axis, false otherwise.
-
setZInverted
public void setZInverted(boolean inverted) This method inverts the z-axis. This is useful if the orientation of the gyro z-axis is such that the data goes the wrong direction.- Overrides:
setZInvertedin classTrcGyro- Parameters:
inverted- specifies true to invert z-axis, false otherwise.
-
getXRotationRate
This method returns the rotation rate on the x-axis.- Overrides:
getXRotationRatein classTrcGyro- Returns:
- X rotation rate.
-
getYRotationRate
This method returns the rotation rate on the y-axis.- Overrides:
getYRotationRatein classTrcGyro- Returns:
- Y rotation rate.
-
getZRotationRate
This method returns the rotation rate on the z-axis.- Overrides:
getZRotationRatein classTrcGyro- Returns:
- Z rotation rate.
-
getXHeading
This method returns the heading of the x-axis. If there is an integrator, we call the integrator to get the heading. Else if we have a CardinalConverter, we call the converter to get the heading else we call the platform dependent gyro to get the raw heading value.- Overrides:
getXHeadingin classTrcGyro- Returns:
- X heading.
-
getYHeading
This method returns the heading of the y-axis. If there is an integrator, we call the integrator to get the heading. Else if we have a CardinalConverter, we call the converter to get the heading else we call the platform dependent gyro to get the raw heading value.- Overrides:
getYHeadingin classTrcGyro- Returns:
- Y heading.
-
getZHeading
This method returns the heading of the z-axis. If there is an integrator, we call the integrator to get the heading. Else if we have a CardinalConverter, we call the converter to get the heading else we call the platform dependent gyro to get the raw heading value.- Overrides:
getZHeadingin classTrcGyro- Returns:
- Z heading.
-
resetXIntegrator
public void resetXIntegrator()This method resets the integrator on the x-axis.- Overrides:
resetXIntegratorin classTrcGyro
-
resetYIntegrator
public void resetYIntegrator()This method resets the integrator on the y-axis.- Overrides:
resetYIntegratorin classTrcGyro
-
resetZIntegrator
public void resetZIntegrator()This method resets the integrator on the z-axis.- Overrides:
resetZIntegratorin classTrcGyro
-