Skip to content

Commit

Permalink
Fix shooter override & constructor configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Duckett committed Apr 4, 2024
1 parent 65d6195 commit 580994d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
46 changes: 22 additions & 24 deletions src/main/java/frc/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import frc.cmd.*;

public class Robot extends TimedRobot {
public static boolean isRedAlliance;
public static boolean isRedAlliance = false;

SendableChooser<Command> autonomousChooser = new SendableChooser<>();

Expand All @@ -53,35 +53,15 @@ public class Robot extends TimedRobot {
private final Shooter shooter = new Shooter(subsystemsTable);
private final Pivot pivot = new Pivot(subsystemsTable);

// Commands
// public Robot() {
// ! DO NOT USE
// }

// Utilities
static double squareInput(double input) {
return Math.copySign(input * input, input);
}

public Robot() {
// Register alliance
isRedAlliance = DriverStation.getAlliance().filter(a -> a == Alliance.Red).isPresent();
configButtonBindings();
// Add to NetworkTables for verification
SmartDashboard.putBoolean("isRedAlliance", isRedAlliance);

// ------------------- Logging -------------------
DataLogManager.start();
DriverStation.startDataLog(DataLogManager.getLog());

if (isSimulation()) {
DriverStation.silenceJoystickConnectionWarning(true);
}

PortForwarder.add(5800, "photonvision.local", 5800);
configNamedCommands();
autonomousChooser = AutoBuilder.buildAutoChooser();
configAutos();

}

// TODO: add comments
private class Commands {
Command rumble(RumbleType type, double strength, double duration,
Expand Down Expand Up @@ -270,6 +250,24 @@ private void configNamedCommands() {

@Override
public void robotInit() {
// Register alliance
isRedAlliance = DriverStation.getAlliance().filter(a -> a == Alliance.Red).isPresent();
// Add to NetworkTables for verification
SmartDashboard.putBoolean("isRedAlliance", isRedAlliance);
configButtonBindings();

// ------------------- Logging -------------------
DataLogManager.start();
DriverStation.startDataLog(DataLogManager.getLog());

if (isSimulation()) {
DriverStation.silenceJoystickConnectionWarning(true);
}

PortForwarder.add(5800, "photonvision.local", 5800);
configNamedCommands();
autonomousChooser = AutoBuilder.buildAutoChooser();
configAutos();
}

@Override
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/frc/system/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public class Shooter implements LoggedSubsystems {
/** the sub table where all logging for Shooter should go */
private final NetworkTable shooterTable;

/** the speed for shooting in Speaker */
public double speakerSpeed;

private final DoublePublisher setShooterSpeed;
// Vars
/** The maximum voltage to apply to the shooter motors. */
Expand All @@ -37,7 +34,7 @@ public class Shooter implements LoggedSubsystems {
/** the max RMP of the shooting wheals */
private final double maxShooterSpeed = 6000;
/** the default Speaker RMP for shooting */
private final double defaultSpeakerSpeed = 5000;
private final double speakerSpeed = 5000;
/** amount of acceptable error for shooter in RPM */
private final double deadBand = 250;

Expand Down

0 comments on commit 580994d

Please sign in to comment.