Example #1
0
 def teleopInit(self):
     '''Called only at the beginning of teleoperated mode'''
     self.drivetrain.zeroEncoders()
     #How the buttons for the xbox controller are mapped
     self.drivetrain.init_logger()
     b = JoystickButton(self.joystick, 7)  #A
     b2 = JoystickButton(self.joystick, 8)  #B
     #b.whenPressed(self.angle)
     b2.cancelWhenPressed(self.angle)
Example #2
0
    def teleopInit(self):
        '''Called only at the beginning of teleoperated mode'''
        #How the buttons for the xbox controller are mapped
        self.drivetrain.init_logger()
        b = JoystickButton(self.joystick, 1)  #A
        b2 = JoystickButton(self.joystick, 2)  #B
        b.whenPressed(self.angle)
        b2.cancelWhenPressed(self.angle)

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