Package frclib.sensor
Class FrcAHRSGyro
- All Implemented Interfaces:
TrcOdometrySensor
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.util.sendable.Sendable
This 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.void
This method resets the integrator on the x-axis.void
This method resets the integrator on the y-axis.void
This method resets the integrator on the z-axis.void
setXInverted
(boolean inverted) This method inverts the x-axis.void
setYInverted
(boolean inverted) This method inverts the y-axis.void
setZInverted
(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, 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
-
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:
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 which is not supported.- 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.
-
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:
setXInverted
in 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:
setYInverted
in 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:
setZInverted
in classTrcGyro
- Parameters:
inverted
- specifies true to invert z-axis, false otherwise.
-
getXRotationRate
This method returns the rotation rate on the x-axis.- Overrides:
getXRotationRate
in classTrcGyro
- Returns:
- X rotation rate.
-
getYRotationRate
This method returns the rotation rate on the y-axis.- Overrides:
getYRotationRate
in classTrcGyro
- Returns:
- Y rotation rate.
-
getZRotationRate
This method returns the rotation rate on the z-axis.- Overrides:
getZRotationRate
in 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:
getXHeading
in 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:
getYHeading
in 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:
getZHeading
in classTrcGyro
- Returns:
- Z heading.
-
resetXIntegrator
public void resetXIntegrator()This method resets the integrator on the x-axis.- Overrides:
resetXIntegrator
in classTrcGyro
-
resetYIntegrator
public void resetYIntegrator()This method resets the integrator on the y-axis.- Overrides:
resetYIntegrator
in classTrcGyro
-
resetZIntegrator
public void resetZIntegrator()This method resets the integrator on the z-axis.- Overrides:
resetZIntegrator
in classTrcGyro
-