FRC1076 / RobotKitLib

Robotpy-WPILIB equivalent for raspberry pi robot kit
1 stars 1 forks source link

Newly added pikitlib files do not get properly deployed. #79

Closed mcolinj closed 3 years ago

mcolinj commented 3 years ago

Newly added pikitlib file (in my case led.py) is not correctly deployed to the robot. The new file ends up in the RobotCode/pikitlib subdirectory, but the robotrunner imports the original pikitlib outside of the RobotCode directory. Because that import is cached, the robot.py import does not import the new file (it just uses the cache).

The end result is the following error after deployment:

Jan 01 23:05:46 raspberrypi python3[2576]: DEBUG:nt.th:Started thread connection-notifier-0 Jan 01 23:05:46 raspberrypi python3[2576]: DEBUG:nt:Listening on 1735 Jan 01 23:05:46 raspberrypi python3[2576]: Traceback (most recent call last): Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/run.py", line 214, in Jan 01 23:05:46 raspberrypi python3[2576]: m.start() Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/run.py", line 91, in start Jan 01 23:05:46 raspberrypi python3[2576]: self.r.robotInit() Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/RobotCode/pikitlib/robot.py", lin Jan 01 23:05:46 raspberrypi python3[2576]: self.leds = pikitlib.Led() Jan 01 23:05:46 raspberrypi python3[2576]: AttributeError: module 'pikitlib' has no attribute 'Led'

I was able to work around this by copying the file from RobotCode/pikitlib to ../pikitlib/pikitlib on the robot after deployment (and then issuing a "sudo service robotrunner restart").

EmilyRobotics commented 3 years ago

Should be fixed now as of recent commit