Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
fixed the offset and made set inverted always false
Browse files Browse the repository at this point in the history
  • Loading branch information
Liammurray19 committed Dec 22, 2023
1 parent 9c0b27c commit edcbad3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/frc/robot/maps/Valkyrie.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,27 @@ public SwerveDriveMap getDriveMap() {
rearLeftSteer.getMotorController().setPeriodicFramePeriod(PeriodicFrame.kStatus3, 1000);
rearRightSteer.getMotorController().setPeriodicFramePeriod(PeriodicFrame.kStatus3, 1000);

frontLeftSteer.getMotorController().setInverted(false);
frontRightSteer.getMotorController().setInverted(false);
rearLeftSteer.getMotorController().setInverted(false);
rearRightSteer.getMotorController().setInverted(false);

// Configuration for MK4 with L2 speeds
Configuration MK4_V2 = new Configuration(SDSSwerveModule.MK4_V2.gearRatio,
SDSSwerveModule.MK4_V2.wheelDiameter, new PIDValues(0.011, 0.00, 0.0002));

// All Distances are in Meters
// Front Left Module
final CANCoder encoderFL = new CANCoder(2);
encoderFL.configMagnetOffset(-215.771);
encoderFL.configMagnetOffset(-35.771);
encoderFL.configAbsoluteSensorRange(AbsoluteSensorRange.Unsigned_0_to_360);
final SDSSwerveModule frontLeft = new SDSSwerveModule(new Translation2d(MODULE_OFFSET_XY, MODULE_OFFSET_XY),
encoderFL, frontLeftSteer, new CSSparkMax(3, MotorType.kBrushless),
MK4_V2);

// Front Right Module
final CANCoder encoderFR = new CANCoder(4);
encoderFR.configMagnetOffset(-77.607);
encoderFR.configMagnetOffset(103.607);
encoderFR.configAbsoluteSensorRange(AbsoluteSensorRange.Unsigned_0_to_360);
final SDSSwerveModule frontRight = new SDSSwerveModule(new Translation2d(MODULE_OFFSET_XY, -MODULE_OFFSET_XY),
encoderFR, frontRightSteer, new CSSparkMax(7,
Expand Down

0 comments on commit edcbad3

Please sign in to comment.