So I ran your code and noticed that the error was wpilib.motorsafety... to fix this, under
Code:
self.robot_drive=wpilib.RobotDrive(self.motor1,self.motor2)
insert
Code:
self.robot_drive.setSafetyEnabled(False)
Also, no need for
Code:
self.teleopPeriodic()
. I think Peter Johnson mentioned this. Wpilib will call it on its own. And keep the while loop in teleop, and add
Code:
wpilib.Timer.delay(.01)
inside the loop.