Skip to content

Commit

Permalink
detect joystick type
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin212 committed Jan 26, 2024
1 parent d318eab commit cee8880
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
import frc.robot.subsystems.swerve.SwerveSubsystem;
import frc.robot.subsystems.swerve.TestSingleModuleSwerveSubsystem;


import java.sql.Driver;
import java.util.function.BooleanSupplier;

import com.choreo.lib.Choreo;
import com.choreo.lib.ChoreoTrajectory;

import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
Expand All @@ -32,8 +33,9 @@

public class RobotContainer {
private final BaseSwerveSubsystem baseSwerveSubsystem;

private final BaseDriveController driveController = new DualJoystickDriveController();

// DriverStation.;
private final BaseDriveController driveController;

ChoreoTrajectory traj;
// private final SwerveModule module;
Expand All @@ -47,6 +49,12 @@ public RobotContainer() {

traj = Choreo.getTrajectory("Curve");

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

// Configure the trigger bindings
configureBindings();
}
Expand All @@ -61,6 +69,8 @@ public RobotContainer() {
* joysticks}.
*/
private void configureBindings() {


if(baseSwerveSubsystem instanceof SwerveSubsystem){
final SwerveSubsystem swerveSubsystem = (SwerveSubsystem) baseSwerveSubsystem;

Expand Down

0 comments on commit cee8880

Please sign in to comment.