Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   roboRIO Command Based Problems (http://www.chiefdelphi.com/forums/showthread.php?t=133698)

King Nerd III 01-29-2015 11:45 PM

roboRIO Command Based Problems
 
Has anyone else had problems with the roboRIO deleting Command Based code as soon as teleop is enabled? It's probably the worst problem we've had so far.

kylelanman 01-30-2015 12:56 AM

Re: roboRIO Command Based Problems
 
What do you mean by deleting it?

If the robot code light is turning off then most likely you are not initializing something properly and are getting null pointer exception and crashing your program on the RoboRio.

You can check the driver station log area for errors or you can do "Debug As" instead of "Run As" in eclipse. When your code crashes while debugging it will drop you in to the debugger with a stack trace showing you where the problem is.

If you are still having problems after that then post your code and we can take a look at it.

King Nerd III 01-30-2015 12:59 AM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by kylelanman (Post 1435986)
What do you mean by deleting it?

If the robot code light is turning off then most likely you are not initializing something properly and are getting null pointer exception and crashing your program on the RoboRio.

You can check the driver station log area for errors or you can do "Debug As" instead of "Run As" in eclipse. When your code crashes while debugging it will drop you in to the debugger with a stack trace showing you where the problem is.

If you are still having problems after that then post your code and we can take a look at it.

I mean it literally deletes it. The roboRIO says there is no code loaded, even if restarted.

kylelanman 01-30-2015 01:08 AM

Re: roboRIO Command Based Problems
 
What are the steps you are using to deploy your code to the RoboRio?

It is also possible that you are not initializing something properly in robotinit which runs before the robot is enabled.

It is entirely possible that the code is getting deleted as you have suggested but the Robot Code light is indicative of whether or not your program is running oppose to if your program actually exists on the RoboRio.

King Nerd III 01-30-2015 01:10 AM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by kylelanman (Post 1435990)
What are the steps you are using to deploy your code to the RoboRio?

It is also possible that you are not initializing something properly in robotinit which runs before the robot is enabled.

It is entirely possible that the code is getting deleted as you have suggested but the Robot Code light is indicative of whether or not your program is running oppose to if your program actually exists on the RoboRio.

We're going to reformat it again, that helped last time. Its annoying, though, as everytime we reformat it something else breaks.

Ben Wolsieffer 01-30-2015 08:59 AM

Re: roboRIO Command Based Problems
 
Are you sure your code is not crashing? When your code crashes, the robot code light will turn off and a stack trace should be printed to the log window in the DS. I doubt it is actually being deleted.

King Nerd III 02-03-2015 11:33 AM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by lopsided98 (Post 1436030)
Are you sure your code is not crashing? When your code crashes, the robot code light will turn off and a stack trace should be printed to the log window in the DS. I doubt it is actually being deleted.

We fixed the problem by reformatting it 20 or so times. We also had a problem with a roboRIO where some kid turned it off WHILE IT WAS FORMATTING. Of course we fixed it, but it took a bunch of formatting.
Long story short the lesson here is when in doubt reformat until it works!

Alan Anderson 02-03-2015 11:49 AM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by King Nerd III (Post 1437645)
Long story short the lesson here is when in doubt reformat until it works!

I doubt that is good advice. Unless there is something physically wrong with the system, reimaging a roboRIO a bunch of times can't do anything that reimaging it once will do. The class of problems that can be solved with a single reimage step is very small, and they are very rare.

Instead of going for the reimaging/reformatting voodoo, you should troubleshoot your original problem using the tools suggested here by the people trying to help you.

King Nerd III 02-03-2015 11:52 AM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by Alan Anderson (Post 1437652)
I doubt that is good advice. Unless there is something physically wrong with the system, reimaging a roboRIO a bunch of times can't do anything that reimaging it once will do. The class of problems that can be solved with a single reimage step is very small, and they are very rare.

Instead of going for the reimaging/reformatting voodoo, you should troubleshoot your original problem using the tools suggested here by the people trying to help you.

It's usually all that works for us. The troubleshooting will help with minor things, but when the robot is turned off mid format? Nothing else would help. Heck, the troubleshooting tools wouldn't even detect the roboRIO.

solopilot 02-03-2015 12:27 PM

Re: roboRIO Command Based Problems
 
Could it be that you are taking too long in a command's execute() function?

King Nerd III 02-03-2015 12:53 PM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by solopilot (Post 1437670)
Could it be that you are taking too long in a command's execute() function?

We do occasionally and randomly get an error that says something about MotorSafetyHelper.h not updating fast enough on line 117, but there are two problems. One is that MotorSafetyHelper.h has no line 117, and we start running it. Any ideas?

Ben Wolsieffer 02-03-2015 01:47 PM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by King Nerd III (Post 1437673)
We do occasionally and randomly get an error that says something about MotorSafetyHelper.h not updating fast enough on line 117, but there are two problems. One is that MotorSafetyHelper.h has no line 117, and we start running it. Any ideas?

You are getting the MotorSafetyHelper error because you are not updating the motor outputs fast enough so the watchdog timer is expiring. If any execute method blocks for a long time, it will prevent all commands from running, therefore causing a watchdog timeout.

King Nerd III 02-03-2015 01:48 PM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by lopsided98 (Post 1437693)
You are getting the MotorSafetyHelper error because you are not updating the motor outputs fast enough so the watchdog timer is expiring. If any execute method blocks for a long time, it will prevent all commands from running, therefore causing a watchdog timeout.

That's what we thought, but it doesn't happen every single time, which confused me. How would we fix that?

Alan Anderson 02-03-2015 02:15 PM

Re: roboRIO Command Based Problems
 
Quote:

Originally Posted by King Nerd III (Post 1437694)
How would we fix that?

That depends on what is making it take too long. We can guess at possible causes, but unless you show us your code we can't give confident help.

Post your code, as Kyle suggested in his first response.

King Nerd III 02-03-2015 02:29 PM

Re: roboRIO Command Based Problems
 
5 Attachment(s)
Quote:

Originally Posted by Alan Anderson (Post 1437713)
That depends on what is making it take too long. We can guess at possible causes, but unless you show us your code we can't give confident help.

Post your code, as Kyle suggested in his first response.

I added the DriveBase subsystem, and the drive command to the post. Tell me what you think.


All times are GMT -5. The time now is 10:51 AM.

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