View Single Post
  #23   Spotlight this post!  
Unread 07-11-2010, 19:55
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 253
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: RobotPy: Python for FRC

Quote:
Originally Posted by andreboos View Post
However, WPILib also throws (fatal) "resource resuse [sic]" errors when WPILib instances from the Python code are not properly deleted before the script ends and the same resources are used in teleoperated code. I'm still resolving the kinks in WPILib on Python, but Python itself runs fine.
Unfortunately I haven't yet been able to get Python to always call the WPILib destructors. It does seem to call them if you explicitly del the WPILib Python variables, but that's obviously non-ideal. I'm actively trying to get this fixed (it's tied in with how Python unloads modules, so it's somewhat of a pain). Note it'll probably always be necessary to call gc.collect() explicitly to ensure the objects are destroyed (the default boot.py will do this).

Glad you were able to have some early success even not using the library how it's designed (as a full-up Python solution)!
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote