def robotInit(self): '''Robot initialization function''' #positions = [0,-625,-1210,-1815,-2425,-2635] positions = [0, -325, -650, -975, -1300, -1395] scorePos = [0, 0, -275, -545, -805, -1075] self.motorFrontRight = wp.TalonSRX(frontRightPort) self.motorBackRight = wp.TalonSRX(backRightPort) self.motorFrontLeft = wp.TalonSRX(frontLeftPort) self.motorBackLeft = wp.TalonSRX(backLeftPort) self.stick = joy.happyHappyJoyJoy(leftDriveJoyPort) self.stick2 = joy.happyHappyJoyJoy(rightDriveJoyPort) self.cop = joy.happyHappyJoyJoy(coPilotJoyPort) self.smartDs = wp.SmartDashboard() #the smart dashboard communication self.accel = wp.BuiltInAccelerometer() self.feeders = feed.feedMe(feederLeftPort, feederRightPort, feedUpChannel, feedDownChannel, 0.35) self.rightSwitch = wp.DigitalInput(rightToteDetPort) self.leftSwitch = wp.DigitalInput(leftToteDetPort) self.autoSwitch = wp.DigitalInput(autoSwitchPort) self.comp = wp.Compressor() self.Vator = ele.elevatorObj(liftMotPort,liftEncdAPort, liftEncdBPort,positions, scorePos, 0.75, 30) try: self.camServ = wp.CameraServer() self.usbCam = wp.USBCamera() self.usbCam.setExposureManual(50) self.usbCam.setBrightness(80) self.usbCam.updateSettings() # force update before we start thread self.camServ.startAutomaticCapture(self.usbCam) except: pass
def robotInit(self): '''Robot initialization function''' #positions = [0,-625,-1210,-1815,-2425,-2635] positions = [0, -325, -650, -975, -1300, -1395] scorePos = [0, 0, -275, -545, -805, -1075] self.motorFrontRight = wp.TalonSRX(frontRightPort) self.motorBackRight = wp.TalonSRX(backRightPort) self.motorFrontLeft = wp.TalonSRX(frontLeftPort) self.motorBackLeft = wp.TalonSRX(backLeftPort) self.stick = joy.happyHappyJoyJoy(leftDriveJoyPort) self.stick2 = joy.happyHappyJoyJoy(rightDriveJoyPort) self.cop = joy.happyHappyJoyJoy(coPilotJoyPort) self.smartDs = wp.SmartDashboard() #the smart dashboard communication self.accel = wp.BuiltInAccelerometer() self.driveEncd = wp.Encoder(driveEncdAPort, driveEncdBPort) self.feeders = feed.feedMe(feederLeftPort, feederRightPort, feedUpChannel, feedDownChannel, 0.35) self.rightSwitch = wp.DigitalInput(rightToteDetPort) self.leftSwitch = wp.DigitalInput(leftToteDetPort) self.autoSwitch = wp.DigitalInput(autoSwitchPort) self.comp = wp.Compressor() self.Vator = ele.elevatorObj(liftMotPort, liftEncdAPort, liftEncdBPort, positions, scorePos, 0.75, 30) try: self.camServ = wp.CameraServer() self.usbCam = wp.USBCamera() self.usbCam.setExposureManual(50) self.usbCam.setBrightness(80) self.usbCam.updateSettings() # force update before we start thread self.camServ.startAutomaticCapture(self.usbCam) except: pass