goalState = ShooterPhysics.getShotParams(
Translation2d.kZero,
target3d.minus(lookahead3d),
- target == FieldConstants.getHubTranslation().toTranslation2d() ?
- 2.0 : 2.0);
+ 2.0);
- double TOFAdjustment = 0.85;
timeOfFlight = goalState.timeOfFlight() * TOFAdjustment;
double offsetX = turretVelocityX * timeOfFlight;
double offsetY = turretVelocityY * timeOfFlight;
// Spindexer
if (spindexer != null) {
- // Toggle spindexer
- controller.get(PS5Button.LEFT_TRIGGER).onTrue(new InstantCommand(() -> {
- if (spindexerBoolean) {
- spindexer.maxSpindexer();
- spindexerBoolean = false;
- } else {
- spindexer.stopSpindexer();
- spindexerBoolean = true;
- }
- }));
+ // Will only run if we are not calling default shoot command
- controller.get(PS5Button.LEFT_TRIGGER).whileTrue(new RunSpindexer(spindexer));
++ controller.get(PS5Button.LEFT_TRIGGER).whileTrue(new RunSpindexer(spindexer, turret));
}
// Auto shoot