Package frclib.sensor

Class FrcAHRSGyro

All Implemented Interfaces:
TrcOdometrySensor

public class FrcAHRSGyro extends TrcGyro
  • Field Details

    • ahrs

      public com.studica.frc.AHRS ahrs
  • Constructor Details

    • FrcAHRSGyro

      public FrcAHRSGyro(String instanceName, com.studica.frc.AHRS.NavXComType port)
  • 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

      public TrcSensor.SensorData<Double> getRawXData(TrcGyro.DataType dataType)
      This method returns the raw data of the specified type for the x-axis which is not supported.
      Specified by:
      getRawXData in class TrcGyro
      Parameters:
      dataType - specifies the data type.
      Returns:
      raw data of the specified type for the x-axis.
    • getRawYData

      public TrcSensor.SensorData<Double> getRawYData(TrcGyro.DataType dataType)
      This method returns the raw data of the specified type for the y-axis which is not supported.
      Specified by:
      getRawYData in class TrcGyro
      Parameters:
      dataType - specifies the data type.
      Returns:
      raw data of the specified type for the y-axis.
    • getRawZData

      public TrcSensor.SensorData<Double> getRawZData(TrcGyro.DataType dataType)
      This method returns the raw data of the specified type for the z-axis.
      Specified by:
      getRawZData in class TrcGyro
      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 class TrcGyro
      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 class TrcGyro
      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 class TrcGyro
      Parameters:
      inverted - specifies true to invert z-axis, false otherwise.
    • getXRotationRate

      public TrcSensor.SensorData<Double> getXRotationRate()
      This method returns the rotation rate on the x-axis.
      Overrides:
      getXRotationRate in class TrcGyro
      Returns:
      X rotation rate.
    • getYRotationRate

      public TrcSensor.SensorData<Double> getYRotationRate()
      This method returns the rotation rate on the y-axis.
      Overrides:
      getYRotationRate in class TrcGyro
      Returns:
      Y rotation rate.
    • getZRotationRate

      public TrcSensor.SensorData<Double> getZRotationRate()
      This method returns the rotation rate on the z-axis.
      Overrides:
      getZRotationRate in class TrcGyro
      Returns:
      Z rotation rate.
    • getXHeading

      public TrcSensor.SensorData<Double> 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 class TrcGyro
      Returns:
      X heading.
    • getYHeading

      public TrcSensor.SensorData<Double> 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 class TrcGyro
      Returns:
      Y heading.
    • getZHeading

      public TrcSensor.SensorData<Double> 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 class TrcGyro
      Returns:
      Z heading.
    • resetXIntegrator

      public void resetXIntegrator()
      This method resets the integrator on the x-axis.
      Overrides:
      resetXIntegrator in class TrcGyro
    • resetYIntegrator

      public void resetYIntegrator()
      This method resets the integrator on the y-axis.
      Overrides:
      resetYIntegrator in class TrcGyro
    • resetZIntegrator

      public void resetZIntegrator()
      This method resets the integrator on the z-axis.
      Overrides:
      resetZIntegrator in class TrcGyro