Committing some more work
This commit is contained in:
0
18 - CameraServer and Shuffleboard/README.md
Normal file
0
18 - CameraServer and Shuffleboard/README.md
Normal file
38
18 - CameraServer and Shuffleboard/robot.py
Normal file
38
18 - CameraServer and Shuffleboard/robot.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import wpilib
|
||||
import wpilib.drive
|
||||
import wpilib.cameraserver
|
||||
import ctre
|
||||
|
||||
# THIS EXAMPLE IS INCOMPLETE BECAUSE CSCORE SUPPORT ON WINDOWS IS
|
||||
# NOT WELL TESTED AND IS VERY DIFFICULT TO GET WORKING, PLEASE IGNORE THIS EXAMPLE
|
||||
# FOR THE TIME BEING
|
||||
class MyRobot(wpilib.TimedRobot):
|
||||
def robotInit(self):
|
||||
self.leftFront = ctre.WPI_VictorSPX(0)
|
||||
self.leftRear = ctre.WPI_VictorSPX(1)
|
||||
self.rightFront = ctre.WPI_VictorSPX(2)
|
||||
self.rightRear = ctre.WPI_VictorSPX(3)
|
||||
|
||||
self.left = wpilib.MotorControllerGroup(self.leftFront, self.leftRear)
|
||||
self.right = wpilib.MotorControllerGroup(self.rightFront, self.rightRear)
|
||||
self.right.setInverted(True)
|
||||
|
||||
self.drivetrain = wpilib.drive.DifferentialDrive(self.left, self.right)
|
||||
|
||||
self.primary = wpilib.XboxController(0)
|
||||
|
||||
|
||||
def autonomousInit(self):
|
||||
pass
|
||||
|
||||
def autonomousPeriodic(self):
|
||||
pass
|
||||
|
||||
def teleopInit(self):
|
||||
pass
|
||||
|
||||
def teleopPeriodic(self):
|
||||
self.drivetrain.arcadeDrive(self.primary.getLeftY(), self.primary.getLeftX())
|
||||
|
||||
if __name__ == "__main__":
|
||||
wpilib.run(MyRobot)
|
||||
Reference in New Issue
Block a user