![]() |
Robot Code Not Working
So we recently got our new CRio in, and after getting it set up, we started testing our code. We have just got the code uploaded to the CRio, but when we run it, none of our Victors do anything, and our code doesnt seem to be making any changes to anything. We built our code without errors. Here is our code, and here is the messages we get in the driver station diagnostics menu
Code:
#include "WPILib.h" <time>2/6/2013 5:28:08 AM<unique#>104 FRC: Driver Station ping status has changed. ERROR: A timeout has been exceeded: PWM 5 on module 1... Output not updated often enough. ...in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 117 ERROR: A timeout has been exceeded: PWM 7 on module 1... Output not updated often enough. ...in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 117 ERROR: A timeout has been exceeded: PWM 6 on module 1... Output not updated often enough. ...in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 117 ERROR: A timeout has been exceeded: RobotDrive... Output not updated often enough. ...in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 117 ERROR: A timeout has been exceeded: PWM 5 on module 1... Output not updated often enough. ...in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 117 [/code] |
Re: Robot Code Not Working
The code looks pretty good. I like your Victor names. Did you write all of it without testing any of it? Or has this just become a problem after getting your new cRio? It's hard to tell from all that code where exactly the problem might be. You might want to try using NetConsole and add some print statements to your code to see where it is getting locked up...the "output not updated" errors suggest your code is locked up somewhere. If you are using the WPILib PIDController class there are some defects that cause task deadlocks.
|
Re: Robot Code Not Working
You forgot to disable motor safety.
Motor safety kills the robot if you don't pass an update to the motor often enough (if i remember correctly) Just put this line: Code:
myRobot.SetSafetyEnabled(false);Code:
while (isOperatorControl()){ |
Re: Robot Code Not Working
Quote:
What is this net console you talk about? Also, what is the PIDController class? It looks like i have some reading to do |
Re: Robot Code Not Working
Quote:
Also, we shouldn't be getting timeout errors, as they should be getting updated often enough. |
Re: Robot Code Not Working
All those diagnostic messages to the DS "LCD" window might be clogging the network communication and causing enough lag to trip the motor safeties. Take them out temporarily just to see if that's the cause of your problem.
|
Re: Robot Code Not Working
Quote:
You may not need to use NetConsole since you are already sending print statements to the LCD but is here is a link to the documentation http://wpilib.screenstepslive.com/s/...ing-netconsole. PIDController is one of the classes available in the WPILib that is used for doing closed-loop PID control. Here's the link for that http://wpilib.screenstepslive.com/s/...rs-pid-control |
Re: Robot Code Not Working
So we tried running the simple robot template code on the robot, and it didnt run, so right now we are looking at the ribbon cable running between the CRio and the digital sidecar as the culprit.
We should be bale to get another one within the next 2 days or so. |
Re: Robot Code Not Working
So we switched out the CRio module for an older one and it now runs the simple robot code perfectly.
We then tried running our code. We disabled motor safety timers and still get errors about motors not being updated enough. When we start running the code in tele op after deploying it nothing happens. However, when we run autonomous the motors move, but dont stop, and dont seem to be doing anything specified in our code. If we then run the robot in tele op after running it in autonomous, the same motors stay on and dont reply to any user input. |
Re: Robot Code Not Working
Arrowhead,
Team 4243 has been having the exact same problem. Out of the box Simple Robot and Default Robot templates work out of the box on an 8-slot cRIO but fails with timeout errors on a 4-slot cRIO. This is our second year and the same problem annihilated our rookie performance last year. At that time we managed to disable the timeouts but our code effectively executed at 3 Hz instead of 50 Hz resulting in pretty embarrassing performance. Fortunately we had an 8-slot cRIO Team 342 had lent us to get some programming knowledge before last year's build season started. And, thanks to this thread, I changed out our 4-slot cRIO for the 8-slot cRIO, and the Simple Robot Template compiled and executed flawlessly!!! I repeated the experience with the Default Robot template. What a relief!! Given all the related threads on MotorSafetyHelper timeout messages, I think it is clear WPILib is not fully compatible with the 4-slot cRIO. Not last year and not this year. |
Re: Robot Code Not Working
Oh, we fixed the problem we were having, the problem was the "O" in OperatorControl wasnt capitalized :/
|
| All times are GMT -5. The time now is 12:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi