View Single Post
  #1   Spotlight this post!  
Unread 14-03-2014, 02:48
myork myork is offline
Registered User
FRC #2928
 
Join Date: Feb 2014
Location: United States
Posts: 11
myork has a spectacular aura aboutmyork has a spectacular aura about
PIDController causing code to fail silently

Hola,

We attempted to add a PIDController to our RobotPy code:


self.left_motors = wpilib.Talon(2)
self.left_encoder = wpilib.Encoder(2, 3)
self.left_pid_controller = wpilib.PIDController(self.p, self.i, self.d, self.left_encoder, self.left_motors)


But having the PIDController constructor line causes very strange behavior:

We raise a SystemExit when a joystick button is pressed in order to have RobotPy hot reload the code. This works fine, but if we include the PIDController line the code completely stops running. By "stops running" I mean Robot Comms are green, Robot Code is green, SmartDashboard says it's connected, but the none of the code is run. Print statements won't work, SmartDashboard updates on every tick aren't happening, etc. There is no Python running on the cRio.

Any idea what's going on or how to fix it?
Reply With Quote