Go to Post If you always do what you’ve always done, you’ll always get what you’ve always gotten. - rourke [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2014, 15:34
Arrowhead Arrowhead is offline
Registered User
AKA: Daniel Brown
FRC #1369 (1369 Minotaur)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Tampa, Florida
Posts: 49
Arrowhead is an unknown quantity at this point
SmartDashboard causing Watchdog errors

We are trying to use the SmartDashboard in our program to display some data related to the operation of our robot. The only data we are sending is doubles, yet whenever we try and use the SmartDashboard, it causes "Watchdog Not Fed" errors. Anyone know whats going on? For reference, we are using c++.
  #2   Spotlight this post!  
Unread 13-02-2014, 16:11
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 305
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: SmartDashboard causing Watchdog errors

Since I don't know anything about the structure of your code it is hard to guess what the problem is, but there is one possibility that you are sending the updates too frequently. We, for example, only update the SmartDashboard once every 10 loops (which are timed to be 0.02sec each). If you update too frequently it can cause a large delay which could cause a WatchDog error.

Are you deriving your robot class from SimpleRobot or IterativeRobot? How often are you updating the Dashboard?
__________________
  #3   Spotlight this post!  
Unread 13-02-2014, 16:18
Arrowhead Arrowhead is offline
Registered User
AKA: Daniel Brown
FRC #1369 (1369 Minotaur)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Tampa, Florida
Posts: 49
Arrowhead is an unknown quantity at this point
Re: SmartDashboard causing Watchdog errors

We are using a customs robot class derived from IterativeRobot. The entire loop is updated every .02 seconds.
  #4   Spotlight this post!  
Unread 13-02-2014, 16:21
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: SmartDashboard causing Watchdog errors

Can you confirm that when your SmartDashboard code is removed that your robot does not have WatchDog problems? Can you confirm that the causation of the problem is based on the presence of SmartDashboard calls?

The reason I ask is because there are many different ways to get that error. Should the problem be related to the SmartDashboard, my guess would be MamaSpoldi's -- that those calls are slowing down the loop too much for the WatchDog's taste.

However, I have not seen that error before with regards to the SmartDashboard. At least, not on Java.
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.

Last edited by brennonbrimhall : 13-02-2014 at 16:25.
  #5   Spotlight this post!  
Unread 13-02-2014, 16:22
Arrowhead Arrowhead is offline
Registered User
AKA: Daniel Brown
FRC #1369 (1369 Minotaur)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Tampa, Florida
Posts: 49
Arrowhead is an unknown quantity at this point
Re: SmartDashboard causing Watchdog errors

Quote:
Originally Posted by brennonbrimhall View Post
Can you confirm that when your SmartDashboard code is removed that your robot does not have WatchDog problems? E.g., are you sure that the problem is in the SmartDashboard code?
Yes, we ran the code with the SmartDashboard code running and it gave watchdog errors. We then commented out only the SmartDashboard lines and we got no errors.
  #6   Spotlight this post!  
Unread 13-02-2014, 16:37
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,058
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: SmartDashboard causing Watchdog errors

It sounds like it could be possibly related to this issue that I filed at WPILib's C++ Tracker.

Currently, the way the C++ NetworkTables is implemented, anytime you call Put*, it tries to obtain a lock -- which is also the lock that the write thread is holding. The effect is if your robot is blocking when writing to the network (which is likely, particularly if you're writing a lot of keys), then the robot will hang at Put* until the write completes. One way this can manifest itself also is in a complete hang of the robot if a NetworkTables client disconnects from the network, because the write thread blocks (practically) indefinitely.

I've implemented a fix for the performance issue (though it only partially solves the hang issue), and it's available in the RobotPy fork of WPILib (see this commit).
__________________
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
  #7   Spotlight this post!  
Unread 13-02-2014, 16:42
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 305
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: SmartDashboard causing Watchdog errors

I would suggest not updating the dashboard everytime through the loop. A person cannot possibly process the change in the values that quickly anyway.

Here is a snippet of code that we use to do this. It is simple and still gives a very prompt dashboard update.
Code:
    if (dashCounter == 10)
    {
        // these are the calls to our classes to update the dashboard
        thor->UpdateDash();
        loki->UpdateDash();
        valkyrie->UpdateDash();
       
        dashCounter = 0;
        ds->UpdateLCD();        
    }
    else
    {
        dashCounter++;
    }
__________________
  #8   Spotlight this post!  
Unread 13-02-2014, 16:50
Arrowhead Arrowhead is offline
Registered User
AKA: Daniel Brown
FRC #1369 (1369 Minotaur)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Tampa, Florida
Posts: 49
Arrowhead is an unknown quantity at this point
Re: SmartDashboard causing Watchdog errors

Quote:
Originally Posted by MamaSpoldi View Post
I would suggest not updating the dashboard everytime through the loop. A person cannot possibly process the change in the values that quickly anyway.

Here is a snippet of code that we use to do this. It is simple and still gives a very prompt dashboard update.
Code:
    if (dashCounter == 10)
    {
        // these are the calls to our classes to update the dashboard
        thor->UpdateDash();
        loki->UpdateDash();
        valkyrie->UpdateDash();
       
        dashCounter = 0;
        ds->UpdateLCD();        
    }
    else
    {
        dashCounter++;
    }
Thanks, I'll test this out.
Closed Thread


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:34.

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