Skip to content

Commit

Permalink
Merge pull request #166 from frc937/correct-heading-snapping-suppliers
Browse files Browse the repository at this point in the history
Drivetrain fixes
  • Loading branch information
willitcode authored Mar 22, 2024
2 parents c8f7501 + f35fc99 commit ac1237e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/deploy/swerve/modules/backleft.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"front": -10.875,
"left": 10
},
"absoluteEncoderOffset": 56.5,
"absoluteEncoderOffset": 236,
"drive": {
"type": "sparkmax",
"id": 8,
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/swerve/modules/backright.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"front": -10.875,
"left": -10
},
"absoluteEncoderOffset": 209.9,
"absoluteEncoderOffset": 213.8,
"drive": {
"type": "sparkmax",
"id": 5,
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/swerve/modules/frontleft.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"front": 10.875,
"left": 10
},
"absoluteEncoderOffset": 260.5,
"absoluteEncoderOffset": 76.7,
"drive": {
"type": "sparkmax",
"id": 9,
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/swerve/modules/frontright.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"front": 10.875,
"left": -10
},
"absoluteEncoderOffset": 1.5,
"absoluteEncoderOffset": 2.34,
"drive": {
"type": "sparkmax",
"id": 3,
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/frc/robot/Controllers.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,19 @@ public final class Controllers {
private static XboxController rawOpXboxController = operatorController.getHID();

/** When this supplier returns true, the robot should snap towards the opposing alliance wall. */
public static Supplier<Boolean> headingSnappingUpSupplier =
() -> rawPilotController.getPOV() == 0;
public static Supplier<Boolean> headingSnappingUpSupplier = () -> rawPilotController.getYButton();

/** When this supplier returns true, the robot should snap towards the right side of the field. */
public static Supplier<Boolean> headingSnappingRightSupplier =
() -> rawPilotController.getPOV() == 90;
() -> rawPilotController.getBButton();

/** When this supplier returns true, the robot should snap towards our alliance wall. */
public static Supplier<Boolean> headingSnappingDownSupplier =
() -> rawPilotController.getPOV() == 180;
() -> rawPilotController.getAButton();

/** When this supplier returns true, the robot should snap towards the left side of the field. */
public static Supplier<Boolean> headingSnappingLeftSupplier =
() -> rawPilotController.getPOV() == 270;
() -> rawPilotController.getXButton();

/** Shuffleboard (NT) entry for the keymap selector */
public static GenericEntry keymapEntry =
Expand Down Expand Up @@ -104,7 +103,7 @@ private static void configureDefaultKeybinds() {
operatorController.povDown().whileTrue(RobotContainer.runIntakeReverse);
operatorController.leftTrigger().whileTrue(RobotContainer.aimToAmp);
operatorController.rightTrigger().whileTrue(RobotContainer.fireNote);
pilotController.leftTrigger().toggleOnTrue(RobotContainer.driveFieldOriented);
pilotController.leftBumper().whileTrue(RobotContainer.driveFieldOrientedSprint);

/* TODO: angle / velocity steering toggle w/ right trigger (no issue) */

Expand All @@ -116,7 +115,6 @@ private static void configureDefaultKeybinds() {
* bound to pilotController)
*/
private static void configureOperatorlessKeybinds() {
pilotController.leftStick().toggleOnTrue(RobotContainer.driveFieldOriented);
/* TODO: angle / velocity steering toggle w/ right stick (no issue) and boost on right bumper (issue 86) */
pilotController.povDown().whileTrue(RobotContainer.runIntakeReverse);
pilotController.povUp().toggleOnTrue(RobotContainer.enterXMode);
Expand Down

0 comments on commit ac1237e

Please sign in to comment.