Skip to content

Commit 0980571

Browse files
Nominal velocity when active
1 parent d3bba56 commit 0980571

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import static edu.wpi.first.units.Units.Meters;
1010
import static edu.wpi.first.units.Units.MetersPerSecond;
1111
import static edu.wpi.first.units.Units.RadiansPerSecond;
12+
import static edu.wpi.first.units.Units.RotationsPerSecond;
1213

1314
import java.lang.StackWalker.Option;
1415
import java.util.Arrays;
@@ -303,7 +304,10 @@ private void configureBindings() {
303304
.whileTrue(RobotCommands.shoot(shooter_, hopper_, intake_, drivebase_));
304305

305306
// When the shooter isnt shooting, get it ready to shoot.
306-
shooter_.setDefaultCommand(shooter_.idleCommand());
307+
shooter_.setDefaultCommand(shooter_.spinUpVelocityCommand(() -> {
308+
var shift = HubShiftUtil.getOfficialShiftInfo();
309+
return shift.active() ? RotationsPerSecond.of(50) : RotationsPerSecond.zero();
310+
}));
307311

308312
//While the X button is held, the intake will run the eject sequence. If it the intake is stowed, it will also deploy it.
309313

src/main/java/frc/robot/subsystems/shooter/Shooter.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,12 @@ public Command ejectUp() {
327327
return startEnd(() -> setShooterVelocity(ShooterConstants.ejectVelocity), this::stopShooter);
328328
}
329329

330-
/**
331-
* Idles the shooter at 0 velocity and the hood at the parked position.
332-
* @return
333-
*/
334-
public Command idleCommand() {
335-
return runToSetpointsCmd(
336-
RotationsPerSecond.of(0.0),
337-
ShooterConstants.hoodParkedAngle
338-
);
330+
public Command spinUpSetpointsCommand(Supplier<AngularVelocity> velocity, Angle hoodAngle) {
331+
return run(() -> setSetpoints(velocity.get(), hoodAngle));
332+
}
333+
334+
public Command spinUpSetpointsCommand(Supplier<AngularVelocity> velocity) {
335+
return run(() -> setSetpoints(velocity.get(), ShooterConstants.hoodParkedAngle));
339336
}
340337

341338
/**

0 commit comments

Comments
 (0)