View Full Version : No Robot Code
My team is elavuating using RobotPy for next year and is planning on using it for a post season event. We are using RobotPy version 2011.2 and version 29 of the cRIO. The code runs in the net console but the driver station says no robot code.
virtuald
07-05-2011, 02:05
My team is elavuating using RobotPy for next year and is planning on using it for a post season event. We are using RobotPy version 2011.2 and version 29 of the cRIO. The code runs in the net console but the driver station says no robot code.
What do you mean when you say "runs in the net console"?
It basically shows the output of the code and tells if there are any errors.
Peter Johnson
09-05-2011, 00:12
Can you copy and paste the NetConsole output here and your robot.py as well? I suspect what is happening if you don't have any errors is that your code is exiting near-immediately (e.g. your robot.py's run() function returns). There should either be a while 1: loop in either run() or one of the functions it calls (such as the SimpleRobot.StartCompetition() function).
Here's a copy of my robot.py sorry but I can't get the NetConsole output until tomorrow.
[code]
import wpilib
lstick = wpilib.Joystick(1)
ljag = wpilib.CANJaguar(3)
rstick = wpilib.Joystick(2)
rjag = wpilib.CANJaguar(4)
def disabled(): pass
def autonomous(): pass
def teleop():
dog = wpilib.GetWatchdog()
dog.SetEnabled(True)
dog.SetExpiration(0.25)
while wpilib.IsOperatorControl() and wpilib.IsEnabled():
dog.Feed()
checkRestart()
def run():
"""Main loop"""
while 1:
if wpilib.IsDisabled():
print("Running disabled()")
disabled()
while wpilib.IsDisabled():
wpilib.Wait(0.01)
elif wpilib.IsAutonomous():
print("Running autonomous()")
autonomous()
while wpilib.IsAutonomous() and wpilib.IsEnabled():
wpilib.Wait(0.01)
else:
print("Running teleop()")
teleop()
while wpilib.IsOperatorControl() and wpilib.IsEnabled():
wpilib.Wait(0.01)
[\code]
Peter Johnson
10-05-2011, 01:06
while wpilib.IsOperatorControl() and wpilib.IsEnabled():
dog.Feed()
checkRestart()
I don't see checkRestart() defined... are you sure your code isn't raising an exception here and dying?
^reported, sig spam. Still, its nice to see them ask detailed, relevant, well-worded questions. (http://xkcd.com/810/) :D
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.