示例#1
0
 def handle_shooter_inputs(
     self, joystick: wpilib.Joystick, gamepad: wpilib.XboxController
 ) -> None:
     if joystick.getTrigger():
         self.shooter_controller.fire_input()
     if gamepad.getBackButton() and gamepad.getRawButtonPressed(5):
         # Disable turret in case of catastrophic malfunction
         # Make this toggle to allow re-enabling turret in case it was accidentally disabled
         self.shooter.disabled = not self.shooter.disabled
         self.turret.disabled = self.shooter.disabled
示例#2
0
    def handle_shooter_inputs(self, joystick: wpilib.Joystick,
                              gamepad: wpilib.XboxController) -> None:
        if joystick.getTrigger():
            self.shooter_controller.fire_input()
        if gamepad.getBackButton() and gamepad.getBumperPressed(
                Hand.kLeftHand):
            # Disable turret in case of catastrophic malfunction
            # Make this toggle to allow re-enabling turret in case it was accidentally disabled
            self.shooter.toggle()
            self.turret.toggle()

        # Hold to stay in manual aiming mode
        if gamepad.getXButton():
            self.shooter_controller.manual_slew(
                rescale_js(gamepad.getX(Hand.kLeftHand), 0.1) *
                -self.MANUAL_SLEW_SPEED)
示例#3
0
 def handle_shooter_inputs(self, joystick: wpilib.Joystick) -> None:
     if joystick.getTrigger():
         self.shooter_controller.fire_input()