Class Pigeon
java.lang.Object
frc.team_8840_lib.utils.IO.IOLayer
frc.team_8840_lib.utils.controllers.Pigeon
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPigeon(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 TypeMethodDescriptionvoidconfig()Sets up the pigeon gyroscope for use.edu.wpi.first.math.geometry.Rotation2dgetAngle()Gets the rotation of the gyroscope, inverted based on what was provided at creation.edu.wpi.first.math.geometry.Rotation2dgetAngle(boolean inverted) Gets the rotation of the gyroscope.intgetID()Gets the CAN ID of the Pigeon.static PigeongetPigeon(int id) double[]Gets the yaw, pitch, and roll of gyroscope.double[]Gets the yaw, pitch, and roll of the gyroscope.static PigeonhasPigeon(int id) voidsetDummyAngle(double angle) Sets the dummy angle of the pigeon gyroscope.voidzero()Zeros out the gyroscope.
-
Constructor Details
-
Pigeon
Creates a new Pigeon gyroscope.- Parameters:
pigeonType- Type of pigeon (Two, IMU, Dummy)pigeonID- Can ID of Pigeoninverted- Whether the gyroscope is inverted or not.
-
Pigeon
Creates a new Pigeon gyroscope (non-inverted)- Parameters:
pigeonType- Type of the pigeon (Two, IMU, Dummy)pigeonID- CAN id of pigeon.
-
-
Method Details
-
hasPigeon
-
getPigeon
-
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
- Overrides:
getBaseNamein classIOLayer
-