How to use the wpilib.Jaguar function in wpilib

To help you get started, we’ve selected a few wpilib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frc1418 / 2016-robot / electrical_test / robot.py View on Github external
def createObjects(self):
        self.driveStick = xbox_controller.XboxController(0)

        # If the robot is a simulation
        if MyRobot.isSimulation():
            # Change motors to default jaguars
            self.lf_motor = wpilib.Jaguar(1)
            self.lr_motor = wpilib.Jaguar(2)
            self.rf_motor = wpilib.Jaguar(3)
            self.rr_motor = wpilib.Jaguar(4)
        # Set up drive train
        self.drive = wpilib.RobotDrive(self.lf_motor, self.lr_motor, self.rf_motor, self.rr_motor)
github frc1418 / 2016-robot / electrical_test / robot.py View on Github external
def createObjects(self):
        self.driveStick = xbox_controller.XboxController(0)

        # If the robot is a simulation
        if MyRobot.isSimulation():
            # Change motors to default jaguars
            self.lf_motor = wpilib.Jaguar(1)
            self.lr_motor = wpilib.Jaguar(2)
            self.rf_motor = wpilib.Jaguar(3)
            self.rr_motor = wpilib.Jaguar(4)
        # Set up drive train
        self.drive = wpilib.RobotDrive(self.lf_motor, self.lr_motor, self.rf_motor, self.rr_motor)
github robotpy / pyfrc / samples / physics / src / robot.py View on Github external
def robotInit(self):
        '''Robot-wide initialization code should go here'''
        
        self.lstick = wpilib.Joystick(0)
        self.rstick = wpilib.Joystick(1)
        
        self.l_motor = wpilib.Jaguar(1)
        self.r_motor = wpilib.Jaguar(2)
        
        # Position gets automatically updated as robot moves
        self.gyro = wpilib.AnalogGyro(1)
        
        self.robot_drive = wpilib.RobotDrive(self.l_motor, self.r_motor)
        
        self.motor = wpilib.Jaguar(4)
        
        self.limit1 = wpilib.DigitalInput(1)
        self.limit2 = wpilib.DigitalInput(2)
        
        self.position = wpilib.AnalogInput(2)
github robotpy / pyfrc / samples / physics-4wheel / src / robot.py View on Github external
def robotInit(self):
        '''Robot-wide initialization code should go here'''
        
        self.lstick = wpilib.Joystick(0)
        self.rstick = wpilib.Joystick(1)
        
        self.lr_motor = wpilib.Jaguar(1)
        self.rr_motor = wpilib.Jaguar(2)
        self.lf_motor = wpilib.Jaguar(3)
        self.rf_motor = wpilib.Jaguar(4)
        
        self.robot_drive = wpilib.RobotDrive(self.lf_motor, self.lr_motor,
                                             self.rf_motor, self.rr_motor)
        
        # Position gets automatically updated as robot moves
        self.gyro = wpilib.AnalogGyro(1)
github robotpy / pyfrc / samples / iterative / src / robot.py View on Github external
def robotInit(self):
        '''Robot-wide initialization code should go here'''
        
        self.lstick = wpilib.Joystick(1)
        self.motor = wpilib.Jaguar(3)
github robotpy / pyfrc / samples / physics-4wheel / src / robot.py View on Github external
def robotInit(self):
        '''Robot-wide initialization code should go here'''
        
        self.lstick = wpilib.Joystick(0)
        self.rstick = wpilib.Joystick(1)
        
        self.lr_motor = wpilib.Jaguar(1)
        self.rr_motor = wpilib.Jaguar(2)
        self.lf_motor = wpilib.Jaguar(3)
        self.rf_motor = wpilib.Jaguar(4)
        
        self.robot_drive = wpilib.RobotDrive(self.lf_motor, self.lr_motor,
                                             self.rf_motor, self.rr_motor)
        
        # Position gets automatically updated as robot moves
        self.gyro = wpilib.AnalogGyro(1)
github robotpy / pyfrc / samples / physics-4wheel / src / robot.py View on Github external
def robotInit(self):
        '''Robot-wide initialization code should go here'''
        
        self.lstick = wpilib.Joystick(0)
        self.rstick = wpilib.Joystick(1)
        
        self.lr_motor = wpilib.Jaguar(1)
        self.rr_motor = wpilib.Jaguar(2)
        self.lf_motor = wpilib.Jaguar(3)
        self.rf_motor = wpilib.Jaguar(4)
        
        self.robot_drive = wpilib.RobotDrive(self.lf_motor, self.lr_motor,
                                             self.rf_motor, self.rr_motor)
        
        # Position gets automatically updated as robot moves
        self.gyro = wpilib.AnalogGyro(1)
github robotpy / pyfrc / samples / physics / src / robot.py View on Github external
def robotInit(self):
        '''Robot-wide initialization code should go here'''
        
        self.lstick = wpilib.Joystick(0)
        self.rstick = wpilib.Joystick(1)
        
        self.l_motor = wpilib.Jaguar(1)
        self.r_motor = wpilib.Jaguar(2)
        
        # Position gets automatically updated as robot moves
        self.gyro = wpilib.AnalogGyro(1)
        
        self.robot_drive = wpilib.RobotDrive(self.l_motor, self.r_motor)
        
        self.motor = wpilib.Jaguar(4)
        
        self.limit1 = wpilib.DigitalInput(1)
        self.limit2 = wpilib.DigitalInput(2)
        
        self.position = wpilib.AnalogInput(2)
github robotpy / pyfrc / samples / physics-mecanum / src / robot.py View on Github external
def robotInit(self):
        '''Robot-wide initialization code should go here'''
        
        self.lstick = wpilib.Joystick(0)
        self.rstick = wpilib.Joystick(1)
        
        self.lr_motor = wpilib.Jaguar(1)
        self.rr_motor = wpilib.Jaguar(2)
        self.lf_motor = wpilib.Jaguar(3)
        self.rf_motor = wpilib.Jaguar(4)
        
        self.robot_drive = wpilib.RobotDrive(self.lf_motor, self.lr_motor,
                                             self.rf_motor, self.rr_motor)
        
        # The output function of a mecanum drive robot is always
        # +1 for all output wheels. However, traditionally wired
        # robots will be -1 on the left, 1 on the right.
        self.robot_drive.setInvertedMotor(wpilib.RobotDrive.MotorType.kFrontLeft, True)
        self.robot_drive.setInvertedMotor(wpilib.RobotDrive.MotorType.kRearLeft, True)
        
        # Position gets automatically updated as robot moves
        self.gyro = wpilib.AnalogGyro(1)