diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2756f2f..c7a18fc 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -1,5 +1,6 @@ package frc.robot; +import org.littletonrobotics.conduit.schema.Joystick; import edu.wpi.first.wpilibj.GenericHID; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; @@ -7,7 +8,6 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.InstantCommand; import edu.wpi.first.wpilibj2.command.WaitCommand; -import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import frc.robot.Robot.RobotRunType; import frc.robot.subsystems.drive.Drivetrain; import frc.robot.subsystems.drive.DrivetrainIO; @@ -21,15 +21,14 @@ */ public class RobotContainer { /* Controllers */ - private final CommandXboxController driver = new CommandXboxController(Constants.driverID); - private final CommandXboxController operator = new CommandXboxController(Constants.operatorID); - + Joystick driver = new Joystick(); // Initialize AutoChooser Sendable private final SendableChooser autoChooser = new SendableChooser<>(); /* Subsystems */ private Drivetrain drivetrain; + /** * The container for the robot. Contains subsystems, OI devices, and commands. */ diff --git a/src/main/java/frc/robot/subsystems/drive/Drivetrain.java b/src/main/java/frc/robot/subsystems/drive/Drivetrain.java index 1cb4e93..ed9d6b5 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drivetrain.java +++ b/src/main/java/frc/robot/subsystems/drive/Drivetrain.java @@ -2,7 +2,6 @@ import org.littletonrobotics.junction.Logger; import edu.wpi.first.wpilibj2.command.SubsystemBase; -import edu.wpi.first.wpilibj2.command.button.CommandXboxController; /** * Drivetrain subsystem. @@ -11,24 +10,22 @@ public class Drivetrain extends SubsystemBase { private DrivetrainIO io; private DrivetrainIOInputsAutoLogged inputs = new DrivetrainIOInputsAutoLogged(); - private CommandXboxController driver; /** * Create Wrist Intake Subsystem */ - public Drivetrain(DrivetrainIO iop, CommandXboxController driverp) { - this.io = iop; - io.updateInputs(inputs); - + public Drivetrain(DrivetrainIO io) { + this.io = io; } @Override public void periodic() { io.updateInputs(inputs); Logger.processInputs("Drivetrain", inputs); + } - double driverY = driver.getLeftY(); - double driverX = driver.getRightY(); + public void setPower(double lPower, double rPower) { + io.setDriveVoltage(lPower, rPower); } } diff --git a/src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java b/src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java index 95de9f6..2acfeed 100644 --- a/src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java +++ b/src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java @@ -22,6 +22,7 @@ public DrivetrainReal() { FRMotor.addFollower(BRMotor); FRMotor.setInverted(true); + BRMotor.setInverted(true); }