|
Re: RobotPy: Python for FRC
Quote:
Originally Posted by andreboos
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)
|