Skip to content

Commit

Permalink
tested working auto
Browse files Browse the repository at this point in the history
bit jittery
  • Loading branch information
gavinskycastle committed Jan 18, 2025
1 parent f13971d commit d31a015
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/commands/DriveForward.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ public DriveForward(CommandSwerveDrivetrain swerveDrive) {
var point = new SwerveRequest.PointWheelsAt();
var stopRequest = new SwerveRequest.ApplyRobotSpeeds();

// Will throw an exception if the starting pose is not present
var starting_pose = path.getStartingHolonomicPose().orElseThrow();

// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
addCommands(
new InstantCommand( // Reset the pose of the robot to the starting pose of the path
() -> swerveDrive.resetPose(path.getStartingHolonomicPose().isPresent() ? path.getStartingHolonomicPose().get() : null)),
() -> swerveDrive.resetPose(starting_pose)),
new InstantCommand(
() -> swerveDrive.applyRequest(() -> point.withModuleDirection(new Rotation2d())),
swerveDrive)
Expand Down

0 comments on commit d31a015

Please sign in to comment.