Skip to content

Commit bdac9ec

Browse files
authored
Merge pull request #143 from strykeforce/QuickAutonFix
Quick auton fix
2 parents 6e2b97d + 3e7e134 commit bdac9ec

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/main/java/frc/robot/Robot.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public void teleopInit() {
124124
m_robotContainer.zeroClimb();
125125
m_robotContainer.startAutoIntake();
126126
m_robotContainer.setDoVisionOdomReset(true);
127+
m_robotContainer.autonIgnoreColorSensor(false);
127128
CommandScheduler.getInstance()
128129
.schedule(
129130
new EnableVisionCommand(

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import frc.robot.commands.drive.XLockCommand;
4848
import frc.robot.commands.drive.ZeroGyroCommand;
4949
import frc.robot.commands.intake.IntakeOpenLoopCommand;
50-
import frc.robot.commands.magazine.AutonIgnoreColorSensorCommand;
50+
import frc.robot.commands.magazine.IgnoreColorSensorCommand;
5151
import frc.robot.commands.magazine.LowerMagazineOpenLoopCommand;
5252
import frc.robot.commands.magazine.ManualEjectCargoReverseCommand;
5353
import frc.robot.commands.magazine.PitClearCargoColor;
@@ -197,6 +197,10 @@ public void zeroClimb() {
197197
}
198198
}
199199

200+
public void autonIgnoreColorSensor(boolean ignore) {
201+
magazineSubsystem.setAutonIgnoreColorSensor(ignore);
202+
}
203+
200204
private void configureTelemetry() {
201205
driveSubsystem.registerWith(telemetryService);
202206
shooterSubsystem.registerWith(telemetryService);
@@ -228,9 +232,9 @@ private void configureDriverButtonBindings() {
228232

229233
// Ignore Color Sensor
230234
new JoystickButton(driveJoystick, Toggle.LEFT_TOGGLE.id)
231-
.whenPressed(new AutonIgnoreColorSensorCommand(magazineSubsystem, true));
235+
.whenPressed(new IgnoreColorSensorCommand(magazineSubsystem, true));
232236
new JoystickButton(driveJoystick, Toggle.LEFT_TOGGLE.id)
233-
.whenReleased(new AutonIgnoreColorSensorCommand(magazineSubsystem, false));
237+
.whenReleased(new IgnoreColorSensorCommand(magazineSubsystem, false));
234238

235239
// Hood Open Loop
236240
new JoystickButton(driveJoystick, Trim.RIGHT_Y_POS.id)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ public void periodic() {
489489
logger.info("ReadTimer Elapsed");
490490
cargoColor = allianceCargoColor;
491491
storedCargoColors[1] = cargoColor;
492-
} else {
492+
} else if (hasReadElapsed) {
493493
logger.info("ReadTimer Elapsed");
494494
autonReadTimerElapsed = true;
495495
}

0 commit comments

Comments
 (0)