Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/main/deploy/elastic-layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,6 @@
"red_start_time": 15,
"yellow_start_time": 30
}
},
{
"title": "Speed cap",
"x": 0.0,
"y": 384.0,
"width": 512.0,
"height": 256.0,
"type": "Large Text Display",
"properties": {
"topic": "/SmartDashboard/Speed cap",
"period": 0.06,
"data_type": "double"
}
}
]
}
Expand Down
25 changes: 14 additions & 11 deletions src/main/java/raidzero/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ private void configureBindings() {
swerve.setDefaultCommand(
swerve.applyRequest(
() -> fieldCentricDrive
.withVelocityX(-joystick.getLeftY() * MaxSpeed * swerve.getSpeedModifier() * (arm.isUp() ? 0.3 : 1.0))
.withVelocityY(-joystick.getLeftX() * MaxSpeed * swerve.getSpeedModifier() * (arm.isUp() ? 0.3 : 1.0))
.withVelocityX(-joystick.getLeftY() * MaxSpeed * 0.67 * (arm.isUp() ? 0.3 : 1.0))
.withVelocityY(-joystick.getLeftX() * MaxSpeed * 0.67 * (arm.isUp() ? 0.3 : 1.0))
.withRotationalRate(-joystick.getRightX() * MaxAngularRate)
)
);
Expand All @@ -102,6 +102,18 @@ private void configureBindings() {
climbWinch.setDefaultCommand(climbWinch.stop());

// * Driver controls
joystick.rightBumper().whileTrue(
swerve.applyRequest(
() -> fieldCentricDrive
.withVelocityX(-joystick.getLeftY() * MaxSpeed * (arm.isUp() ? 0.3 : 1.0))
.withVelocityY(-joystick.getLeftX() * MaxSpeed * (arm.isUp() ? 0.3 : 1.0))
.withRotationalRate(-joystick.getRightX() * MaxAngularRate)
)
);

joystick.rightBumper().onTrue(new InstantCommand(() -> armStrip.setStrobeInterval(0.15)));
joystick.rightBumper().negate().onTrue(new InstantCommand(() -> armStrip.setStrobeInterval(0.5)));

joystick.a().whileTrue(
swerve.applyRequest(
() -> robotCentricDrive.withVelocityY(slewRateLimiter.calculate(-joystick.getLeftX()) * MaxSpeed * 0.3)
Expand Down Expand Up @@ -134,15 +146,6 @@ private void configureBindings() {
arm.moveWithDelay(Constants.TelescopingArm.Positions.INTAKE_POS_M_BLUE)
);

joystick.rightBumper().onTrue(
new InstantCommand(() -> swerve.setSpeedModifier(1.0))
.andThen(new InstantCommand(() -> armStrip.setStrobeInterval(0.15)))
);
joystick.leftBumper().onTrue(
new InstantCommand(() -> swerve.setSpeedModifier(0.67))
.andThen(new InstantCommand(() -> armStrip.setStrobeInterval(0.50)))
);

// * Operator controls
operator.button(Constants.Bindings.TOP_LEFT).onTrue(new InstantCommand(() -> arm.decreaseIntakeYOffset(0.01), arm));
operator.button(Constants.Bindings.BOTTOM_LEFT).onTrue(new InstantCommand(() -> arm.decreaseIntakeYOffset(-0.01), arm));
Expand Down
22 changes: 0 additions & 22 deletions src/main/java/raidzero/robot/subsystems/drivetrain/Swerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public class Swerve extends TunerSwerveDrivetrain implements Subsystem {

private boolean waypointsTransformed = false;

private double speedModifier = 0.67;

private static Swerve system;

/*
Expand Down Expand Up @@ -391,24 +389,6 @@ public Command stop() {
);
}

/**
* Gets the current modifier for max speed
*
* @return the modifier for max speed
*/
public double getSpeedModifier() {
return speedModifier;
}

/**
* Sets the current modifi9er for max speed
*
* @param speedModifier the modifier for max speed
*/
public void setSpeedModifier(double speedModifier) {
this.speedModifier = speedModifier;
}

@Override
public void periodic() {
/*
Expand Down Expand Up @@ -439,8 +419,6 @@ public void periodic() {
modulePublisher.set(this.getState().ModuleStates);
botpose.set(this.getState().Pose);
field.setRobotPose(this.getState().Pose);

SmartDashboard.putNumber("Speed cap", speedModifier * 100.0);
}

/**
Expand Down