Class CustomNavx

java.lang.Object
lib.custom.sensors.CustomNavx
All Implemented Interfaces:
IMU

public class CustomNavx extends Object implements IMU
NavX should be mounted to robot according to WPILib coordinates: +X is forward, +Y is left, +Z is up
  • Field Details

  • Constructor Details

    • CustomNavx

      public CustomNavx(int id)
      Creates a new NavX
      Parameters:
      id - the CAN id of the navx. For whatever reason, this must be 0. Don't ask why.
  • Method Details

    • getYaw

      public double getYaw()
      Specified by:
      getYaw in interface IMU
      Returns:
      current yaw in rotations; positive = counterclockwise
    • getPitch

      public double getPitch()
      Specified by:
      getPitch in interface IMU
      Returns:
      current pitch in rotations; positive = front up
    • getRoll

      public double getRoll()
      Specified by:
      getRoll in interface IMU
      Returns:
      current roll in rotations; positive = left side up, right side down
    • zeroYaw

      public void zeroYaw(double offset)
      Description copied from interface: IMU
      Set the current yaw to the provided rotation
      Specified by:
      zeroYaw in interface IMU
    • getTemperature

      public double getTemperature()
      Description copied from interface: IMU
      Get current hardware temperature in freedom units (°F)
      Specified by:
      getTemperature in interface IMU