Skip to content

Commit

Permalink
Purge Nike code
Browse files Browse the repository at this point in the history
  • Loading branch information
Anhysteretic committed Nov 5, 2024
1 parent ae23278 commit aa407b9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 209 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/team841/calliope/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class Robot extends LoggedRobot {
private Command m_autonomousCommand;

private final DigitalInput intakeSensor = new DigitalInput(RC.robot == RC.Robot.CALLIOPE ? 0 : 2);
private final DigitalInput intakeSensor = new DigitalInput(0);

public static RobotContainer m_robotContainer;

Expand Down
51 changes: 12 additions & 39 deletions src/main/java/com/team841/calliope/RobotContainer.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.team841.calliope;

import com.ctre.phoenix6.Utils;
import com.ctre.phoenix6.mechanisms.swerve.SwerveModule;
import com.ctre.phoenix6.mechanisms.swerve.SwerveRequest;
import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.auto.NamedCommands;
import com.team841.calliope.constants.RC;
import com.team841.calliope.constants.Swerve;
import com.team841.calliope.constants.SwerveNike;
import com.team841.calliope.drive.BioDrive;
import com.team841.calliope.drive.Drivetrain;
import com.team841.calliope.superstructure.Shoot;
Expand All @@ -30,12 +28,9 @@
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.*;
import edu.wpi.first.wpilibj2.command.button.CommandGenericHID;
import edu.wpi.first.wpilibj2.command.button.CommandPS5Controller;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;

import static com.team841.calliope.constants.Swerve.DrivetrainConstants;

public class RobotContainer {

public final Drivetrain drivetrain;
Expand Down Expand Up @@ -96,10 +91,7 @@ public static RobotContainer getInstance() {
public RobotContainer() {
switch (RC.robotType) {
default -> {
if (RC.robot == RC.Robot.CALLIOPE)
this.drivetrain = new Drivetrain(Swerve.DrivetrainConstants, Swerve.FrontLeft, Swerve.FrontRight, Swerve.BackLeft, Swerve.BackRight);
else
this.drivetrain = new Drivetrain(SwerveNike.DrivetrainConstants, SwerveNike.FrontLeft, SwerveNike.FrontRight, SwerveNike.BackLeft, SwerveNike.BackRight);
this.drivetrain = new Drivetrain(Swerve.DrivetrainConstants, Swerve.FrontLeft, Swerve.FrontRight, Swerve.BackLeft, Swerve.BackRight);

this.shooterIO = new ShooterIOTalonFX();
this.shooter = new Shooter(this.shooterIO);
Expand All @@ -120,32 +112,17 @@ public RobotContainer() {

registerNamedCommands();

this.sticksPS5 = new CommandPS5Controller[1];
this.sticksXbox = new CommandXboxController[1];
this.sticksPS5[0] = new CommandPS5Controller(RC.Controllers.duoStickDrive);
this.sticksXbox[0] = new CommandXboxController(RC.Controllers.duoStickCoDrive);

if (RC.robot == RC.Robot.NIKE){
this.sticksXbox = new CommandXboxController[1];
this.sticksPS5 = new CommandPS5Controller[1];
this.sticksXbox[0] = new CommandXboxController(RC.Controllers.soloStick);

this.bioDrive = new BioDrive(
this.drivetrain,
() -> -sticksXbox[0].getLeftY() * Swerve.MaxSpeed,
() -> -sticksXbox[0].getLeftX() * Swerve.MaxSpeed,
() -> -sticksXbox[0].getRightX() * Swerve.MaxAngularRate,
() -> sticksXbox[0].a().getAsBoolean());

} else {
this.sticksPS5 = new CommandPS5Controller[1];
this.sticksXbox = new CommandXboxController[1];
this.sticksPS5[0] = new CommandPS5Controller(RC.Controllers.duoStickDrive);
this.sticksXbox[0] = new CommandXboxController(RC.Controllers.duoStickCoDrive);

this.bioDrive = new BioDrive(
this.drivetrain,
() -> -sticksPS5[0].getLeftY() * Swerve.MaxSpeed,
() -> -sticksPS5[0].getLeftX() * Swerve.MaxSpeed,
() -> -sticksPS5[0].getRightX() * Swerve.MaxAngularRate,
() -> sticksPS5[0].L2().getAsBoolean());
}
this.bioDrive = new BioDrive(
this.drivetrain,
() -> -sticksPS5[0].getLeftY() * Swerve.MaxSpeed,
() -> -sticksPS5[0].getLeftX() * Swerve.MaxSpeed,
() -> -sticksPS5[0].getRightX() * Swerve.MaxAngularRate,
() -> sticksPS5[0].L2().getAsBoolean());

this.feedback = new Feedback(this.sticksXbox[0]);

Expand All @@ -163,11 +140,7 @@ public RobotContainer() {

this.drivetrain.setDefaultCommand(bioDrive);

if (RC.robot == RC.Robot.NIKE){
configureSoloStick();
} else {
configureDuoStick();
}
configureDuoStick();
}


Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/team841/calliope/constants/RC.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public class RC {

public static final RunType robotType = RunType.COMP;

public static Robot robot = Robot.CALLIOPE;

public static boolean motorsAreWorking = true;

public static class Controllers {
Expand Down Expand Up @@ -53,8 +51,4 @@ public enum RunType{
REPLAY
}

public enum Robot{
CALLIOPE,
NIKE
}
}
163 changes: 0 additions & 163 deletions src/main/java/com/team841/calliope/constants/SwerveNike.java

This file was deleted.

0 comments on commit aa407b9

Please sign in to comment.