Skip to content

Commit

Permalink
Feat: reinitialize heading goal instead of constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
GearBoxFox committed Mar 28, 2024
1 parent e444a7b commit a672ea5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/frc/robot/commands/JoystickDriveCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public JoystickDriveCommand(DriveSubsystem driveSubsystem,
addRequirements(this.driveSubsystem);
}

@Override
public void initialize() {
m_headingGoal = driveSubsystem.getGyroRotation();
}

@Override
public void execute() {
double xInput = setSensitivity(xSupplier.getAsDouble(), 0.25);
Expand Down Expand Up @@ -88,10 +93,6 @@ public void execute() {
}
}

if (!Constants.DriveConstants.HOLD_HEADING.getValue()) {
rotationOutput = omegaInput;
}

Rotation2d heading;

// if red change heading goal
Expand Down

0 comments on commit a672ea5

Please sign in to comment.