Go to Post Lose a year of bumper making and everyone's a rookie again. - mrnoble [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-01-2013, 22:52
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Robot code crashing after a while?

For some reason, when I run my code, it works for a while, then just randomly stops. I get a thing saying that there isn't any robot code running, but the little light on the DS says otherwise. I can switch modes and enable them with no issues, but still, the robot will not do anything. Aside from the crashes, everything works perfectly (Minus some potentiometer madness on our shooter tilt).

The source can be found here:
http://bitbucket.org/teammetalcow/ultimateascent
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2013, 08:09
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 987
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Robot code crashing after a while?

Two things to check to figure out what is crashing:

1. Check the Free RAM on the Driver Station Chart tab, if this number is constantly decreasing to 0 while the robot is running your code leaks memory
2. Make sure NetConsole is enabled using he imaging tool, then open NetConsole, boot the cRIO (so you know Netconsole is working) then see if your code is reporting an exception when it crashes
3. If neither of the above is happening your code is likely hitting a semaphore deadlock. Running through the debugger may help locate it.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2013, 12:34
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,039
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Robot code crashing after a while?

You might try disabling the watchdog, and see if that fixes it. If it does, then re-enable it and figure out where you're forgetting to feed the watchdog.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #4   Spotlight this post!  
Unread 24-01-2013, 14:13
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Re: Robot code crashing after a while?

Quote:
Originally Posted by RufflesRidge View Post
Two things to check to figure out what is crashing:

1. Check the Free RAM on the Driver Station Chart tab, if this number is constantly decreasing to 0 while the robot is running your code leaks memory
2. Make sure NetConsole is enabled using he imaging tool, then open NetConsole, boot the cRIO (so you know Netconsole is working) then see if your code is reporting an exception when it crashes
3. If neither of the above is happening your code is likely hitting a semaphore deadlock. Running through the debugger may help locate it.
1. Ill try this tonight. If it is a memory leak, how would I fix this? (What would even cause this?)
2. It is enabled (The Console Out switch, yes?) and I will check this tonight.
3. I disabled the semaphores we have and am not starting the second task I have, so I dont think I have any semaphores to deadlock with.

Quote:
Originally Posted by virtuald View Post
You might try disabling the watchdog, and see if that fixes it. If it does, then re-enable it and figure out where you're forgetting to feed the watchdog.
I'm not getting any watchdog errors or messages or lights or anything, but if Ruffles' suggestions don't work, I will do this.
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage
Reply With Quote
  #5   Spotlight this post!  
Unread 28-01-2013, 10:06
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Re: Robot code crashing after a while?

I changed a few things and the code worked fine... I think I was allocating a resource twice.
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage
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 02:56.

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