Package com.marslib.swerve
Class GyroIOPigeon2
java.lang.Object
com.marslib.swerve.GyroIOPigeon2
- All Implemented Interfaces:
GyroIO
Real hardware implementation of the gyro IO layer using a CTRE Pigeon2 IMU.
Students: The Pigeon2 is a 3-axis gyroscope connected over CAN bus. This class reads the yaw (heading) at 250Hz for high-frequency odometry and the yaw velocity at 100Hz for general telemetry.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.marslib.swerve.GyroIO
GyroIO.GyroIOInputs -
Constructor Summary
ConstructorsConstructorDescriptionGyroIOPigeon2(int canId, String canbus, SwerveConfig config) Constructs a Pigeon2 gyro IO layer. -
Method Summary
Modifier and TypeMethodDescriptionvoidupdateInputs(GyroIO.GyroIOInputs inputs) Updates the set of loggable inputs.
-
Constructor Details
-
GyroIOPigeon2
Constructs a Pigeon2 gyro IO layer.- Parameters:
canId- The CAN ID of the Pigeon2.canbus- The CAN bus name (e.g. "rio" or "canivore").
-
-
Method Details
-
updateInputs
Description copied from interface:GyroIOUpdates the set of loggable inputs.- Specified by:
updateInputsin interfaceGyroIO
-