mirror of
https://github.com/Team4388/2025RidgeScape.git
synced 2026-06-09 00:38:02 -06:00
@@ -1,4 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"System Joysticks": {
|
||||||
|
"window": {
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"keyboardJoysticks": [
|
"keyboardJoysticks": [
|
||||||
{
|
{
|
||||||
"axisConfig": [
|
"axisConfig": [
|
||||||
|
|||||||
@@ -399,7 +399,8 @@ public final class Constants {
|
|||||||
public static final class OIConstants {
|
public static final class OIConstants {
|
||||||
public static final int XBOX_DRIVER_ID = 0;
|
public static final int XBOX_DRIVER_ID = 0;
|
||||||
public static final int XBOX_OPERATOR_ID = 1;
|
public static final int XBOX_OPERATOR_ID = 1;
|
||||||
public static final int XBOX_PROGRAMMER_ID = 2;
|
public static final int BUTTONBOX_ID = 2;
|
||||||
|
public static final int XBOX_PROGRAMMER_ID = 3;
|
||||||
public static final double LEFT_AXIS_DEADBAND = 0.1;
|
public static final double LEFT_AXIS_DEADBAND = 0.1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import edu.wpi.first.wpilibj.GenericHID;
|
|||||||
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||||
import frc4388.utility.controller.XboxController;
|
import frc4388.utility.controller.XboxController;
|
||||||
|
import frc4388.utility.controller.ButtonBox;
|
||||||
import frc4388.utility.controller.DeadbandedXboxController;
|
import frc4388.utility.controller.DeadbandedXboxController;
|
||||||
import frc4388.robot.Constants.FieldConstants;
|
import frc4388.robot.Constants.FieldConstants;
|
||||||
import frc4388.robot.Constants.OIConstants;
|
import frc4388.robot.Constants.OIConstants;
|
||||||
@@ -89,7 +90,8 @@ public class RobotContainer {
|
|||||||
|
|
||||||
/* Controllers */
|
/* Controllers */
|
||||||
private final DeadbandedXboxController m_driverXbox = new DeadbandedXboxController(OIConstants.XBOX_DRIVER_ID);
|
private final DeadbandedXboxController m_driverXbox = new DeadbandedXboxController(OIConstants.XBOX_DRIVER_ID);
|
||||||
private final DeadbandedXboxController m_operatorXbox = new DeadbandedXboxController(OIConstants.XBOX_OPERATOR_ID);
|
private final DeadbandedXboxController m_operatorXbox = new DeadbandedXboxController(OIConstants.XBOX_OPERATOR_ID);
|
||||||
|
private final ButtonBox m_buttonBox = new ButtonBox(OIConstants.BUTTONBOX_ID);
|
||||||
private final DeadbandedXboxController m_autoRecorderXbox = new DeadbandedXboxController(OIConstants.XBOX_PROGRAMMER_ID);
|
private final DeadbandedXboxController m_autoRecorderXbox = new DeadbandedXboxController(OIConstants.XBOX_PROGRAMMER_ID);
|
||||||
|
|
||||||
/* Virtual Controllers */
|
/* Virtual Controllers */
|
||||||
@@ -293,8 +295,11 @@ public class RobotContainer {
|
|||||||
*/
|
*/
|
||||||
private void configureButtonBindings() {
|
private void configureButtonBindings() {
|
||||||
|
|
||||||
// ? /* Driver Buttons */
|
// ? /* Test button box bindings */
|
||||||
|
new JoystickButton(getButtonBox(), ButtonBox.White)
|
||||||
|
.onTrue(new InstantCommand(() -> System.out.println("White!")));
|
||||||
|
|
||||||
|
// ? /* Driver Buttons */
|
||||||
DualJoystickButton(getDeadbandedDriverController(), getVirtualDriverController(), XboxController.A_BUTTON)
|
DualJoystickButton(getDeadbandedDriverController(), getVirtualDriverController(), XboxController.A_BUTTON)
|
||||||
.onTrue(new InstantCommand(() -> m_robotSwerveDrive.resetGyro()));
|
.onTrue(new InstantCommand(() -> m_robotSwerveDrive.resetGyro()));
|
||||||
|
|
||||||
@@ -516,6 +521,10 @@ public class RobotContainer {
|
|||||||
return this.m_operatorXbox;
|
return this.m_operatorXbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ButtonBox getButtonBox() {
|
||||||
|
return this.m_buttonBox;
|
||||||
|
}
|
||||||
|
|
||||||
public VirtualController getVirtualDriverController() {
|
public VirtualController getVirtualDriverController() {
|
||||||
return m_virtualDriver;
|
return m_virtualDriver;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package frc4388.utility.controller;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.GenericHID;
|
||||||
|
|
||||||
|
public class ButtonBox extends GenericHID {
|
||||||
|
public static final int White = 1;
|
||||||
|
public static final int One = 2;
|
||||||
|
public static final int Two = 3;
|
||||||
|
public static final int Three = 4;
|
||||||
|
public static final int Four = 5;
|
||||||
|
public static final int Five = 6;
|
||||||
|
public static final int Six = 7;
|
||||||
|
public static final int Seven = 8;
|
||||||
|
public static final int Eight = 9;
|
||||||
|
|
||||||
|
public ButtonBox(int ID){
|
||||||
|
super(ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user