Skip to content

Commit 3724e71

Browse files
committed
remove a couple things you know how it is
1 parent 295adf4 commit 3724e71

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/main/java/frc/robot/RobotContainer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private void configureButtonBindings() {
7777
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
7878

7979
// (Explain this)
80-
driver.start().or(driver.back()).onTrue(
80+
driver.y().or(driver.x()).onTrue(
8181
Commands.runOnce(() -> swerve.resetOdometry(
8282
new Pose2d(
8383
swerve.getPose().getTranslation(),
@@ -87,6 +87,8 @@ private void configureButtonBindings() {
8787
: 180))),
8888
swerve));
8989

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

src/main/java/frc/robot/commands/Drive.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ public void execute() {
6666
x *= -1;
6767
y *= -1;
6868
}
69-
swerve.drive(
70-
x,
71-
y,
72-
rotationSupplier.getAsDouble(),
73-
fieldRelativeSupplier.getAsBoolean());
69+
use the following variables to drive the swerve using swerve.drive
7470
}
7571

7672
@Override

src/main/java/frc/robot/commands/SwerveTrajectory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void execute() {
3838

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

41-
// Use elapsedTime as a refrence for where we NEED to be
41+
// Use elapsedTime as a reference for where we NEED to be
4242
// Then, sample the position and rotation for that time,
4343
// And calculate the ChassisSpeeds required to get there
4444
ChassisSpeeds speeds = AutoConstants.HDC.calculate(

src/main/java/frc/robot/subsystems/Swerve.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,11 @@ public void drive(double xSpeed, double ySpeed, double rotSpeed, boolean fieldRe
147147
ySpeed *= (DriveConstants.MAX_SPEED_METERS_PER_SECOND * speedMultiplier);
148148
rotSpeed *= (DriveConstants.DYNAMIC_MAX_ANGULAR_SPEED * speedMultiplier);
149149

150-
SwerveModuleState[] swerveModuleStates = DriveConstants.DRIVE_KINEMATICS.toSwerveModuleStates(
151-
fieldRelative
152-
? discretize(ChassisSpeeds.fromFieldRelativeSpeeds(xSpeed, ySpeed, rotSpeed,
153-
getPose().getRotation()))
154-
: discretize(new ChassisSpeeds(xSpeed, ySpeed, rotSpeed)));
150+
SwerveModuleState[] swerveModuleStates =
151+
DriveConstants.DRIVE_KINEMATICS.toSwerveModuleStates(
155152

153+
);
154+
156155
setModuleStates(swerveModuleStates);
157156
}
158157

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

209-
public Command getSetWheelsX() {
208+
public Command getSetWheelsXCommand() {
210209
return runOnce(this::setWheelsX);
211210
}
212211

0 commit comments

Comments
 (0)