/* Neutral Modes */
public static final NeutralModeValue DRIVE_NEUTRAL_MODE = NeutralModeValue.Brake;
public static final NeutralModeValue STEER_NEUTRAL_MODE = NeutralModeValue.Brake;
+
+ /* Gyro mount pose roll in deg (180.0 if placed under the robot) */
+ public static double GYRO_MOUNT_POSE_ROLL = 0.0;
/* Drive Motor PID Values */
public static final double[] P_VALUES = {
// MK5n
INVERT_STEER_MOTOR = InvertedValue.CounterClockwise_Positive;
-
+ // Gear ratios
DRIVE_GEAR_RATIO = (54.0 / 14.0) * (25.0 / 32.0) * (30.0 / 15.0);
STEER_GEAR_RATIO = 287.0 / 11.0;
+ // Gyro is mounted under the robot
+ GYRO_MOUNT_POSE_ROLL = 180.0;
+
MODULE_CONSTANTS = COTSFalconSwerveConstants.SDSMK5n(DRIVE_GEAR_RATIO);
} else if(robotId == RobotId.WaffleHouse){
private final Queue<Double> yawPositionQueue;
private final Queue<Double> yawTimestampQueue;
private final StatusSignal<AngularVelocity> yawVelocity = pigeon.getAngularVelocityZWorld();
+ private Pigeon2Configuration config = new Pigeon2Configuration();
public GyroIOPigeon2() {
- pigeon.getConfigurator().apply(new Pigeon2Configuration());
+ config.MountPose.MountPoseRoll = DriveConstants.GYRO_MOUNT_POSE_ROLL;
+ pigeon.getConfigurator().apply(config);
pigeon.getConfigurator().setYaw(0.0);
yaw.setUpdateFrequency(250);
yawVelocity.setUpdateFrequency(50.0);