Skip to content

Commit c13a2dd

Browse files
authored
Merge pull request #54 from Team537/improve-operator-offset-controls
Improve operator offset controls
2 parents c7fa2ea + 6fba582 commit c13a2dd

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

src/main/java/frc/robot/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static class ErrorSettings {
5858
public static final int TURRET_OFFSET_DECIMAL_PLACE = 1;
5959
public static final double HOOD_OFFSET_INCREASE = 0.1;
6060
public static final int HOOD_OFFSET_DECIMAL_PLACE = 1;
61-
public static final double SHOOTER_PERCENT_INCREASE = 0.2; // Percent to increase per tick
61+
public static final double SHOOTER_PERCENT_INCREASE = .5; // Percent to increase per tick
6262
public static final int SHOOTER_PERCENT_DECIMAL_PLACE = 1;
6363

6464
public static final double SHOOTER_PERCENT_DEFAULT = 100.0;

src/main/java/frc/robot/RobotContainer.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,26 @@ public void configureBindings() {
388388
shooterPercent.getHeldIntervalCommand(Constants.Operator.ErrorSettings.SHOOTER_PERCENT_INCREASE,
389389
Constants.Operator.ErrorSettings.SETTINGS_DELAY_TIME));
390390

391+
// ==============================
392+
// Turret / Hood Offset Reset (Left Stick Click / Right Stick Click)
393+
// ==============================
394+
395+
// Left Stick Click : Reset turret offset to zero
396+
new Trigger(() -> operatorController.getLeftStickButton())
397+
.onTrue(new InstantCommand(() -> turretOffsetDegrees.set(0.0)));
398+
399+
// Right Stick Click : Reset hood offset to zero
400+
new Trigger(() -> operatorController.getRightStickButton())
401+
.onTrue(new InstantCommand(() -> hoodOffsetDegrees.set(0.0)));
402+
403+
// ==============================
404+
// Shooter Percent Reset (Left Trigger / Right Trigger)
405+
// ==============================
406+
407+
// Either Trigger : Reset shooter percent to default
408+
new Trigger(() -> operatorController.getLeftTriggerAxis() > 0.5
409+
|| operatorController.getRightTriggerAxis() > 0.5)
410+
.onTrue(new InstantCommand(() -> shooterPercent.set(Constants.Operator.ErrorSettings.SHOOTER_PERCENT_DEFAULT)));
391411
new Trigger(
392412
() -> operatorController.getAButton()).onTrue(
393413
new InstantCommand(() -> selectedFixedTarget = FixedTarget.A));

src/main/java/frc/robot/subsystems/IntakePivotSubsystem.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import frc.robot.Configs;
1616
import frc.robot.Constants;
1717

18-
// Test
1918
public class IntakePivotSubsystem extends SubsystemBase {
2019
public TalonFX intake;
2120
private final PositionVoltage angleRequest = new PositionVoltage(0);

0 commit comments

Comments
 (0)