Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/robot/ArcadeDriveXboxController/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
left_motor = wpilib.PWMSparkMax(0)
right_motor = wpilib.PWMSparkMax(1)
self.robot_drive = wpilib.DifferentialDrive(left_motor, right_motor)
self.driver_controller = wpilib.NiDsXboxController(0)
self.driver_controller = wpilib.XboxController(0)

# We need to invert one side of the drivetrain so that positive voltages
# result in both sides moving forward. Depending on how your robot's
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/DifferentialDriveBot/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MyRobot(wpilib.TimedRobot):
def __init__(self) -> None:
super().__init__()

self.controller = wpilib.NiDsXboxController(0)
self.controller = wpilib.XboxController(0)
self.drive = Drivetrain()

# Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0 to 1.
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/DifferentialDrivePoseEstimator/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self) -> None:
self.inst = ntcore.NetworkTableInstance.get_default()
self.double_array_topic = self.inst.get_double_array_topic("doubleArrayTopic")

self.controller = wpilib.NiDsXboxController(0)
self.controller = wpilib.XboxController(0)
self.drive = Drivetrain(self.double_array_topic)

# Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0 to 1.
Expand Down
4 changes: 2 additions & 2 deletions examples/robot/DriveDistanceOffboard/robotcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self):
)

# The driver's controller
self.driver_controller = commands2.button.CommandNiDsXboxController(
self.driver_controller = commands2.button.CommandXboxController(
constants.OIConstants.DRIVER_CONTROLLER_PORT
)

Expand All @@ -58,7 +58,7 @@ def configure_button_bindings(self):
"""
Use this method to define your button->command mappings. Buttons can be created via the button
factories on commands2.button.CommandGenericHID or one of its
subclasses (commands2.button.CommandJoystick or command2.button.CommandNiDsXboxController).
subclasses (commands2.button.CommandJoystick or command2.button.CommandXboxController).
"""

# Configure your button bindings here
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/HatchbotInlined/robotcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self) -> None:
)

# The driver's controller
self.driver_controller = commands2.button.CommandNiDsPS4Controller(
self.driver_controller = commands2.button.CommandDualShock4Controller(
constants.DRIVER_CONTROLLER_PORT
)

Expand Down
2 changes: 1 addition & 1 deletion examples/robot/HatchbotTraditional/robotcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RobotContainer:

def __init__(self) -> None:
# The driver's controller
# self.driver_controller = wpilib.NiDsXboxController(constants.DRIVER_CONTROLLER_PORT)
# self.driver_controller = wpilib.XboxController(constants.DRIVER_CONTROLLER_PORT)
self.driver_controller = wpilib.Joystick(constants.DRIVER_CONTROLLER_PORT)

# The robot's subsystems
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/MecanumBot/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MyRobot(wpilib.TimedRobot):
def __init__(self) -> None:
super().__init__()

self.controller = wpilib.NiDsXboxController(0)
self.controller = wpilib.XboxController(0)
self.mecanum = Drivetrain()

# Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0 to 1.
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/MecanumDrivePoseEstimator/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MyRobot(wpilib.TimedRobot):
def __init__(self) -> None:
super().__init__()

self.controller = wpilib.NiDsXboxController(0)
self.controller = wpilib.XboxController(0)
self.mecanum = Drivetrain()

# Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0 to 1.
Expand Down
6 changes: 3 additions & 3 deletions examples/robot/RapidReactCommandBot/rapidreactcommandbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

import commands2
from commands2.button import CommandNiDsXboxController, Trigger
from commands2.button import CommandXboxController, Trigger

from constants import AutoConstants, OIConstants, ShooterConstants
from subsystems.drive import Drive
Expand All @@ -31,7 +31,7 @@ def __init__(self) -> None:
self.pneumatics = Pneumatics()

# The driver's controller
self.driver_controller = CommandNiDsXboxController(
self.driver_controller = CommandXboxController(
OIConstants.DRIVER_CONTROLLER_PORT
)

Expand Down Expand Up @@ -73,7 +73,7 @@ def configure_bindings(self) -> None:
)

# Toggle compressor with the Start button
self.driver_controller.start().toggle_on_true(
self.driver_controller.menu().toggle_on_true(
self.pneumatics.disable_compressor_command()
)

Expand Down
2 changes: 1 addition & 1 deletion examples/robot/SimpleDifferentialDriveSimulation/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class MyRobot(wpilib.TimedRobot):
def __init__(self) -> None:
super().__init__()
self.controller = wpilib.NiDsXboxController(0)
self.controller = wpilib.XboxController(0)

# Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
# to 1.
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/SwerveBot/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MyRobot(wpilib.TimedRobot):
def __init__(self) -> None:
"""Robot initialization function"""
super().__init__()
self.controller = wpilib.NiDsXboxController(0)
self.controller = wpilib.XboxController(0)
self.swerve = drivetrain.Drivetrain()

# Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0 to 1.
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/SwerveDrivePoseEstimator/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MyRobot(wpilib.TimedRobot):
def __init__(self) -> None:
super().__init__()

self.controller = wpilib.NiDsXboxController(0)
self.controller = wpilib.XboxController(0)
self.swerve = Drivetrain()

# Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0 to 1.
Expand Down
6 changes: 3 additions & 3 deletions examples/robot/SysId/sysidroutinebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

from commands2 import Command
from commands2.button import CommandNiDsXboxController
from commands2.button import CommandXboxController
from commands2.sysid import SysIdRoutine

from subsystems.drive import Drive
Expand All @@ -27,7 +27,7 @@ def __init__(self) -> None:
self.shooter = Shooter()

# The driver's controller
self.controller = CommandNiDsXboxController(OIConstants.DRIVER_CONTROLLER_PORT)
self.controller = CommandXboxController(OIConstants.DRIVER_CONTROLLER_PORT)

def configure_bindings(self) -> None:
"""Use this method to define bindings between conditions and commands. These are useful for
Expand Down Expand Up @@ -65,7 +65,7 @@ def configure_bindings(self) -> None:

# Control the shooter wheel with the left trigger
self.shooter.set_default_command(
self.shooter.run_shooter(self.controller.get_left_trigger_axis)
self.shooter.run_shooter(self.controller.get_left_trigger)
)

self.controller.a().and_(self.controller.left_bumper()).while_true(
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/TankDriveXboxController/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
left_motor = wpilib.PWMSparkMax(0)
right_motor = wpilib.PWMSparkMax(1)
self.robot_drive = wpilib.DifferentialDrive(left_motor, right_motor)
self.driver_controller = wpilib.NiDsXboxController(0)
self.driver_controller = wpilib.XboxController(0)

# We need to invert one side of the drivetrain so that positive voltages
# result in both sides moving forward. Depending on how your robot's
Expand Down
Loading