예제 #1
0
파일: robot.py 프로젝트: Penchant/Pitchfork
        if self.scheduleAutonomous:
            self.scheduleAutonomous = False
            logger.info("Game Data: %s" % (self.gameData))
            logger.info("Cross Field Enable: %s" % (self.crossFieldEnable))
            logger.info("Scoring Element %s" % (self.scoringElement))
            logger.info("Starting Position %s" % (self.startingPosition))

            self.autonMiddleStartLeftSwitch.start()
            #self.autonLeftStartLeftScale.start()
            #self.autonForward.start()

        Scheduler.getInstance().run()

    def teleopInit(self):
        """
        Initialization code for teleop mode should go here.  This method will be called each time
        the robot enters teleop mode.
        """
        if not self.timer.running:
            self.timer.start()

    def teleopPeriodic(self):
        """
        Periodic code for teleop mode should go here.  This method will be called every 20ms.
        """
        Scheduler.getInstance().run()


if __name__ == "__main__":
    run(Pitchfork)
예제 #2
0
파일: robot.py 프로젝트: sarosenb/pyfrc
    def autonomous(self):
        '''Called when autonomous mode is enabled'''
        
        timer = wpilib.Timer()
        timer.start()
        
        while self.isAutonomous() and self.isEnabled():
            
            if timer.get() < 2.0:
                self.robot_drive.mecanumDrive_Cartesian(0, -1, 1, 0)
            else:
                self.robot_drive.mecanumDrive_Cartesian(0, 0, 0, 0)
            
            wpilib.Timer.delay(0.01)

    def operatorControl(self):
        '''Called when operation control mode is enabled'''

        while self.isOperatorControl() and self.isEnabled():
            
            self.robot_drive.mecanumDrive_Cartesian(self.lstick.getX(), self.lstick.getY(), self.rstick.getX(), 0)

            wpilib.Timer.delay(0.04)


if __name__ == '__main__':
    
    wpilib.run(MyRobot,
               physics_enabled=True)

예제 #3
0
파일: robot.py 프로젝트: 4688/frc2016
        wpi.LiveWindow.run()

    def _tickDrive(self, joystickToUse):
        """
        Sets motor speeds and the like.
        Callable from both teleop and autonomous modes.
        """

        lDriveSpd = DriveManager.getDriveLeft(joystick=joystickToUse)
        self.lMotor0.set(lDriveSpd)
        self.lMotor1.set(lDriveSpd)

        rDriveSpd = DriveManager.getDriveRight(joystick=joystickToUse)
        self.rMotor0.set(rDriveSpd)
        self.rMotor1.set(rDriveSpd)

        ballMotorSpd = BallManager.getIntakeSpeed(joystick=joystickToUse)
        self.ballMotor.set(ballMotorSpd)

        leverSpd = BallManager.getEjectLeverSpeed(joystick=joystickToUse,
                                                  limit=self.leverLimit)
        self.ejectLever.set(leverSpd)

        armSpd = ArmManager.getArmSpeed(joystick=joystickToUse,
                                        upLimit=self.armUpperLimit,
                                        downLimit=self.armLowerLimit)
        self.armMotor.set(armSpd)

if __name__ == "__main__":
    wpi.run(LoRida)
예제 #4
0
                if self.drivetrain.navX is not None:
                    angle = self.drivetrain.navX.getYaw()
                    angleDiff = (angle + 180) % 360 - 180  # How far the angle is from 0 TODO verify my math
                    if abs(angleDiff) > 10:  # TODO check if 10 is a good deadzone
                        kp = 0.03  # Proportional constant for how much to turn based on angle offset
                        forcedTurn = -angle*kp
                    else:
                        forcedTurn = None  # They were in the deadzone, and gyro is center, so force no turn at all

            if abs(self.mainDriverStick.getZ()) < 0.05 and self.wasTurning:  # We were turning, now we've stopped
                self.wasTurning = False

                Timer(0.75, lambda: self.drivetrain.navX.zero()).start()  # Zero the gyro in 0.75 seconds. Need to tune the time.

            if forcedTurn is not None:
                self.drivetrain.arcadeDrive(self.mainDriverStick, rotateAxis=2, invertTurn=True, rotateValue=forcedTurn)  # 2 is horizontal on the right stick
            else:
                self.drivetrain.arcadeDrive(self.mainDriverStick, invertTurn=True, rotateAxis=2)  # 2 is horizontal on the right stick

            if not TEST_BENCH:
                self.drivetrain.arcadeStrafe(self.mainDriverStick)
                self.lifter.arcadeDrive(self.copilotStick)

            wpilib.Timer.delay(.005)  # give time for the motor to update

if __name__ == "__main__":
    import codecs
    import sys
    sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
    wpilib.run(FlashRobot)
예제 #5
0
            self.loopCalls = 0

    def doAllElse(self):
        if not (abs(self.goalPosition - self.Talon.getEncPosition()) > 4000):
            self.goalPosition += self.Joystick.getY() * -1 * self.maxVelocity
        self.Talon.set(self.goalPosition)
        #self.Talon.set(self.Joystick.getY() * 10)

    def printAll(self):
        for i in range(0,5):
            print()
        print("Selection Number: " + str(self.PIDNumber) + "     P=0, I=1, D=2, F=3")
        print("P: " + str(self.Talon.getP()) + " I: " + str(self.Talon.getI()) + " D: " + str(self.Talon.getD()) + " F: " + str(self.Talon.getF()))
        print("Speed: " + str(self.Talon.getEncVelocity()))
        #print("Position Actual: " + str(self.Talon.getPosition()))
        #print("Position   Goal: " + str(self.goalPosition))
        print("Time Until Button: " + str(self.buttonAllowedTime - self.loopCalls))

    def changePID(self, number):
        if self.PIDNumber == 0:
            self.Talon.setP(self.Talon.getP() * number)
        elif self.PIDNumber == 1:
            self.Talon.setI(self.Talon.getI() * number)
        elif self.PIDNumber == 2:
            self.Talon.setD(self.Talon.getD() * number)
        elif self.PIDNumber == 3:
            self.Talon.setF(self.Talon.getF() * number)

if __name__ == "__main__":
    wpilib.run(Tester)
