def initialize(self): Command.getRobot().drivetrain.set(ControlMode.PercentOutput, self.power, self.power)
def end(self): Command.getRobot().drivetrain.set(ControlMode.PercentOutput, 0.0, 0.0)
def initialize(self): Command.getRobot().intakeOutput.panelPlace( IntakeOutput.PanelPutOrTake.TAKE) Command.getRobot().intakeOutput.mode = self.mode
def __init__(self, mode): super().__init__(name="SetObjectMode", subsystem=Command.getRobot().intakeOutput) self.mode = mode self.logger = logging.getLogger(self.getName())
def initialize(self): Command.getRobot().intakeOutput.panelPlace( IntakeOutput.PanelPutOrTake.PUT)
def initialize(self): Command.getRobot().liftElevator.setElevatorReference(6.5)
def __init__(self, position): super().__init__(name="ActivateArms {}".format(position), subsystem=Command.getRobot().intakeOutput) self.position = position
def initialize(self): Command.getRobot().liftElevator.resetEncoders()
def __init__(self): # Create Joysticks self.stick = Joystick(0) self.gamepad = Joystick(1) # Create Buttons self.trigger = JoystickButton(self.stick, 1) self.button2 = JoystickButton(self.stick, 2) self.button3 = JoystickButton(self.stick, 3) self.button4 = JoystickButton(self.stick, 4) self.button5 = JoystickButton(self.stick, 5) self.button6 = JoystickButton(self.stick, 6) self.button7 = JoystickButton(self.stick, 7) self.button8 = JoystickButton(self.stick, 8) self.button9 = JoystickButton(self.stick, 9) self.button10 = JoystickButton(self.stick, 10) self.button11 = JoystickButton(self.stick, 11) self.pad1 = JoystickButton(self.gamepad, 1) self.pad2 = JoystickButton(self.gamepad, 2) self.pad3 = JoystickButton(self.gamepad, 3) self.pad4 = JoystickButton(self.gamepad, 4) self.pad5 = JoystickButton(self.gamepad, 5) self.pad6 = JoystickButton(self.gamepad, 6) self.pad7 = JoystickButton(self.gamepad, 7) self.pad8 = JoystickButton(self.gamepad, 8) self.pad9 = JoystickButton(self.gamepad, 9) self.climb2 = ComboButton(self.pad6, self.button6) self.climb3 = ComboButton(self.pad5, self.button6) # Test buttons self.test = ComboButton(self.pad2, self.button6) # Command hookups self.trigger.whenPressed(Intake()) self.trigger.whenReleased(NeutralIntake()) # self.button2.whileHeld(Align(3.0)) self.button8.whenPressed( type( '', (InstantCommand, ), { 'initialize': lambda: Command.getRobot().liftElevator.resetEncoders() })) self.pad1.whenPressed(SetObjectMode( IntakeOutput.BallOrHatchMode.HATCH)) self.pad1.whenReleased(SetObjectMode( IntakeOutput.BallOrHatchMode.BALL)) Command.getRobot().intakeOutput.mode = IntakeOutput.BallOrHatchMode.HATCH if \ self.pad1.get() else IntakeOutput.BallOrHatchMode.HATCH self.test.whenPressed(TopConditional()) self.pad3.whenPressed(MiddleConditional()) self.pad4.whenPressed(LowConditional()) self.climb2.whenPressed(TwoClimbG()) self.climb3.whenPressed(OneClimbG()) self.pad7.whenPressed(MoveElevator(1)) self.pad8.whenPressed(HighCenter())
def initialize(self): Command.getRobot().intakeOutput.setPosition(self.position)
def __init__(self, key): super().__init__(name="InhaleExhale {}".format(key), subsystem=Command.getRobot().intakeOutput) self.key = key
def initialize(self): Command.getRobot().intakeOutput.giveOrTakeCargo(self.key)
def __init__(self): super().__init__(subsystem=Command.getRobot().liftElevator)
def __init__(self, power): super().__init__(name="Move {}".format(power), subsystem=Command.getRobot().drivetrain) self.power = power
def initialize(self): Command.getRobot().liftElevator.liftDrive(self.power)
def condition(self): return Command.getRobot( ).intakeOutput.mode == IntakeOutput.BallOrHatchMode.BALL
def end(self): Command.getRobot().liftElevator.liftDrive(0.0)
def __init__(self): super().__init__(name=self.__class__, subsystem=Command.getRobot().liftElevator)
def __init__(self, power): super().__init__(name="LiftDrive {}".format(power), subsystem=Command.getRobot().liftElevator) self.power = power
def __init__(self): super().__init__(subsystem=Command.getRobot().intakeOutput)
def initialize(self): if self.mode == IntakeOutput.IntakeInOutNeutral.NEUTRAL: self.logger.info("NEUTRAL") Command.getRobot().intakeOutput.setArmPower(0.0) Command.getRobot().intakeOutput.setPosition(IntakeOutput.Position.UP) elif self.mode == IntakeOutput.IntakeInOutNeutral.IN: self.logger.info("IN") Command.getRobot().intakeOutput.setArmPower(0.5) Command.getRobot().intakeOutput.setPosition(IntakeOutput.Position.DOWN) elif self.mode == IntakeOutput.IntakeInOutNeutral.OUT: self.logger.info("OUT") Command.getRobot().intakeOutput.setArmPower(-1.0) Command.getRobot().intakeOutput.setPosition(IntakeOutput.Position.DOWN)