Class Pigeon

java.lang.Object
frc.team_8840_lib.utils.IO.IOLayer
frc.team_8840_lib.utils.controllers.Pigeon

public class Pigeon extends IOLayer
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pigeon(Pigeon.Type pigeonType, int pigeonID)
    Creates a new Pigeon gyroscope (non-inverted)
    Pigeon(Pigeon.Type pigeonType, int pigeonID, boolean inverted)
    Creates a new Pigeon gyroscope.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets up the pigeon gyroscope for use.
    edu.wpi.first.math.geometry.Rotation2d
    Gets the rotation of the gyroscope, inverted based on what was provided at creation.
    edu.wpi.first.math.geometry.Rotation2d
    getAngle(boolean inverted)
    Gets the rotation of the gyroscope.
     
    int
    Gets the CAN ID of the Pigeon.
    static Pigeon
    getPigeon(int id)
     
    double[]
    Gets the yaw, pitch, and roll of gyroscope.
    double[]
    Gets the yaw, pitch, and roll of the gyroscope.
    static Pigeon
    hasPigeon(int id)
     
    void
    setDummyAngle(double angle)
    Sets the dummy angle of the pigeon gyroscope.
    void
    Zeros out the gyroscope.

    Methods inherited from class frc.team_8840_lib.utils.IO.IOLayer

    close, isReal, setReal

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pigeon

      public Pigeon(Pigeon.Type pigeonType, int pigeonID, boolean inverted)
      Creates a new Pigeon gyroscope.
      Parameters:
      pigeonType - Type of pigeon (Two, IMU, Dummy)
      pigeonID - Can ID of Pigeon
      inverted - Whether the gyroscope is inverted or not.
    • Pigeon

      public Pigeon(Pigeon.Type pigeonType, int pigeonID)
      Creates a new Pigeon gyroscope (non-inverted)
      Parameters:
      pigeonType - Type of the pigeon (Two, IMU, Dummy)
      pigeonID - CAN id of pigeon.
  • Method Details

    • hasPigeon

      public static Pigeon hasPigeon(int id)
    • getPigeon

      public static Pigeon getPigeon(int id)
    • setDummyAngle

      public void setDummyAngle(double angle)
      Sets the dummy angle of the pigeon gyroscope. Used primarly for simulation.
      Parameters:
      angle -
    • config

      public void config()
      Sets up the pigeon gyroscope for use.
    • zero

      public void zero()
      Zeros out the gyroscope.
    • getAngle

      public edu.wpi.first.math.geometry.Rotation2d getAngle(boolean inverted)
      Gets the rotation of the gyroscope.
      Parameters:
      inverted - Whether to invert it or not.
      Returns:
      Rotation of gyroscope.
    • getYawPitchRoll

      public double[] getYawPitchRoll()
      Gets the yaw, pitch, and roll of the gyroscope.
      Returns:
      [yaw, pitch, roll]
    • getID

      public int getID()
      Gets the CAN ID of the Pigeon.
      Returns:
      CAN ID of Pigeon.
    • getAngle

      public edu.wpi.first.math.geometry.Rotation2d getAngle()
      Gets the rotation of the gyroscope, inverted based on what was provided at creation.
      Returns:
      Rotation of gyroscope.
    • getRotation

      public double[] getRotation()
      Gets the yaw, pitch, and roll of gyroscope.
      Returns:
      [yaw, pitch, roll]
    • getBaseName

      public String getBaseName()
      Overrides:
      getBaseName in class IOLayer