Skip to content

Commit

Permalink
More code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitkakkar committed Feb 9, 2025
1 parent 92fe7c0 commit b141217
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
23 changes: 8 additions & 15 deletions src/main/java/frc/robot/HeadHoncho.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import frc.robot.subsystems.lift.LiftSubsystem.TargetLiftStates;

public class HeadHoncho extends StateMachine implements AutoCloseable {
public static record Hardware() {}

public enum State implements SystemState {
REST {
@Override
Expand Down Expand Up @@ -249,18 +247,17 @@ public void end(boolean interrupted) {
private static BooleanSupplier s_cancelButton;

public HeadHoncho(
Hardware hardware,
DriveSubsystem drive_subsystem,
IntakeSubsystem intake_subsystem,
LiftSubsystem lift_subsystem,
EndEffectorSubsystem end_effector_subsystem
DriveSubsystem driveSubsystem,
IntakeSubsystem intakeSubsystem,
LiftSubsystem liftSubsystem,
EndEffectorSubsystem endEffectorSubsystem
) {
super(State.REST);

DRIVE_SUBSYSTEM = drive_subsystem;
INTAKE_SUBSYSTEM = intake_subsystem;
LIFT_SUBSYSTEM = lift_subsystem;
END_EFFECTOR_SUBSYSTEM = end_effector_subsystem;
DRIVE_SUBSYSTEM = driveSubsystem;
INTAKE_SUBSYSTEM = intakeSubsystem;
LIFT_SUBSYSTEM = liftSubsystem;
END_EFFECTOR_SUBSYSTEM = endEffectorSubsystem;
}

public void bindControls(
Expand Down Expand Up @@ -289,10 +286,6 @@ public void bindControls(
DRIVE_SUBSYSTEM.bindControls(driveRequest, strafeRequest, rotateRequest);
}

public static Hardware initializeHardware() {
return new Hardware();
}

@Override
public void periodic() {
super.periodic();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class RobotContainer {
private final LiftSubsystem LIFT_SUBSYSTEM = LiftSubsystem.getInstance(LiftSubsystem.initializeHardware());
private final IntakeSubsystem INTAKE_SUBSYSTEM = IntakeSubsystem.getInstance(IntakeSubsystem.initializeHardware());
private final EndEffectorSubsystem END_EFFECTOR_SUBSYSTEM = EndEffectorSubsystem.getInstance(EndEffectorSubsystem.initializeHardware());
private final HeadHoncho HEAD_HONCHO = new HeadHoncho(HeadHoncho.initializeHardware(), DRIVE_SUBSYSTEM, INTAKE_SUBSYSTEM, LIFT_SUBSYSTEM, END_EFFECTOR_SUBSYSTEM);
private final HeadHoncho HEAD_HONCHO = new HeadHoncho(DRIVE_SUBSYSTEM, INTAKE_SUBSYSTEM, LIFT_SUBSYSTEM, END_EFFECTOR_SUBSYSTEM);

public RobotContainer() {
configureBindings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ private Pose2d findAutoAlignTarget() {

/**
* Initialize hardware devices for drive subsystem
*
* @return Hardware object containing all necessary devices for this subsystem
*/
public static Hardware initializeHardware() {
Expand Down

0 comments on commit b141217

Please sign in to comment.