diff --git a/.SysId/sysid-window.json b/.SysId/sysid-window.json new file mode 100644 index 0000000..433f0f0 --- /dev/null +++ b/.SysId/sysid-window.json @@ -0,0 +1,45 @@ +{ + "MainWindow": { + "GLOBAL": { + "height": "720", + "maximized": "1", + "style": "0", + "userScale": "2", + "width": "1280", + "xpos": "0", + "ypos": "23" + } + }, + "Window": { + "###Analyzer": { + "Collapsed": "0", + "Pos": "527,18", + "Size": "606,876" + }, + "###Generator": { + "Collapsed": "0", + "Pos": "-1,18", + "Size": "531,269" + }, + "###Logger": { + "Collapsed": "0", + "Pos": "-1,286", + "Size": "530,732" + }, + "###Program Log": { + "Collapsed": "0", + "Pos": "527,893", + "Size": "605,125" + }, + "Debug##Default": { + "Collapsed": "0", + "Pos": "60,60", + "Size": "400,400" + }, + "Diagnostic Plots": { + "Collapsed": "0", + "Pos": "1131,17", + "Size": "790,1000" + } + } +} diff --git a/.SysId/sysid.json b/.SysId/sysid.json new file mode 100644 index 0000000..de74a00 --- /dev/null +++ b/.SysId/sysid.json @@ -0,0 +1,5 @@ +{ + "SysId": { + "Analysis Type": "General Mechanism" + } +} diff --git a/shuffleboard.json b/shuffleboard.json new file mode 100644 index 0000000..45a7099 --- /dev/null +++ b/shuffleboard.json @@ -0,0 +1,255 @@ +{ + "tabPane": [ + { + "title": "Auto station", + "autoPopulate": false, + "autoPopulatePrefix": "", + "widgetPane": { + "gridSize": 64.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "0,2": { + "size": [ + 5, + 3 + ], + "content": { + "_type": "ComboBox Chooser", + "_source0": "network_table:///SmartDashboard/SendableChooser[3]", + "_title": "Auto Mode" + } + }, + "0,5": { + "size": [ + 5, + 3 + ], + "content": { + "_type": "ComboBox Chooser", + "_source0": "network_table:///SmartDashboard/SendableChooser[4]", + "_title": "Drive Controller" + } + }, + "0,8": { + "size": [ + 5, + 3 + ], + "content": { + "_type": "ComboBox Chooser", + "_source0": "network_table:///SmartDashboard/SendableChooser[5]", + "_title": "Operator Controller" + } + }, + "5,8": { + "size": [ + 7, + 3 + ], + "content": { + "_type": "Boolean Box", + "_title": "Auto steer", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,5": { + "size": [ + 7, + 3 + ], + "content": { + "_type": "Boolean Box", + "_title": "Ball in sight", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,2": { + "size": [ + 7, + 3 + ], + "content": { + "_type": "Boolean Box", + "_title": "In climbing mode", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + } + } + } + }, + { + "title": "debug", + "autoPopulate": false, + "autoPopulatePrefix": "", + "widgetPane": { + "gridSize": 128.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "0,2": { + "size": [ + 3, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Encoder", + "_title": "Left encoder" + } + }, + "0,1": { + "size": [ + 3, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Encoder", + "_title": "Right encoder" + } + }, + "6,1": { + "size": [ + 3, + 3 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///LiveWindow/Ungrouped/ADXRS450_Gyro[0]", + "_title": "Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "9,1": { + "size": [ + 4, + 5 + ], + "content": { + "_type": "PDP", + "_source0": "network_table:///SmartDashboard/power panel", + "_title": "Power panel", + "Visuals/Show voltage and current values": true + } + }, + "0,4": { + "size": [ + 3, + 1 + ], + "content": { + "_type": "Number Bar", + "_title": "Climber", + "Range/Min": -1.0, + "Range/Max": 1.0, + "Range/Center": 0.0, + "Visuals/Num tick marks": 5, + "Visuals/Show text": true + } + }, + "0,3": { + "size": [ + 3, + 1 + ], + "content": { + "_type": "Number Bar", + "_title": "Arm (In \u0026 Out)", + "Range/Min": -1.0, + "Range/Max": 1.0, + "Range/Center": 0.0, + "Visuals/Num tick marks": 5, + "Visuals/Show text": true + } + }, + "3,1": { + "size": [ + 3, + 3 + ], + "content": { + "_type": "Gyro", + "_title": "Shoulder", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "3,4": { + "size": [ + 3, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/In Auto", + "_title": "/SmartDashboard/In Auto", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "6,4": { + "size": [ + 3, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/In Teleop", + "_title": "/SmartDashboard/In Teleop", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "0,5": { + "size": [ + 3, + 1 + ], + "content": { + "_type": "Voltage View", + "_source0": "network_table:///SmartDashboard/battery", + "_title": "battery", + "Range/Min": 0.0, + "Range/Max": 15.0, + "Range/Center": 0.0, + "Visuals/Orientation": "HORIZONTAL", + "Visuals/Number of tick marks": 5 + } + }, + "3,5": { + "size": [ + 6, + 1 + ], + "content": { + "_type": "3-Axis Accelerometer", + "_source0": "network_table:///LiveWindow/Ungrouped/BuiltInAccel[0]", + "_title": "3-Axis Accelerometer", + "Accelerometer/Range": "k16G", + "Visuals/Show value": true, + "Visuals/Precision": 2, + "Visuals/Show tick marks": false + } + } + } + } + } + ], + "windowGeometry": { + "x": -8.0, + "y": -8.0, + "width": 1936.0, + "height": 1056.0 + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/OI/JoystickController.java b/src/main/java/frc/robot/OI/JoystickController.java index f59e45e..52726f1 100644 --- a/src/main/java/frc/robot/OI/JoystickController.java +++ b/src/main/java/frc/robot/OI/JoystickController.java @@ -34,7 +34,6 @@ public static synchronized JoystickController getInstance() { button11_L = new JoystickButton(leftJoy, 11); public double getZJoyStick_L() { return leftJoy.getZ(); - } public double getXJoyStick_L() { return leftJoy.getX(); diff --git a/src/main/java/frc/robot/OI/OperatorInterface.java b/src/main/java/frc/robot/OI/OperatorInterface.java index ea1778a..b7b68c0 100644 --- a/src/main/java/frc/robot/OI/OperatorInterface.java +++ b/src/main/java/frc/robot/OI/OperatorInterface.java @@ -10,12 +10,17 @@ import frc.robot.util.LatchedBoolean; public class OperatorInterface { + private static OperatorInterface mInstance; - + int driveControllerInUse = 0; + int operatorControllerInUse = 0; // Instances of the Driver and Operator Controller - private XboxController DriverController; - private NykoController OperatorController; + private XboxController xbox1; + private XboxController xbox2; + private NykoController Nyko1; private JoystickController joysticks; + private Wheel wheel; + private uselessController controllerThing; public static synchronized OperatorInterface getInstance() { if (mInstance == null) { mInstance = new OperatorInterface(); @@ -24,17 +29,59 @@ public static synchronized OperatorInterface getInstance() { } private OperatorInterface() { - DriverController = new XboxController(Constants.Controllers.Driver.port); - OperatorController = new NykoController(Constants.Controllers.Operator.port); - //joysticks = JoystickController.getInstance(); + xbox2 = new XboxController(Constants.Controllers.Operator.port); + xbox1 = new XboxController(Constants.Controllers.Driver.port); + //Nyko1 = new NykoController(Constants.Controllers.Operator.port); + joysticks = JoystickController.getInstance(); + wheel = Wheel.getInstance(); + controllerThing = uselessController.getInstance(); + } + public void setDriveControllerInUse(int value) { + driveControllerInUse = value; + } + public int getDriveControllerInUse() { + return driveControllerInUse; + } + public void setOperatorControllerInUse(int value) { + operatorControllerInUse = value; + } + public int getOperatorControllerInUse() { + return operatorControllerInUse; } - public double getDriveThrottle() { - return DriverController.getJoystick(XboxController.Side.LEFT, XboxController.Axis.Y); + if (driveControllerInUse == 0){ + return xbox1.getJoystick(XboxController.Side.LEFT, XboxController.Axis.Y); + } + if (driveControllerInUse == 1){ + return joysticks.getYJoyStick_L(); + } + if (driveControllerInUse == 2){ + return wheel.getYWheel(); + } + if (driveControllerInUse == 3){ + return controllerThing.getY_thing(); + } + return 0; } public double getDriveTurn() { - return DriverController.getJoystick(XboxController.Side.RIGHT, XboxController.Axis.X); + if (driveControllerInUse == 0) { + return xbox1.getJoystick(XboxController.Side.RIGHT, XboxController.Axis.X); + } + if (driveControllerInUse == 1) { + return joysticks.getXJoyStick_R(); + } + if (driveControllerInUse == 2){ + return wheel.getXWheel(); + } + if (driveControllerInUse == 3){ + return controllerThing.getX_thing(); + } + return 0; } + //Add functions for the operator controller + + + } diff --git a/src/main/java/frc/robot/OI/Wheel.java b/src/main/java/frc/robot/OI/Wheel.java new file mode 100644 index 0000000..9dadfd0 --- /dev/null +++ b/src/main/java/frc/robot/OI/Wheel.java @@ -0,0 +1,126 @@ +package frc.robot.OI; + +import edu.wpi.first.wpilibj.TimedRobot; +import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import edu.wpi.first.wpilibj.Joystick; +import edu.wpi.first.wpilibj.Joystick.ButtonType; +import edu.wpi.first.wpilibj.Joystick.AxisType; +import edu.wpi.first.wpilibj.buttons.JoystickButton; + +public class Wheel { + + private static Wheel mInstance; + + public static synchronized Wheel getInstance() { + if (mInstance == null) { + mInstance = new Wheel(); + } + return mInstance; + } + + Joystick wheel = new Joystick(5); + JoystickButton button1_W = new JoystickButton(wheel, 1), + button2_W = new JoystickButton(wheel, 2), + button3_W = new JoystickButton(wheel, 3), + button4_W = new JoystickButton(wheel, 4), + button5_W = new JoystickButton(wheel, 5), + button6_W = new JoystickButton(wheel, 6), + button7_W = new JoystickButton(wheel, 7), + button8_W = new JoystickButton(wheel, 8), + button9_W = new JoystickButton(wheel, 9), + button10_W = new JoystickButton(wheel, 10), + button11_W = new JoystickButton(wheel, 11), + button12_W = new JoystickButton(wheel, 12); + + public double getXWheel() { + return wheel.getX(); + } + public double getYWheel() { + return wheel.getY(); + } + + public boolean isButton1Pressed_W() { + if (button1_W.get()){ + return true; + } + return false; + } + + public boolean isButton2Pressed_W() { + if (button2_W.get()){ + return true; + } + return false; + } + + public boolean isButton3Pressed_W() { + if (button3_W.get()){ + return true; + } + return false; + } + + public boolean isButton4Pressed_W() { + if (button4_W.get()){ + return true; + } + return false; + } + + public boolean isButton5Pressed_W() { + if (button5_W.get()){ + return true; + } + return false; + } + + public boolean isButton6Pressed_W() { + if (button6_W.get()){ + return true; + } + return false; + } + + public boolean isButton7Pressed_W() { + if (button7_W.get()){ + return true; + } + return false; + } + + public boolean isButton8Pressed_W() { + if (button8_W.get()){ + return true; + } + return false; + } + + public boolean isButton9Pressed_W() { + if (button9_W.get()){ + return true; + } + return false; + } + + public boolean isButton10Pressed_W() { + if (button10_W.get()){ + return true; + } + return false; + } + + public boolean isButton11Pressed_W() { + if (button11_W.get()){ + return true; + } + return false; + } + + public boolean isButton12Pressed_W() { + if (button12_W.get()){ + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/OI/uselessController.java b/src/main/java/frc/robot/OI/uselessController.java new file mode 100644 index 0000000..b32a8b1 --- /dev/null +++ b/src/main/java/frc/robot/OI/uselessController.java @@ -0,0 +1,29 @@ +package frc.robot.OI; + +import edu.wpi.first.wpilibj.TimedRobot; +import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import edu.wpi.first.wpilibj.Joystick; +import edu.wpi.first.wpilibj.Joystick.ButtonType; +import edu.wpi.first.wpilibj.Joystick.AxisType; +import edu.wpi.first.wpilibj.buttons.JoystickButton; + +public class uselessController { + private static uselessController mInstance; + + public static synchronized uselessController getInstance() { + if (mInstance == null) { + mInstance = new uselessController(); + } + return mInstance; + } + + Joystick controllerThing = new Joystick(4); + + public double getX_thing() { + return controllerThing.getX(); + } +public double getY_thing() { + return controllerThing.getY(); + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 464b2ab..5abbd47 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -4,7 +4,9 @@ package frc.robot; +import edu.wpi.first.wpilibj.RobotController; import edu.wpi.first.wpilibj.TimedRobot; +import edu.wpi.first.wpilibj.interfaces.Accelerometer; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import frc.robot.OI.OperatorInterface; @@ -13,8 +15,14 @@ import frc.robot.auto.modes.AutoModeBase; import frc.robot.auto.modes.DoNothingMode; import frc.robot.auto.modes.TestDriveMode; - - +import frc.robot.auto.modes.ControllerModeBase; +import frc.robot.auto.modes.JoysticksMode; +import frc.robot.auto.modes.XboxControllermode; +import frc.robot.Constants.Controllers.Operator; +import frc.robot.Constants; +import frc.robot.OI.XboxController.Button; +import edu.wpi.first.wpilibj.BuiltInAccelerometer; +import edu.wpi.first.wpilibj.PowerDistributionPanel; /** * The VM is configured to automatically run this class, and to call the functions corresponding to * each mode, as described in the TimedRobot documentation. If you change the name of this class or @@ -37,6 +45,20 @@ public class Robot extends TimedRobot { // Autonomous Modes private SendableChooser mAutoModes; + // Driver Controller Modes + private SendableChooser mDriverControllerModes; + + // Operator Controller Modes + private SendableChooser mOperatorControllerModes; + + private boolean inAutoMode = false; + private boolean inTeleop = false; + private PowerDistributionPanel powerPanel = new PowerDistributionPanel(0); + private Accelerometer accelerometer = new BuiltInAccelerometer(); + + private double accelX = accelerometer.getX(); + private double accelY = accelerometer.getY(); + private double accelZ = accelerometer.getZ(); /** * This function is run when the robot is first started up and should be used for any * initialization code. @@ -44,6 +66,8 @@ public class Robot extends TimedRobot { @Override public void robotInit() { SendableChooser mAutoModes = new SendableChooser<>(); + SendableChooser mDriverControllerModes = new SendableChooser<>(); + SendableChooser mOperatorControllerModes = new SendableChooser<>(); // populate autonomous list populateAutonomousModes(); } @@ -54,6 +78,18 @@ private void populateAutonomousModes(){ mAutoModes.setDefaultOption("Nothing", new DoNothingMode()); mAutoModes.addOption("Test Drive", new TestDriveMode()); SmartDashboard.putData(mAutoModes); + mDriverControllerModes = new SendableChooser(); + mDriverControllerModes.setDefaultOption("Xbox Controller(Driver)", 0); + mDriverControllerModes.addOption("Joysticks(Driver)", 1); + mDriverControllerModes.addOption("Wheel(Driver)", 2); + mDriverControllerModes.addOption("Thing(Driver)", 3); + SmartDashboard.putData(mDriverControllerModes); + mOperatorControllerModes = new SendableChooser(); + mOperatorControllerModes.setDefaultOption("Xbox Controller(Operator)", 0); + mOperatorControllerModes.addOption("Joysticks(Operator)", 1); + mOperatorControllerModes.addOption("Wheel(Operator)", 2); + mOperatorControllerModes.addOption("Thing(Operator)", 3); + SmartDashboard.putData(mOperatorControllerModes); } /** * This function is called every robot packet, no matter the mode. Use this for items like @@ -64,22 +100,35 @@ private void populateAutonomousModes(){ */ @Override public void robotPeriodic() { - + if (accelX < 0.10 && accelX > -0.10){accelX=0;} + if (accelY < 0.10 && accelY > -0.10){accelY=0;} + if (accelZ < 0.10 && accelZ > -0.10){accelZ=0;} + + SmartDashboard.putBoolean("In Auto", inAutoMode); + SmartDashboard.putBoolean("In Teleop", inTeleop); + SmartDashboard.putNumber("Speed", mOperatorInterface.getDriveThrottle()); + SmartDashboard.putNumber("battery", RobotController.getBatteryVoltage()); + SmartDashboard.putNumber("Left Encoder", mDrive.getLeftEncoderPosition()*-1); + SmartDashboard.putNumber("Right Encoder", mDrive.getRightEncoderPosition()); + SmartDashboard.putData("power panel",powerPanel); + SmartDashboard.putNumber("accel X", accelX); + SmartDashboard.putNumber("accel Y", accelY); + SmartDashboard.putNumber("accel Z", accelZ); + //Ball targeting stuff + //SmartDashboard.putBoolean("Value Target", ___); + //SmartDashboard.putNumber("Target angle", ___) } - /** Called at the Start of Autonomous **/ @Override public void autonomousInit() { - // set auto mode - + inAutoMode = true; + inTeleop = false; // Get Selected AutoMode AutoModeBase selectedMode = mAutoModes.getSelected(); if(selectedMode == null){ System.out.println("Selected Auto Mode is Null"); } - - //TestDriveMode selectedMode = new TestDriveMode(); mAutoModeExecutor.setAutoMode(selectedMode); @@ -97,15 +146,40 @@ public void autonomousPeriodic() { /** This function is called once when teleop is enabled. */ @Override public void teleopInit() { - + inTeleop = true; + inAutoMode = false; // Disable Auto Thread (if running) if (mAutoModeExecutor != null) { mAutoModeExecutor.stop(); } - + Integer selectedDriveController = mDriverControllerModes.getSelected(); + Integer selectedOperatorController = mOperatorControllerModes.getSelected(); + if(selectedDriveController == 0){ + mOperatorInterface.setDriveControllerInUse(0); + } + if(selectedDriveController == 1){ + mOperatorInterface.setDriveControllerInUse(1); + } + if(selectedDriveController == 2){ + mOperatorInterface.setDriveControllerInUse(2); + } + if(selectedDriveController == 3){ + mOperatorInterface.setDriveControllerInUse(3); + } + if(selectedOperatorController == 0){ + mOperatorInterface.setOperatorControllerInUse(0); + } + if(selectedOperatorController == 1){ + mOperatorInterface.setOperatorControllerInUse(1); + } + if(selectedOperatorController == 2){ + mOperatorInterface.setOperatorControllerInUse(2); + } + if(selectedOperatorController == 3){ + mOperatorInterface.setOperatorControllerInUse(3); + } // Zero Drive Sensors mDrive.zeroSensors(); - } /** This function is called periodically during operator control. */ @@ -126,13 +200,14 @@ public void disabledInit() { // create Auto Mode Executor mAutoModeExecutor = new AutoModeExecutor(); + inAutoMode = false; + inTeleop = false; } /** This function is called periodically when disabled. */ @Override public void disabledPeriodic() { // Set Mode for the Auto Mode to use in Thread - } /** This function is called once when test mode is enabled. */ @@ -156,7 +231,8 @@ private void teleopRobotLoop(){ private void teleopDriveLoop(){ double driveThrottle = mOperatorInterface.getDriveThrottle(); double driveTurn = mOperatorInterface.getDriveTurn(); - + //System.out.println(mOperatorInterface.getDriveThrottle()); + //System.out.println(mOperatorInterface.getDriveTurn()); //manual drive mDrive.setDrive(driveThrottle, driveTurn, false); } diff --git a/src/main/java/frc/robot/auto/modes/ControllerModeBase.java b/src/main/java/frc/robot/auto/modes/ControllerModeBase.java new file mode 100644 index 0000000..cc9491d --- /dev/null +++ b/src/main/java/frc/robot/auto/modes/ControllerModeBase.java @@ -0,0 +1,14 @@ +package frc.robot.auto.modes; + +import frc.robot.auto.AutoModeEndedException; +import frc.robot.auto.actions.Action; +import frc.robot.auto.actions.NoopAction; +import edu.wpi.first.wpilibj.DriverStation; + + +public class ControllerModeBase { + public void test(){ + System.out.println("Controller selected!"); + } + +} \ No newline at end of file diff --git a/src/main/java/frc/robot/auto/modes/JoysticksMode.java b/src/main/java/frc/robot/auto/modes/JoysticksMode.java new file mode 100644 index 0000000..d32ccdb --- /dev/null +++ b/src/main/java/frc/robot/auto/modes/JoysticksMode.java @@ -0,0 +1,20 @@ +package frc.robot.auto.modes; + +import frc.robot.auto.AutoModeEndedException; +import frc.robot.auto.actions.*; +import frc.robot.auto.TrajectoryLibrary; + +import edu.wpi.first.wpilibj.trajectory.TrajectoryConfig; +import edu.wpi.first.wpilibj.trajectory.Trajectory; +import edu.wpi.first.wpilibj.trajectory.TrajectoryGenerator; +import edu.wpi.first.wpilibj.geometry.Pose2d; +import edu.wpi.first.wpilibj.geometry.Translation2d; +import edu.wpi.first.wpilibj.geometry.Rotation2d; +import java.util.List; + +public class JoysticksMode extends ControllerModeBase { + + public JoysticksMode(){ + System.out.println("Joysticks are in use"); + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/auto/modes/XboxControllermode.java b/src/main/java/frc/robot/auto/modes/XboxControllermode.java new file mode 100644 index 0000000..286afc8 --- /dev/null +++ b/src/main/java/frc/robot/auto/modes/XboxControllermode.java @@ -0,0 +1,21 @@ +package frc.robot.auto.modes; + +import frc.robot.auto.AutoModeEndedException; +import frc.robot.auto.actions.*; +import frc.robot.auto.TrajectoryLibrary; + +import edu.wpi.first.wpilibj.trajectory.TrajectoryConfig; +import edu.wpi.first.wpilibj.trajectory.Trajectory; +import edu.wpi.first.wpilibj.trajectory.TrajectoryGenerator; +import edu.wpi.first.wpilibj.geometry.Pose2d; +import edu.wpi.first.wpilibj.geometry.Translation2d; +import edu.wpi.first.wpilibj.geometry.Rotation2d; +import java.util.List; + +public class XboxControllermode extends ControllerModeBase { + + public XboxControllermode(){ + System.out.println("Xbox controller is in use"); + } + +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/Drive.java b/src/main/java/frc/robot/subsystems/Drive.java index 2da31bd..99be99c 100644 --- a/src/main/java/frc/robot/subsystems/Drive.java +++ b/src/main/java/frc/robot/subsystems/Drive.java @@ -24,6 +24,7 @@ import edu.wpi.first.wpilibj.geometry.Pose2d; import edu.wpi.first.wpilibj.RobotController; + /* import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX; import com.ctre.phoenix.motorcontrol.can.TalonFX; @@ -420,7 +421,7 @@ public double getTurnRate() { } // Get the left encoder data in meters - private double getLeftEncoderPosition() { + public double getLeftEncoderPosition() { return CTREUnits.talonPosistionToMeters(mLeftMaster.getSelectedSensorPosition()); } @@ -428,7 +429,7 @@ private double getLeftEncoderPosition() { * Get the encoder data in meters */ // Get the right encoder data in meters - private double getRightEncoderPosition() { + public double getRightEncoderPosition() { return CTREUnits.talonPosistionToMeters(mRightMaster.getSelectedSensorPosition()); } } \ No newline at end of file