|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
||||
|
||||
|
Re: No Robot Code
What do you mean when you say "runs in the net console"?
|
|
#3
|
|||
|
|||
|
Re: No Robot Code
It basically shows the output of the code and tells if there are any errors.
|
|
#4
|
|||
|
|||
|
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).
|
|
#5
|
|||
|
|||
|
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] |
|
#6
|
|||
|
|||
|
Re: No Robot Code
I don't see checkRestart() defined... are you sure your code isn't raising an exception here and dying?
|
|
#7
|
|||||
|
|||||
|
Re: No Robot Code
^reported, sig spam. Still, its nice to see them ask detailed, relevant, well-worded questions.
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|