예제 #6
0
        self.aSolenoidHigh.set(0)
    
    def disabledPeriodic(self):
        pass

    def teleopInit(self):
        '''Execute at the start of teleop mode'''
        self.myRobot.setSafetyEnabled(True)
        self.iSolenoid.set(1)
        lastspeed = 0

    def teleopPeriodic(self):
        if self.isOperatorControl() and self.isEnabled():
            forward = self.Stick1.getTriggerAxis(1)
            backward = self.Stick1.getTriggerAxis(0)

            sp = forward - backward
            if abs(self.Stick1.getX(0)) > 0.1:
                steering = (self.Stick1.getX(0) + 0.1*sp) / 1.5
            else:
                steering = 0

            self.myRobot.tankDrive(sp + steering, sp - steering)
           



       
if __name__ == '__main__':
    wpilib.run(MyRobot)
예제 #7
0
        Scheduler.getInstance().run()
        self.updateDashboard()

    # logging methods ----------------------------------------
    def debug(self, msg):
        self.logger.debug(msg)

    def info(self, msg):
        self.logger.info(msg)

    def warning(self, msg):
        self.logger.warning(msg)

    def error(self, msg):
        self.logger.error(msg)

    # niscelleany ----------------------------------------------
    def setLight(self, state):
        self.photonicCannon.set(state)

    def updateDashboard(self):
        currentTime = wpilib.Timer.getFPGATimestamp()
        if currentTime - self.lastTime > 1.0:
            self.lastTime = currentTime
            self.driveTrain.updateDashboard()
            self.intakeLauncher.updateDashboard()
            self.portcullis.updateDashboard()

if __name__ == "__main__":
    wpilib.run(AresRobot)
예제 #8
0
    def robotInit(self):
        '''
        This is a good place to set up your subsystems and anything else that
        you will need to access later.
        '''

        subsystems.init()
        # self.autonomousProgram = AutonomousProgram()
        self.autonomousProgram = Playback()

        '''
        Since OI instantiates commands and commands need access to subsystems,
        OI must be initialized after subsystems.
        '''
        oi.init()


    def autonomousInit(self):
        '''
        You should call start on your autonomous program here. You can
        instantiate the program here if you like, or in robotInit as in this
        example. You can also use a SendableChooser to have the autonomous
        program chosen from the SmartDashboard.
        '''

        self.autonomousProgram.start()


if __name__ == '__main__':
    wpilib.run(ExampleBot)
예제 #9
0
                os.path.join(os.path.dirname(os.path.realpath(__file__)),
                             "map.json"))
        self.chassis_ports = Map.get_map(
        )["subsystems"]["chassis"]["can_motors"]

        self.chassis_left_master = WPI_TalonSRX(
            self.chassis_ports["left_master"])
        self.chassis_left_slave = WPI_TalonSRX(
            self.chassis_ports["left_slave"])
        self.chassis_right_master = WPI_TalonSRX(
            self.chassis_ports["right_master"])
        self.chassis_right_slave = WPI_TalonSRX(
            self.chassis_ports["right_slave"])

        self.chassis_navx = AHRS.create_spi()

        self.left_joystick = Joystick(
            Map.get_map()["operator_ports"]["left_stick"])

    def teleopInit(self):
        '''Called when teleop starts; optional'''
        self.chassis.reset_encoders()

    def teleopPeriodic(self):
        '''Called on each iteration of the control loop'''
        self.chassis.upadte_operator(self.left_joystick)


if __name__ == "__main__":
    wpilib.run(Jokerbot)
예제 #10
0
    def disabledInit(self):
        pass

    def disabledPeriodic(self):
        """This function is called periodically when disabled."""
        command.Scheduler.getInstance().run()

    def autonomousInit(self):
        #Schedule the autonomous command
        #self.autonomous_command.start()
        pass

    def autonomousPeriodic(self):
        """This function is called periodically during autonomous."""
        command.Scheduler.getInstance().run()

    def teleopInit(self):
        pass

    def teleopPeriodic(self):
        """This function is called periodically during operator control."""
        command.Scheduler.getInstance().run()

    def testPeriodic(self):
        """This function is called periodically during test mode."""
        wpilib.LiveWindow.run()


if __name__ == "__main__":
    wpilib.run(TankDriveRobot)
예제 #11
0
        b2.cancelWhenPressed(self.angle)

        b3 = JoystickButton(self.joystick, 3)  #X
        b4 = JoystickButton(self.joystick, 4)  #Y
        b3.whenPressed(self.driveForward)
        b4.cancelWhenPressed(self.driveForward)

        b5 = JoystickButton(self.joystick, 5)  #leftbumper
        b6 = JoystickButton(self.joystick, 6)  #rightbumper
        b5.whenPressed(self.auto)
        b6.cancelWhenPressed(self.auto)
        '''
        pickupheight_button = JoystickButton(self.joystick, 1) #A
        pickupheight_button.whenPressed(self.goToPickup)
        switchheight_button = JoystickButton(self.joystick, 2)#B
        switchheight_button.whenPressed(self.goToSwitch)
        elevatordown_button = JoystickButton(self.joystick, 3) #X
        elevatordown_button.whenPressed(self.goDown)
        scaleheight_button = JoystickButton(self.joystick, 4) #Y
        scaleheight_button.whenPressed(self.goToScale)
        spitout_button = JoystickButton(self.joystick, 6) #Right Bumper
        spitout_button.whenPressed(self.spitOut)
        pullin_button = JoystickButton(self.joystick, 5) #Left Bumper
        pullin_button.whenPressed(self.pullIn)

        '''


if __name__ == '__main__':
    wpilib.run(Gneiss)
예제 #12
0
    def autonomousPeriodic(self):
        pass

    def teleopInit(self):
        pass

    def teleopPeriodic(self):
        self.PR.printAll()
        current = self.PDP.getCurrent(0)
        self.MeccanumDrive.update(self.Joystick.getDirection(), self.Joystick.getMagnitude(), self.Joystick.getTurn(), self.Joystick.shouldStartBraking(), self.Joystick.getDriving())
        self.Joystick.updateDrivingState() #updates the WasDriving property to whether you were driving this call
        if (self.StrafeJoystick.getRawButton(3)):
            self.Lift.set(.5)
        elif (self.StrafeJoystick.getRawButton(2)):
            self.Lift.set(-.5)
        else:
            self.Lift.set(0)
        pass

    def testInit(self):
        pass

    def testPeriodic(self):
        pass

    def disabledInit(self):
        pass

if __name__ == "__main__":
    wpilib.run(Buttercraft)
        # run the optimization
        options["lims"] = array([[-1, 1],
                                 [-1, 1]])

        start_time = time.time()
        self.x, self.u, L, Vx, Vxx, cost = ilqg.ilqg(lambda x, u: dynamics_func(x, u), cost_func, x0, u0, options)
        self.i = 0
        print(self.x[-1])
        print("ilqg took {} seconds".format(time.time() - start_time))
        cost_graph(self.x)
        self.drive = wpilib.RobotDrive(0, 1)
        self.joystick = wpilib.Joystick(0)

    def autonomousInit(self):
        self.autostart = time.time()

    def autonomousPeriodic(self):
        time_elapsed = time.time() - self.autostart
        if time_elapsed < self.u.shape[0]*.1:
            self.drive.tankDrive(self.u[time_elapsed//.1, 0], -self.u[time_elapsed//.1, 1])
        else:
            self.drive.tankDrive(0, 0)

    def teleopPeriodic(self):
        self.drive.arcadeDrive(self.joystick)


if __name__ == "__main__":
    wpilib.run(IlqgRobot)
예제 #14
0
        logging.write_message("\nYOU MAY CONTROL ME FOR NOW BUT I WILL RETURN\n")

    def teleopPeriodic(self):
        # drive.drive.drive.drive.drive()
        self.drive.drive(self.drive_type)

        ## to catch button presses
        # to shoot, press A


#        if XboxButtons.A.poll():
#            Shooter.shoot(config.shoot_mtr, config.suck_mtr, config.shoot_sole)
# returns the wheels to the default position
#        if XboxButtons.X.poll():
#            self.drive.default()
# to suck, press B
#        if XboxButtons.B.poll():
#            Shooter.suck(config.shoot_mtr, config.suck_mtr, config.shoot_sole)
#        else:
#            Shooter.suck_stop(config.shoot_mtr, config.suck_mtr)
# raise/lower the arm
#        if XboxButtons.Y.poll():
#            Shooter.toggle_arm(config.drop_sole)
# to toggle logging to the Driver Station
#  press the Select button
#        if XboxButtons.Start.poll():
#            config.LOGGING = not config.LOGGING

if __name__ == "__main__":
    wpi.run(Myrobot)
예제 #15
0
파일: robot.py 프로젝트: smilelsb/examples

class GameDataRobot(wpilib.TimedRobot):
    def robotInit(self):
        # A way of demonstrating the difference between the game data strings
        self.blue = wpilib.Solenoid(0)
        self.red = wpilib.Solenoid(1)
        self.green = wpilib.Solenoid(2)
        self.yellow = wpilib.Solenoid(3)
        # Set game data to empty string by default
        self.gameData = ""
        # Get the SmartDashboard table from networktables
        self.sd = NetworkTables.getTable("SmartDashboard")

    def teleopPeriodic(self):
        data = self.ds.getGameSpecificMessage()
        if data:
            # Set the robot gamedata property and set a network tables value
            self.gameData = data
            self.sd.putString("gameData", self.gameData)

        # Solenoid based indicator of the current color
        self.blue.set(self.gameData == "B")
        self.red.set(self.gameData == "R")
        self.green.set(self.gameData == "G")
        self.yellow.set(self.gameData == "Y")


if __name__ == "__main__":
    wpilib.run(GameDataRobot)
예제 #16
0
            if not notified[0]:
                cond.wait()
        print("Connected")
        self.table = NetworkTables.getTable('SmartDashboard')

    def autonomous(self):
        while self.isAutonomous() and self.isEnabled():
            pass  #update later

    def disabled(self):
        while self.isDisabled():
            self.dTrain.arcadeDrive(0.0, 0.0)

    def operatorControl(self):
        while self.isOperatorControl() and self.isEnabled():
            angle = self.joystick.getX()
            speed = self.joystick.getY()
            if abs(angle) <= self.xDeadZone:
                angle = 0.0
            else:
                angle = self.xConstant * angle**3
            if abs(speed) <= self.yDeadZone:
                speed = 0.0
            else:
                speed = speed * self.yConstant
            self.dTrain.arcadeDrive(xSpeed=speed, zRotation=-angle)


if __name__ == '__main__':
    wpi.run(Robot)
예제 #17
0
        self.lft_front = wpilib.PWMTalonFX(1)

        self.joy = wpilib.XboxController(0)

        self.rgt_front.setInverted(True)
        self.lft_front.setInverted(False)

    def autonomousInit(self):
        self.rgt_front.set(0.2)
        self.lft_front.set(0.2)

    def autonomousPeriodic(self):
        pass

    def teleopInit(self):
        pass

    def teleopPeriodic(self):
        self.rgt_front.set(self.joy.getRawAxis(3))
        self.lft_front.set(self.joy.getRawAxis(3))

    def disabledInit(self):
        pass

    def disabledPeriodic(self):
        pass


if __name__ == '__main__':
    wpilib.run(KodyBot)
예제 #18
0
from commandbased import CommandBasedRobot
import subsystems
import oi
import argparse

from commands.followjoystick import FollowJoystick
from commands.intake import Intake
# parser = argparse.ArgumentParser()
# parser.add_argument("--enabletank",
#                     help=
#                       "Pass this to override mecanum and enable tankdrive",
#                     action="store_true")
# args = parser.parse_args()


class Penumbra(CommandBasedRobot):
    def robotInit(self):
        subsystems.init()

        oi.init()
        self.teleopProgram = wpilib.command.CommandGroup()
        self.teleopProgram.addParallel(FollowJoystick())
        self.teleopProgram.addParallel(Intake())

    def teleopInit(self):
        self.teleopProgram.start()


if __name__ == "__main__":
    wpilib.run(Penumbra, physics_enabled=True)
예제 #19
0
        joystick = self.oi.getStick()

        #Logging loop
        while self.isOperatorControl() and self.isEnabled():
            self.log()
            Scheduler.getInstance().run()
            wpilib.Timer.delay(.005) #don't burn up the cpu

    def disabled(self):
        """Code to run when disabled."""

        #Stop the drivetrain for safety's sake:
        self.drivetrain.driveManual(0,0,0)

        #Logging loop
        while self.isDisabled():
            self.log()
            wpilib.Timer.delay(.005) #don't burn up the cpu

    def test(self):
        """Code for testing."""
        pass

    def log(self):
        """I know it doesn't log but if it does eventually it'll go here."""
        #Log the things:
        self.drivetrain.log()

if __name__ == "__main__":
    wpilib.run(DosPointOh)
예제 #20
0
    def initNetworkTables(self):
        #allows for smartdashboard and offboard vision communication
        networktables.NetworkTables.initialize()
        self.smart_dashboard = networktables.NetworkTables.getTable(
            "SmartDashboard")

    def initOI(self):
        #initialize joysticks
        self.controller = wpilib.Joystick(0)
        self.button_board = wpilib.Joystick(1)

        #initialize buttons and assign commands to those buttons
        #wpilib.buttons.JoystickButton(self.controller, robot_map.ds4["options"]).toggleWhenPressed(commands.drivetrain.StopDriving())
        wpilib.buttons.JoystickButton(self.controller,
                                      robot_map.ds4["share"]).whenPressed(
                                          commands.other.ToggleCompressor())
        wpilib.buttons.JoystickButton(self.controller,
                                      robot_map.ds4["r1"]).whenPressed(
                                          commands.end_effector.Toggle())
        wpilib.buttons.JoystickButton(self.controller,
                                      robot_map.ds4["square"]).whenPressed(
                                          commands.ramp.Deploy())
        wpilib.buttons.JoystickButton(self.controller,
                                      robot_map.ds4["triangle"]).whenPressed(
                                          commands.arm.Toggle())


if __name__ == '__main__':
    wpilib.run(Melody)
예제 #21
0
        joystick = self.oi.getStick()

        #Logging loop
        while self.isOperatorControl() and self.isEnabled():
            self.log()
            Scheduler.getInstance().run()
            wpilib.Timer.delay(.005) #don't burn up the cpu

    def disabled(self):
        """Code to run when disabled."""

        #Stop the drivetrain for safety's sake:
        self.drivetrain.driveManual(0,0, False, False)

        #Logging loop
        while self.isDisabled():
            self.log()
            wpilib.Timer.delay(.005) #don't burn up the cpu

    def test(self):
        """Code for testing."""
        pass

    def log(self):
        """I know it doesn't log but if it does eventually it'll go here."""
        #Log the things:
        self.drivetrain.log()

if __name__ == "__main__":
    wpilib.run(Mantis)
예제 #22
0
            if self.js.getRawButton(4) == True:
                self.ha.set(-1)  #  -1.0 to 1.0
                #self.rha.set(12)
            else:
                self.ha.set(0)
                #self.rha.set(0)

            # In closed loop mode, this sets the goal in the units mentioned above.
            # Since we are using an analog potentiometer, this will try to go to
            #   the middle of the potentiometer range.
            if self.js.getRawButton(7) == True:
                self.shootor.set(900)  # 0 - 1023
                #was 800
                self.ha.set(-1)  #  -1.0 to 1.0
                #self.rha.set(12)
            else:
                self.shootor.set(0)
                self.ha.set(0)
                #self.rha.set(0)

        # was 0.005
        wpilib.Timer.delay(0.003)

    def testPeriodic(self):
        wpilib.LiveWindow.run()


if __name__ == "__main__":
    wpilib.run(MyRobot, physics_enabled=False)
예제 #23
0
        dog.SetExpiration(0.25)

        while self.IsOperatorControl() and self.IsEnabled():
            dog.Feed()
            check_restart()

            precision_button = (controller.GetRawButton(5) or controller.GetRawButton(6))
            x = precision_mode(controller.GetRawAxis(1), precision_button)
            y = precision_mode(controller.GetRawAxis(2), precision_button)
            rotation = precision_mode(controller.GetRawAxis(4), precision_button)
            drive.MecanumDrive_Cartesian(x, y, rotation)

            solenoid_button = controller.GetRawButton(1)
            solenoid_in.Set(solenoid_button)
            solenoid_out.Set(not solenoid_button)

            rack.Set(precision_mode(controller.GetRawAxis(5), True))

            wheel_button = controller.GetRawButton(2)
            wheel.Set(1 if wheel_button else 0)

            wpilib.Wait(0.01)

def run():
    cubert = Cubert()
    cubert.StartCompetition()
    return cubert

if __name__ == "__main__":
    wpilib.run(min_version='2014.4.0')
예제 #24
0
    def disabledPeriodic(self):
        pass

    def disabledInit(self):
        pass

    def teleopInit(self):
        pass

    def teleopPeriodic(self):
        # Normal joysticks
        self.drive.move(-self.joystick.getY(), self.joystick.getX())

        # Corrections for aviator joystick
        #self.drive.move(-2*(self.joystick.getY()+.5),
        #                2*(self.joystick.getX()+.5)+ROT_COR,
        #                sarah=self.sarah)

        if self.btn_sarah:
            self.sarah = not self.sarah

        if self.btn_pull.get():
            self.intake.pull()
        elif self.btn_push.get():
            self.intake.push()


if __name__ == '__main__':
    wpilib.run(Bot)
예제 #25
0
				 clock = -100

			#output to dashboard
			self.smartDs.putString("DB/String 0", "Left 1: " + str(wheelSpeed[0])[0:4])			 
			self.smartDs.putString("DB/String 1", "Left 2: " + str(wheelSpeed[2])[0:4])
			self.smartDs.putString("DB/String 2", "Right 1: " + str(wheelSpeed[1]*(-1))[0:4])   
			self.smartDs.putString("DB/String 3", "digR: " + str(self.leftSwitch.get())[0:5])
			self.smartDs.putString("DB/String 4", "At Pos: " + str(self.Vator.atPos()))
			
			self.smartDs.putString("DB/String 5", "liftVolt: " + str(self.Vator.getSpeed())[0:5])
			self.smartDs.putString("DB/String 6", "currentPos: " + str(self.Vator._encd.get())[0:5])
			self.smartDs.putString("DB/String 7", "wantPos: " + str(self.Vator.getPos())[0:5])
			
			#give motors value
			self.motorBackLeft.set(wheelSpeed[0]*motorGain)
			self.motorFrontLeft.set(wheelSpeed[2]*motorGain)
			self.motorBackRight.set(wheelSpeed[1]*(-1)*motorGain)
			self.motorFrontRight.set( wheelSpeed[3]*(-1)*motorGain)
			self.Vator.updateClause()
			self.feeders.updateClause()
			self.stick.updateClause()
			self.stick2.updateClause()
			self.cop.updateClause()
			
			#zero out value
			wheelSpeed = [0,0,0,0]
			wp.Timer.delay(0.005)   # wait 5ms to avoid hogging CPU cycles

if __name__ == '__main__':
	wp.run(MyRobot)
예제 #26
0
#!/usr/bin/env python3

import wpilib  # <---- main library with all the necessary code for controlling FRC robots
import wpilib.buttons  # <---- for joystick buttons
import networktables  # <--- the library that allows us to do the cool data stuff
from robotpy_ext.common_drivers import navx  # <--- needed to get data from our gyro


class MyRobot(
        wpilib.IterativeRobot
):  # <---- IternativeRobot means that it loops over and over by itself like a while loop
    def robotInit(self):

        self.robotStats = NetworkTable.getTable(
            'SmartDashboard'
        )  #The table name is what you will reference on the laptop
        self.navx = navx.AHRS.create_spi()  #the Gyro

    def disabledPeriodic(self):
        """
            Runs constantly while disabled
        """

        # Just sends back the current yaw of the navx
        self.robotStats.putNumber('NavXYaw', self.navx.getYaw())


if __name__ == "__main__":
    wpilib.run(MyRobot)  #runs the code!
예제 #27
0
        
        self.GetWatchdog().SetEnabled(False)
        while self.IsAutonomous() and self.IsEnabled():
            wpilib.Wait(0.01)

    def OperatorControl(self):
        
        dog = self.GetWatchdog()
        dog.SetEnabled(True)
        dog.SetExpiration(0.25)

        while self.IsOperatorControl() and self.IsEnabled():
            dog.Feed()

            # Move a motor with a Joystick
            self.motor.Set(self.lstick.GetY())

            wpilib.Wait(0.04)

def run():
    
    robot = MyRobot()
    robot.StartCompetition()
    
    return robot


if __name__ == '__main__':
    wpilib.run()

예제 #28
0
        self.joystick.getRawButtonPressed(5)
        while True:
            if self.app is not None:
                self.app.doEvents()

            mag = sea.deadZone(self.joystick.getMagnitude())
            mag *= 3  # maximum feet per second
            direction = -self.joystick.getDirectionRadians() + math.pi / 2
            turn = -sea.deadZone(self.joystick.getRawAxis(3))
            turn *= math.radians(120)  # maximum radians per second

            self.superDrive.drive(mag, direction, turn)

            if self.app is not None:
                moveMag, moveDir, moveTurn, self.robotOrigin = \
                    self.superDrive.getRobotPositionOffset(self.robotOrigin)
                self.app.moveRobot(moveMag, moveDir, moveTurn)

            if self.joystick.getRawButtonPressed(4):
                self.setDriveMode(ctre.ControlMode.PercentOutput)
            if self.joystick.getRawButtonPressed(3):
                self.setDriveMode(ctre.ControlMode.Velocity)
            if self.joystick.getRawButtonPressed(5):
                self.setDriveMode(ctre.ControlMode.Position)

            yield


if __name__ == "__main__":
    wpilib.run(SwerveBot)
예제 #29
0
        self.timer.start()

        Scheduler.getInstance().removeAll()
        Scheduler.getInstance().enable()

    def teleopPeriodic(self):

        # Before, button functions were executed here. Now scheduler will do that

        Scheduler.getInstance().run()

        # Keeping track of TimedRobot loops through code
        self.loops += 1
        if self.timer.hasPeriodPassed(1):
            self.logger.info("%d loops / second", self.loops)
            self.loops = 0

    def disabledInit(self):
        # remove all commands from scheduler
        #self.arm_motors.set_speed(0, False)
        Scheduler.getInstance().removeAll()

        return None

    def disabledPeriodic(self):
        return None


if __name__ == "__main__":
    wpilib.run(BeaverTronicsRobot)
예제 #30
0
        while self.IsAutonomous() and self.IsEnabled():
            self.autonomous.iterate()
            wpilib.Wait(0.01)

    def OperatorControl(self):

        dog = self.GetWatchdog()
        dog.SetEnabled(True)
        dog.SetExpiration(0.25)

        while self.IsOperatorControl() and self.IsEnabled():
            dog.Feed()

            self.mecanum_drive.iterate()
            self.intake.iterate()
            self.shooter.iterate()
            self.shooter_service.iterate()

            wpilib.Wait(0.04)


def run():
    robot = Aimbot()
    robot.StartCompetition()

    return robot


if __name__ == '__main__':
    wpilib.run()
#!/usr/bin/env python3

import wpilib
from os.path import dirname, abspath
from yeti.robots import YetiRobot


class FlatMountainBot(YetiRobot):
    config_dir = abspath(dirname(__file__))

if __name__ == "__main__":
    wpilib.run(FlatMountainBot)

예제 #32
0
            self.log()
            wpilib.Timer.delay(.005) #don't burn up the cpu

    def operatorControl(self):
        """Teleop stuff goes in here"""

        #self.drivetrain.drive.setSafetyEnabled(True) - enables safety things for manual control
        joystick = self.oi.getStick()

        while self.isOperatorControl() and self.isEnabled():
            self.log()
            Scheduler.getInstance().run()
            wpilib.Timer.delay(.005) #don't burn up the cpu

    def disabled(self):
        """When the robot is disabled, this code runs"""
        while self.isDisabled():
            self.log()
            wpilib.Timer.delay(.005)

    def test(self):
        """Testing things would go here"""
        pass #There's no tests, so just pass

    def log(self):
        """Logging stuff goes here"""
        #self.subsystem.log()

if __name__ == "__main__":
    wpilib.run(RobotName)
예제 #33
0
        self.left.whenPressed(TurnLeft())
        self.left.whenReleased(Stop())
                   
    def autonomousInit(self):
        '''Called only at the beginning of autonomous mode'''
        pass

    def autonomousPeriodic(self):
        '''Called every 20ms in autonomous mode'''
        pass

    def disabledInit(self):
        '''Called only at the beginning of disabled mode'''
        pass
    
    def disabledPeriodic(self):
        '''Called every 20ms in disabled mode'''
        pass

    def teleopInit(self):
        '''Called only at the beginning of teleoperated mode'''
        pass

    def teleopPeriodic(self):
        '''Called every 20ms in teleoperated mode'''
        Scheduler.getInstance().run()


if __name__ == '__main__':
    wpilib.run(MyRobot,physics_enabled=True)
예제 #34
0
    def teleopPeriodic(self):
        # NOT ACTUAL TELEOP, JUST USING IT TO TEST BOILER
        contours = self.visionary.getContours()
        contours = vision.Vision.findTargetContours(contours)
        if len(contours) < 1:
            print("No vision!!")
            return

        lowest = 0
        if len(contours) > 1:
            if (vision.Vision.centerPoint(contours[0])[1] >
                    vision.Vision.centerPoint(contours[1])[1]):
                lowest = 1

        dimensions = vision.Vision.dimensions(contours[lowest])
        width = dimensions[0]

        distance = math.sqrt((VisionTesting.BOILERFOCALDIST *
                              VisionTesting.BOILERREALTARGETDIST / width)**2 -
                             VisionTesting.BOILERTARGETHEIGHT**2)

        print(distance)

    def disabledInit(self):
        # when the robot is disabled
        pass


if __name__ == "__main__":
    wpilib.run(VisionTesting)
예제 #35
0
                #elif self.timer.get() < 8.50:
                    #self.dump_sole.set(True)
                else:
                    self.drive.tankDrive(0, 0)
            else:
                #right lane left goal
                if self.timer.get() < 1.00:
                    self.drive.tankDrive(.2, .2)
                elif self.timer.get() < 3.000:
                    self.drive.tankDrive(.25, .35)
                elif self.timer.get() < 4.000:
                    self.drive.tankDrive(., 0)
                elif self.timer.get()< 4.75:
                    self.solenoid.set(True)
                elif self.timer.get() < 5.25:
                    self.drive.tankDrive(0,.4)
                    #pugs indeed lolzzzz
        '''

        if self.timer.get() < 2.00:
            self.drive.tankDrive(-.5, -.5)
        else:
            self.drive.tankDrive(0, 0)

            if self.sd.getBoolean("dump", False) and self.dump_mode:
                self.dump_sole.set(True)


if __name__ == '__main__':
    wpi.run(MyRobot)
예제 #36
0
파일: robot.py 프로젝트: LilApple/pid-basic
        self.chassis_left_master = WPI_TalonSRX(1)
        self.chassis_left_slave = WPI_TalonSRX(2)
        self.chassis_right_master = WPI_TalonSRX(3)
        self.chassis_right_slave = WPI_TalonSRX(4)
        self.chassis_gyro = AHRS.create_spi()
        self.joystick = Joystick(0)

    def disabledInit(self):
        if self.drivePID.enabled:
            self.drivePID.close()

    def robotPeriodic(self):
        if self.isAutonomousEnabled():
            self.chassis.set_auto()
        elif self.isOperatorControlEnabled():
            self.chassis.set_teleop()

    def teleopInit(self):
        """ Called when teleop starts. """
        NetworkTables.initialize(server="10.43.20.149")
        self.sd = NetworkTables.getTable("SmartDashboard")
        self.chassis.reset_encoders()

    def teleopPeriodic(self):
        """ Called on each iteration of the control loop. """
        self.chassis.set_speed(-self.joystick.getY(), -self.joystick.getZ())


if __name__ == '__main__':
    wpilib.run(Joker)
예제 #37
0
# For more information, check the LICENSE file in the root directory of
# this project.
#

import wpilib

import drive
import lifter
import shooter

class Kooz2014 (wpilib.IterativeRobot):        
    def robotInit (self):
        self.drive = drive.Drive()
        self.lifter = lifter.Lifter()
        self.shooter = shooter.Shooter()
        
        self.drive.setBrakeEnabled (True)
        self.shooter.setBrakeEnabled (True)
    
        self.drive.setSafetyEnabled (True)
        self.lifter.setSafetyEnabled (True)
        self.shooter.setSafetyEnabled (True)

    def teleopPeriodic (self):
        self.drive.moveWithJoystick (wpilib.Joystick (0))
        self.lifter.moveWithJoystick (wpilib.Joystick (1))
        self.shooter.moveWithJoystick (wpilib.Joystick (1))
        
if (__name__ == "__main__"):
    wpilib.run (Kooz2014)
예제 #38
0
                                     self.drive.getRightDistance())
            SmartDashboard.putNumber("Drive Left Dist",
                                     self.drive.getLeftDistance())
            SmartDashboard.putNumber("pitch", self.navx.getPitch())

    def autoSelector(self):
        voltage = -1
        number = "Baseline"
        if self.a0.getAverageVoltage() > voltage:
            number = "Left"
            voltage = self.a0.getAverageVoltage()

        if self.a1.getAverageVoltage() > voltage:
            number = "Middle"
            voltage = self.a1.getAverageVoltage()

        if self.a2.getAverageVoltage() > voltage:
            number = "None"
            voltage = self.a2.getAverageVoltage()

        if self.a3.getAverageVoltage() > voltage:
            number = "Right"
            voltage = self.a3.getAverageVoltage()

        print("volt:", voltage)
        return number


if __name__ == "__main__":
    run(Robot)
예제 #39
0
파일: robot.py 프로젝트: Farengar/Test
def main():
    wpilib.run(TestProgram)
예제 #40
0
파일: robot.py 프로젝트: 3299/2019
                       self.joystick.getRawAxis(4))

        # MetaBox
        self.metabox.run(
            self.leftJ.getY(),  # elevator rate of change
            self.leftJ.getRawButton(3),  # run intake wheels in
            self.leftJ.getRawButton(1),  # open jaws
            self.leftJ.getRawButton(2),  # run intake wheels out
            self.leftJ.getRawButton(4),  # go to bottom
            self.leftJ.getRawAxis(2),  # set angle of jaws
            self.leftJ.getRawButton(8))  # calibrate elevator
        '''
        self.Frontlift.run(self.leftJ.getRawButton(6),
                           self.leftJ.getRawButton(7),
                           self.leftJ.getRawButton(11),
                           self.leftJ.getRawButton(10),
                           self.leftJ.getRawButton(8))
        '''
        # Lights
        self.lights.setColor(self.driverStation.getAlliance())

    def test(self):
        # reset gyro
        self.C.gyroS.reset()
        # reset encoder
        self.C.driveYEncoderS.reset()


if __name__ == "__main__":
    wpilib.run(Randy)
예제 #41
0
    def disabledInit(self):
        pass

    def disabledPeriodic(self):
        """This function is called periodically when disabled."""
        command.Scheduler.getInstance().run()

    def autonomousInit(self):
        #Schedule the autonomous command
        #self.autonomous_command.start()
        pass

    def autonomousPeriodic(self):
        """This function is called periodically during autonomous."""
        command.Scheduler.getInstance().run()

    def teleopInit(self):
        pass

    def teleopPeriodic(self):
        """This function is called periodically during operator control."""
        command.Scheduler.getInstance().run()

    def testPeriodic(self):
        """This function is called periodically during test mode."""
        wpilib.LiveWindow.run()

if __name__ == "__main__":
    wpilib.run(TankDriveRobot)
예제 #42
0
def git_gud(robot):
    wpilib.run(robot)
예제 #43
0
#!/usr/bin/env python3

"""
robot.py
=========

This file is the main entry point for the robot. RobotPy runs this file
when launched. We load the robot from the bot submodule, necessary so relative
imports work within the bot (e.g. importing subsystems).
"""

import wpilib
from bot import Robot


class Bot(Robot):
    pass

if __name__ == '__main__':
    wpilib.run(Bot)
예제 #44
0
    return wpilib.PWMSpeedController(channel)


def create_pwm_talon_srx(channel):
    return wpilib.PWMTalonSRX(channel)


def create_pwm_victor_spx(channel):
    return wpilib.PWMVictorSPX(channel)


#def create_():
#return wpilib.()


def start_from_robot(program, shut_up, wall, brainwash, compiled):
    if not os.path.isfile(program):
        print("Invalid file specified,")
        return

    # Decide whether to ignore system warnings
    if not shut_up:
        Utils.verify_system(wall)
    flip_flopping = not brainwash
    # Compile and go
    Compiler().compile(program, flip_flopping, compiled)


if __name__ == '__main__':
    wpilib.run(TrumpRobot, physics_enabled=True)
예제 #45
0
            Scheduler.getInstance().run()
            self.log()
            wpilib.Timer.delay(.005)

    def operatorControl(self):
        joystick = self.oi.getStick()

        while self.isOperatorControl() and self.isEnabled():
            self.log()
            Scheduler.getInstance().run()
            wpilib.Timer.delay(.005)

    def disabled(self):
        """Stuff to do whilst disabled."""

        while self.isDisabled():
            self.log()
            wpilib.Timer.delay(.005)

    def test(self):
        """No tests"""
        pass

    def log(self):
        """It's big, it's heavy, it's wood."""
        #SOMEDAY WE WILL FIGURE OUT LOGGING. I PROMISE.
        self.drivetrain.log()

if __name__ == "__main__":
    wpilib.run(OctoBot)
예제 #46
0
        self.right_intake_motor.setInverted(True)

        # Intake grabbers
        self.grabber_solenoid = wpilib.DoubleSolenoid(1, 0, 1)

        # PDP
        self.pdp = wpilib.PowerDistributionPanel(0)
        wpilib.SmartDashboard.putData("PowerDistributionPanel", self.pdp)

        # Misc
        self.navx = navx.AHRS.create_spi()

        self.net_table = NetworkTables.getTable("SmartDashboard")
        self.vision_table = NetworkTables.getTable("limelight")
        self.limelight_x = self.vision_table.getEntry("tx")
        self.limelight_valid = self.vision_table.getEntry("tv")
        self.dashboard_has_target = self.vision_table.getEntry("hastarget")

        # Launch camera server
        wpilib.CameraServer.launch()

    def autonomous(self):
        """Prepare for autonomous mode"""

        magicbot.MagicRobot.autonomous(self)


if __name__ == "__main__":
    # Run robot
    wpilib.run(Stanley)
예제 #47
0
    def robotInit(self):
        pass
    
    def autonomousInit(self):
        pass
    
    def autonomousPeriodic(self):
        pass
    
    def teleopInit(self):
        self.Right = wpilib.CANTalon(1)
        self.Left = wpilib.CANTalon(2)
        self.CAN = wpilib.CANTalon(0)
        self.Arm = Arm(self.CAN)
        self.Joystick = wpilib.Joystick(0)
    
    def teleopPeriodic(self):
        self.Left.set(-self.Joystick.getY() + self.Joystick.getX())
        self.Right.set(self.Joystick.getY() + self.Joystick.getX())
        if self.Joystick.getRawButton(1):
            self.Arm.update()
        if self.Joystick.getRawButton(2):
            self.Arm.setTarget(self.Arm.getPosition())
        if self.Joystick.getRawButton(5):
            self.Arm.movePosition(4000)
        if self.Joystick.getRawButton(4):
            self.Arm.movePosition(-4000)
        
if __name__ == "__main__":
    wpilib.run(ArmTest)
예제 #48
0
            else:
                pressed_buttons.add(button)
                return True
        else:
            pressed_buttons.discard(button)
            return False


# see comment in teleopPeriodic for information
def rescale_js(value, deadzone=0.0, exponential=0.0, rate=1.0):
    value_negative = 1.0
    if value < 0:
        value_negative = -1.0
        value = -value
    # Cap to be +/-1
    if abs(value) > 1.0:
        value /= abs(value)
    # Apply deadzone
    if abs(value) < deadzone:
        return 0.0
    elif exponential == 0.0:
        value = (value - deadzone) / (1 - deadzone)
    else:
        a = math.log(exponential + 1) / (1 - deadzone)
        value = (math.exp(a * (value - deadzone)) - 1) / exponential
    return value * value_negative * rate


if __name__ == '__main__':
    wpilib.run(Robot)
예제 #49
0
                wpilib.Timer.delay(0.05)
        def recv_thread():
            while True:
                self.dashboard.get_msg()
        t_send = threading.Thread(target=send_thread)
        t_send.daemon = True
        t_send.start()
        t_recv = threading.Thread(target=recv_thread)
        t_recv.daemon = True
        #t_recv.start()

    def teleopInit(self):
        self.gyro.reset()
        self.timer.reset()

    def teleopPeriodic(self):
        x = self.gamepad.getX()
        y = self.gamepad.getY()
        rot = self.gamepad.getZ()
        self.drive(x, y, rot)
        wpilib.Timer.delay(0.005)

    def drive(self, x, y, rot):
        self.robot_drive.mecanumDrive_Cartesian(x, y, rot, 0)

    def get_angle(self):
        return self.gyro.getAngle() - self.gyro_drift * self.timer.get()

if __name__ == '__main__':
    wpilib.run(Robot)
예제 #50
0
        # Init Drive Controls
        DriverController = driveControls("DriveController", self.driveController, self.drivetrain, self.driveJoystick, .05)
        DriveAux = driveAux("DriveAux", self.driveController, self.drivetrain, self.driveJoystick, .05)

        SubsystemAux = subsystemAux("SubsystemAux", self.subsystemController, self.driveJoystick, .1)
       
        # Start Drive Controls
        DriveAux.start()
        DriverController.start()

        # Start Subsystem Controls
        SubsystemAux.start()
        
        # Start and Reset Timer
        self.timer.reset()
        self.timer.start()

    def teleopPeriodic(self):

        # Pressurize Throughout Teleop
        self.compressor.start()

        # Rumble Controller
        if (self.timer.get() > 75 and self.timer.get() < 105):
            self.driveController.rumble(1, 1)
        else:
            self.driveController.rumble(0, 0)

if __name__ == '__main__':
    wpilib.run(Kylo)
예제 #51
0
    def autonomousPeriodic(self):
        pass

    def teleopInit(self):
        pass

    def teleopPeriodic(self):
        #print(self.Arm1.getEncPosition(), self.Arm2.getEncPosition())
        if self.Joystick.getRawButton(1): #A
            self.Control.setTarget(self.Control.getPositions())
        if self.Joystick.getRawButton(2): #B
            self.Control.update()
        if self.Joystick.getRawButton(3): #X
            self.Replay.enable()
        #if self.Joystick.getRawButton(4): #Y
        #    self.Replay.disable()

        #self.Control.update()
        self.Replay.update()
        #self.Arm1.set(0)
        #print(self.Arm1.getEncPosition())

        self.i += 1
        #if self.i % 10 == 0:
            #print("Current:", self.Arm1.getOutputCurrent())
            #self.Control.update()

if __name__ == "__main__":
    wpilib.run(TestArmEncoders)
예제 #52
0
                self.leftMotVal, self.rightMotVal = 0, 0

        self.myRobot.tankDrive(self.leftMotVal, self.rightMotVal)

    def teleopInit(self):
        #telop init here
        self.myRobot.setSafetyEnabled(True)
        self.pastFrontFlipButton = False
        self.flip = True

    def teleopPeriodic(self):
        #teleop code will go here
        #Joystick Variables
        leftJoyValY = self.leftStick.getY()
        rightJoyValY = self.rightStick.getY()
        armJoyValY = self.armStick.getY()
        frontFlipButton = self.rightStick.getRawButton(2)

        #FrontFlip
        if (self.pastFrontFlipButton == False and frontFlipButton):
            self.flip = not self.flip
        self.pastFrontFlipButton = frontFlipButton

        leftMotVal, rightMotVal = rf.flip(self.flip, leftJoyValY, rightJoyValY)

        self.myRobot.tankDrive(leftMotVal, rightMotVal)


if __name__ == '__main__':
    wp.run(MyRobot)
예제 #53
0
            self.vision.start()
        except:
            pass

    def teleopPeriodic(self):
        """This function is called periodically during operator control."""
        for button, task in taskmap.items():
            #if the button for the task is pressed and the task is not already running
            if self.oi.joystick.getRawButton(button) and task not in self.running:
                ifunc = task(self).__next__
                self.running[task] = ifunc
        if self.omni_driving and self.omni_drive not in self.running:
            ifunc = self.omni_drive(self).__next__
            self.running[self.omni_drive] = ifunc
        done = []
        for key, ifunc in self.running.items():
            try:
                ifunc()
            except StopIteration:
                done.append(key)
        for key in done:
            self.running.pop(key)
        #self.logger.info("Teleop periodic vision: " + str(self.vision_array[0]))

    def testPeriodic(self):
        """This function is called periodically during test mode."""
        wpilib.LiveWindow.run()

if __name__ == "__main__":
    wpilib.run(StrongholdRobot)
예제 #54
0
        pass

    def teleopPeriodic(self):
        # Driving
        linear = -self.driver.getRawAxis(RobotMap.left_y)
        angular = self.driver.getRawAxis(RobotMap.right_x)
        RobotMap.driver_component.set_curve(linear, angular)

        # Square to toggle gear
        if self.driver.getRawButtonPressed(RobotMap.square):
            RobotMap.driver_component.toggle_gear()

        # Shooting (R2)
        launch_speed = (1.0 + self.driver.getRawAxis(RobotMap.r_2)) / 2
        RobotMap.shooter_component.shoot(launch_speed)

        # X to fire
        if self.driver.getRawButtonPressed(RobotMap.x):
            print(RobotMap.shooter_component.is_busy())
            if not RobotMap.shooter_component.is_busy():
                self.start_command(Shoot())

        # Circle to toggle height
        if self.driver.getRawButtonPressed(RobotMap.circle):
            RobotMap.shooter_component.toggle_lifter()


if __name__ == '__main__':
    print("hello world")
    run(UltimateAscent)
예제 #55
0
                self.turnController.setSetpoint(179.9)
                rotateToAngle = True
            elif self.stick.getRawButton(5):
                self.turnController.setSetpoint(-90.0)
                rotateToAngle = True
            
            if rotateToAngle:
                self.turnController.enable()
                currentRotationRate = self.rotateToAngleRate
            else:
                self.turnController.disable()
                currentRotationRate = self.stick.getTwist()
            
            # Use the joystick X axis for lateral movement,
            # Y axis for forward movement, and the current
            # calculated rotation rate (or joystick Z axis),
            # depending upon whether "rotate to angle" is active.
            self.myRobot.mecanumDrive_Cartesian(self.stick.getX(), self.stick.getY(), 
                                                currentRotationRate, self.ahrs.getAngle())
            
            wpilib.Timer.delay(0.005) # wait for a motor update time
        
    def pidWrite(self, output):
        """This function is invoked periodically by the PID Controller,
        based upon navX MXP yaw angle input and PID Coefficients.
        """
        self.rotateToAngleRate = output

if __name__ == '__main__':
    wpilib.run(MyRobot)
예제 #56
0
                direction = self.movegamepad.getLDirection()
            self.Drive.drive(magnitude, direction, turn)
            self.Shooter.update(self.shootgamepad.getButtonByLetter("B"),\
                                self.shootgamepad.getButtonByLetter("X"),\
                                self.shootgamepad.getButtonByLetter("A"),\
                                self.shootgamepad.getButtonByLetter("Y"))
            # if self.shootgamepad.getButtonByLetter("RB"):
            #     self.Lift.liftUp()
            # elif self.shootgamepad.getButtonByLetter("LB"):
            #     self.Lift.pullUp()
            # else:
            #     self.Lift.stop()

                
            self.Arm.update()

            # else:
            #     self.Shooter.update(self.shootgamepad.getButtonByLetter("B"), self.shootgamepad.getButtonByLetter("X"),
            #                                 False, self.shootgamepad.getButtonByLetter("LB"))

            # print ("Slowed:" + str(self.slowed))
            # print ("FL: " + str(self.FL.getEncVelocity()))
        #self.Logger.printCurrents()
        #print("turn: " + str(turn)\
        #    + " mag: " + str(magnitude)\
        #    + " dir: " + str(direction))

if __name__ == "__main__":
    wpilib.run(MainRobot)