Skip to content

Commit

Permalink
added automatic detection of of controller
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin212 committed Feb 7, 2024
1 parent bee0174 commit 3720b0a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj2.command.Command;
Expand Down Expand Up @@ -77,6 +78,9 @@ public class RobotContainer {
private final ElevatorSubsystem elevatorSubsystem;

private final LEDSubsystem ledSubsystem = new LEDSubsystem();


// Configure the trigger bindings

private final XboxController mechController = new XboxController(2);
private final JoystickButton aButton = new JoystickButton(mechController, XboxController.Button.kA.value);
Expand Down Expand Up @@ -112,7 +116,12 @@ public RobotContainer() {
climbSubsystem = new ClimbSubsystem();

elevatorSubsystem = new ElevatorSubsystem();
driveController = new DualJoystickDriveController();

if(DriverStation.getJoystickName(0).equals("Cyborg V.1")){
driveController = new DualJoystickDriveController();
} else {
driveController = new XboxDriveController();
}

traj = Choreo.getTrajectory("Curve");

Expand Down

0 comments on commit 3720b0a

Please sign in to comment.