Skip to content

Commit

Permalink
remove a couple things you know how it is
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob1010-h committed Dec 7, 2023
1 parent 295adf4 commit 3724e71
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void configureButtonBindings() {
Make a trigger so then when the current GAME_MODE is equal to AUTONOMOUS then set the drive speed to MAX_SPEED_METERS_PER_SECOND

// (Explain this)
driver.start().or(driver.back()).onTrue(
driver.y().or(driver.x()).onTrue(
Commands.runOnce(() -> swerve.resetOdometry(
new Pose2d(
swerve.getPose().getTranslation(),
Expand All @@ -87,6 +87,8 @@ private void configureButtonBindings() {
: 180))),
swerve));

when the driver hits the "x" button, use the setWheelsX method in swerve.java
Create a trigger like the one above so that while the "a" button is been pressed, set the drive speed to ALIGNMENT_SPEED
and when the "a" button has not been pressed, set the drive speed to MAX_TELEOP_SPEED_METERS_PER_SECOND

Expand Down
6 changes: 1 addition & 5 deletions src/main/java/frc/robot/commands/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ public void execute() {
x *= -1;
y *= -1;
}
swerve.drive(
x,
y,
rotationSupplier.getAsDouble(),
fieldRelativeSupplier.getAsBoolean());
use the following variables to drive the swerve using swerve.drive
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/SwerveTrajectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void execute() {

PathPlannerState state = (PathPlannerState) trajectory.sample(elapsedTime.get());

// Use elapsedTime as a refrence for where we NEED to be
// Use elapsedTime as a reference for where we NEED to be
// Then, sample the position and rotation for that time,
// And calculate the ChassisSpeeds required to get there
ChassisSpeeds speeds = AutoConstants.HDC.calculate(
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/frc/robot/subsystems/Swerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,11 @@ public void drive(double xSpeed, double ySpeed, double rotSpeed, boolean fieldRe
ySpeed *= (DriveConstants.MAX_SPEED_METERS_PER_SECOND * speedMultiplier);
rotSpeed *= (DriveConstants.DYNAMIC_MAX_ANGULAR_SPEED * speedMultiplier);

SwerveModuleState[] swerveModuleStates = DriveConstants.DRIVE_KINEMATICS.toSwerveModuleStates(
fieldRelative
? discretize(ChassisSpeeds.fromFieldRelativeSpeeds(xSpeed, ySpeed, rotSpeed,
getPose().getRotation()))
: discretize(new ChassisSpeeds(xSpeed, ySpeed, rotSpeed)));
SwerveModuleState[] swerveModuleStates =
DriveConstants.DRIVE_KINEMATICS.toSwerveModuleStates(

);

setModuleStates(swerveModuleStates);
}

Expand Down Expand Up @@ -206,7 +205,7 @@ public void setWheelsX() {
rearRight.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(-45)));
}

public Command getSetWheelsX() {
public Command getSetWheelsXCommand() {
return runOnce(this::setWheelsX);
}

Expand Down

0 comments on commit 3724e71

Please sign in to comment.