Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Python (http://www.chiefdelphi.com/forums/forumdisplay.php?f=187)
-   -   No Robot Code (http://www.chiefdelphi.com/forums/showthread.php?t=95078)

Nickle 06-05-2011 19:34

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

Re: No Robot Code
 
Quote:

Originally Posted by Nickle (Post 1059847)
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"?

Nickle 08-05-2011 18:59

Re: No Robot Code
 
It basically shows the output of the code and tells if there are any errors.

Peter Johnson 09-05-2011 00:12

Re: No Robot Code
 
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).

Nickle 09-05-2011 17:59

Re: No Robot Code
 
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

Re: No Robot Code
 
Quote:

Originally Posted by Nickle (Post 1060478)
Code:

    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?

Joe G. 25-06-2011 04:12

Re: No Robot Code
 
^reported, sig spam. Still, its nice to see them ask detailed, relevant, well-worded questions. :D


All times are GMT -5. The time now is 19:49.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi