Skip to content

Commit

Permalink
add new drive pace for rotated robot relative control
Browse files Browse the repository at this point in the history
  • Loading branch information
bobsfriend12 committed Mar 4, 2025
1 parent 0db9633 commit 97e9f6b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/main/java/team/gif/lib/drivePace.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
public enum drivePace {
COAST_FR(Constants.Drivetrain.COAST_SPEED_METERS_PER_SECOND, true),
COAST_RR(Constants.Drivetrain.COAST_SPEED_METERS_PER_SECOND, false),
COAST_ROT(Constants.Drivetrain.COAST_SPEED_METERS_PER_SECOND, false),
SLOW_FR(Constants.Drivetrain.SLOW_SPEED_METERS_PER_SECOND, true),
SLOW_RR(Constants.Drivetrain.SLOW_SPEED_METERS_PER_SECOND, false),
BOOST_FR(Constants.Drivetrain.BOOST_SPEED_METERS_PER_SECOND, true),
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/team/gif/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import team.gif.robot.commands.climber.ClimberDeploy;
import team.gif.robot.commands.climber.ClimberClimb;
import team.gif.robot.commands.climber.PistonToggleState;
import team.gif.robot.commands.driveModes.EnableRobotOrientedMode;
import team.gif.robot.commands.driveModes.EnableRotatedMode;
import team.gif.robot.commands.drivetrain.Reset180;
import team.gif.robot.commands.elevator.SetElevatorPosition;
import team.gif.robot.commands.shooter.Shoot;
Expand Down Expand Up @@ -123,7 +123,7 @@ public OI() {
dLBump.whileTrue(new EnableBoost());
dX.whileTrue(new AutoDriveAndShoot(false));
dB.whileTrue(new AutoDriveAndShoot(true));
dRBump.whileTrue(new EnableRobotOrientedMode());
dRBump.whileTrue(new EnableRotatedMode());

// aux controls
aStart.and(aDPadUp).onTrue(new Reset0());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import team.gif.lib.drivePace;
import team.gif.robot.Robot;

public class EnableRobotOrientedMode extends Command {
public class EnableRotatedMode extends Command {

public EnableRobotOrientedMode() {
public EnableRotatedMode() {
super();
//addRequirements(Robot.climber); // uncomment
}
Expand All @@ -16,7 +16,7 @@ public EnableRobotOrientedMode() {
@Override
public void initialize() {
System.out.println("Robot Oriented Enabled w/ " + DriverStation.getMatchTime() + " remaining");
Robot.swerveDrive.setDrivePace(drivePace.COAST_RR);
Robot.swerveDrive.setDrivePace(drivePace.COAST_ROT);
}

// Called every time the scheduler runs (~20ms) while the command is scheduled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void execute() {

// During robot oriented mode (_RR), make climber the front of the bot (rotate forward and strafe 90 degrees)
// This only occurs when using joysticks since DriveSwerve is for joystick response
if (Robot.swerveDrive.getDrivePace() == drivePace.COAST_RR) {
if (Robot.swerveDrive.getDrivePace() == drivePace.COAST_ROT) {
double forwardStore = forward;
double strafeStore = strafe;
forward = -strafeStore;
Expand Down

0 comments on commit 97e9f6b

Please sign in to comment.