Go to Post If you don't like physical play build a stronger robot. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 29-01-2015, 23:45
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2015, 00:56
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 189
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
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.
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2015, 00:59
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: roboRIO Command Based Problems

Quote:
Originally Posted by kylelanman View Post
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2015, 01:08
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 189
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
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.
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2015, 01:10
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: roboRIO Command Based Problems

Quote:
Originally Posted by kylelanman View Post
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2015, 08:59
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
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.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #7   Spotlight this post!  
Unread 03-02-2015, 11:33
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: roboRIO Command Based Problems

Quote:
Originally Posted by lopsided98 View Post
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!
Reply With Quote
  #8   Spotlight this post!  
Unread 03-02-2015, 11:49
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: roboRIO Command Based Problems

Quote:
Originally Posted by King Nerd III View Post
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 03-02-2015, 11:52
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: roboRIO Command Based Problems

Quote:
Originally Posted by Alan Anderson View Post
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.
Reply With Quote
  #10   Spotlight this post!  
Unread 03-02-2015, 12:27
solopilot solopilot is offline
Mentor
FRC #0293
 
Join Date: Jan 2009
Rookie Year: 2008
Location: PA, USA
Posts: 36
solopilot is a name known to allsolopilot is a name known to allsolopilot is a name known to allsolopilot is a name known to allsolopilot is a name known to allsolopilot is a name known to all
Re: roboRIO Command Based Problems

Could it be that you are taking too long in a command's execute() function?
Reply With Quote
  #11   Spotlight this post!  
Unread 03-02-2015, 12:53
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: roboRIO Command Based Problems

Quote:
Originally Posted by solopilot View Post
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?
Reply With Quote
  #12   Spotlight this post!  
Unread 03-02-2015, 13:47
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: roboRIO Command Based Problems

Quote:
Originally Posted by King Nerd III View Post
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.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #13   Spotlight this post!  
Unread 03-02-2015, 13:48
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: roboRIO Command Based Problems

Quote:
Originally Posted by lopsided98 View Post
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?
Reply With Quote
  #14   Spotlight this post!  
Unread 03-02-2015, 14:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: roboRIO Command Based Problems

Quote:
Originally Posted by King Nerd III View Post
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.
Reply With Quote
  #15   Spotlight this post!  
Unread 03-02-2015, 14:29
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: roboRIO Command Based Problems

Quote:
Originally Posted by Alan Anderson View Post
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.
Attached Files
File Type: h DriveBase.h (652 Bytes, 8 views)
File Type: cpp DriveBase.cpp (1.7 KB, 14 views)
File Type: cpp TeleOpTankDrive.cpp (680 Bytes, 12 views)
File Type: h TeleOpTankDrive.h (274 Bytes, 7 views)
File Type: cpp OI.cpp (3.1 KB, 9 views)

Last edited by King Nerd III : 03-02-2015 at 14:36. Reason: added OI for oi->GetStickAxis
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 15:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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