Skip to content

Commit

Permalink
changed the command to while true and changed the constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTaylor29 committed Jan 25, 2025
1 parent f9731c5 commit 85e1da9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/DriveToPoseCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public boolean isFinished() {
double yError = Math.abs(targetPose.getY() - currentPose.getY());
double thetaError = Math.abs(targetPose.getRotation().getRadians() - currentPose.getRotation().getRadians());

return xError < 0.1 && yError < 0.1 && thetaError < Math.toRadians(3);
return xError < 0.05 && yError < 0.05 && thetaError < Math.toRadians(3);
}

@Override
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ private void configureDriverButtonBindings() {
.ignoringDisable(true));

m_driver.AIn()
.onTrue(moveToPoseCommand);

m_driver.HIn()
.onTrue(new InstantCommand(() -> CommandScheduler.getInstance().cancel(moveToPoseCommand)));
.whileTrue(moveToPoseCommand);

}
// spotless:on
Expand Down

0 comments on commit 85e1da9

Please sign in to comment.