Skip to content

Commit

Permalink
turn boostby to boostMultiplier and simplify
Browse files Browse the repository at this point in the history
calculation simplified by using a calculator, so it has a very low chance of being wrong yey!
  • Loading branch information
kytpbs committed May 31, 2024
1 parent 5f8e750 commit 79f5352
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/subsystems/DriveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@ public void driveWithExtras(
boolean fieldRelative,
boolean rateLimit) {
final double sens = OIConstants.kDriveSensitivity; // The rest will be added by "boost"
final var boostBy = (sens + (boost * (1 - sens)));
final var boostMultiplier = sens * (1 - boost) + boost;
drive(
MathUtil.applyDeadband(xSpeed * boostBy, deadband),
MathUtil.applyDeadband(ySpeed * boostBy, deadband),
MathUtil.applyDeadband(rot * boostBy, deadband),
MathUtil.applyDeadband(xSpeed * boostMultiplier, deadband),
MathUtil.applyDeadband(ySpeed * boostMultiplier, deadband),
MathUtil.applyDeadband(rot * boostMultiplier, deadband),
fieldRelative,
rateLimit);
SmartDashboard.putNumber("xSpeed: ", xSpeed);
Expand Down

0 comments on commit 79f5352

Please sign in to comment.