Ejemplo n.º 1
0
    def __init__(self, robot):

        self.joy = wpilib.Joystick(0)

        # Put Some buttons on the SmartDashboard
        SmartDashboard.putData("Elevator Bottom",
                               SetElevatorSetpoint(robot, 0))
        SmartDashboard.putData("Elevator Platform",
                               SetElevatorSetpoint(robot, 0.2))
        SmartDashboard.putData("Elevator Top", SetElevatorSetpoint(robot, 0.3))

        SmartDashboard.putData("Wrist Horizontal", SetWristSetpoint(robot, 0))
        SmartDashboard.putData("Raise Wrist", SetWristSetpoint(robot, -45))

        SmartDashboard.putData("Open Claw", OpenClaw(robot))
        SmartDashboard.putData("Close Claw", CloseClaw(robot))

        SmartDashboard.putData("Deliver Soda", Autonomous(robot))

        # Create some buttons
        d_up = JoystickButton(self.joy, 5)
        d_right = JoystickButton(self.joy, 6)
        d_down = JoystickButton(self.joy, 7)
        d_left = JoystickButton(self.joy, 8)
        l2 = JoystickButton(self.joy, 9)
        r2 = JoystickButton(self.joy, 10)
        l1 = JoystickButton(self.joy, 11)
        r1 = JoystickButton(self.joy, 12)

        # Connect the buttons to commands
        d_up.whenPressed(SetElevatorSetpoint(robot, 0.2))
        d_down.whenPressed(SetElevatorSetpoint(robot, -0.2))
        d_right.whenPressed(CloseClaw(robot))
        d_left.whenPressed(OpenClaw(robot))

        r1.whenPressed(PrepareToPickup(robot))
        r2.whenPressed(Pickup(robot))
        l1.whenPressed(Place(robot))
        l2.whenPressed(Autonomous(robot))
Ejemplo n.º 2
0
    def robotInit(self):
        """This function is run when the robot is first started up and should be
           used for any initialization code."""

        self.drivetrain = DriveTrain(self)
        self.elevator = Elevator(self)
        self.wrist = Wrist(self)
        self.claw = Claw()
        self.oi = OI(self)

        # instantiate the command used for the autonomous period
        self.autonomousCommand = Autonomous(self)

        # Show what command your subsystem is running on the SmartDashboard
        wpilib.SmartDashboard.putData(self.drivetrain)
        wpilib.SmartDashboard.putData(self.elevator)
        wpilib.SmartDashboard.putData(self.wrist)
        wpilib.SmartDashboard.putData(self.claw)
Ejemplo n.º 3
0
 def robotInit(self):
     Command.getRobot = lambda x=0: self
     MyRobot.drivetrain = Drive.Drive()
     MyRobot.leftStick = oi.getLeftStick()
     MyRobot.rightStick = oi.getRightStick()
     self.Autonomous = Autonomous()
Ejemplo n.º 4
0
 def robotInit(self):
     Command.getRobot = lambda x=0: self
     self.drivetrain = Drive.Drive()
     self.autonomous = Autonomous()
Ejemplo n.º 5
0
    def robotInit(self):
        subsystems.init()

        self.teleopCommand = TankDrive()
        #self.teleopCommand = MecDrive()
        self.autonomousCommand = Autonomous()