Go to Post OPR will not get you to Einstein - Paul Copioli [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 30-01-2014, 18:14
Crzycoco Crzycoco is offline
Co-Capt.
no team
 
Join Date: Dec 2012
Rookie Year: 1234
Location: C-Burg
Posts: 4
Crzycoco is an unknown quantity at this point
Lightbulb Is getWatchdog() required in RobotTemplate.java?

I was wondering if we HAVE to have getWatchdog() in our code or is it optional. I know it prevents the robot from malfunction but I don't know if it's required. Thanks guys, FIRST rules!
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2014, 19:18
jtrv's Avatar
jtrv jtrv is offline
github.com/jhtervay
AKA: Justin
FRC #2791 (Shaker Robotics)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Latham, NY
Posts: 147
jtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to all
Re: Is getWatchdog() required in RobotTemplate.java?

Would also like to know. Thanks to anyone who has the info.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2014, 19:21
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
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: Is getWatchdog() required in RobotTemplate.java?

No. If you do not know what the watchdog is or how to use it properly I recommend you avoid it.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-03-2014, 01:30
MatthewC529 MatthewC529 is offline
Lcom/mattc/halp;
AKA: Matthew
FRC #1554 (Oceanside Sailors)
Team Role: Mentor
 
Join Date: Feb 2014
Rookie Year: 2013
Location: New York
Posts: 39
MatthewC529 is on a distinguished road
Re: Is getWatchdog() required in RobotTemplate.java?

I personally use Watchdog.getInstance() in my code.

Watchdog scruffy = Watchdog.getInstance(); //for instance

getInstance() is a common method provided in Singleton classes or classes that are mean to NOT be instantiated. A good example is the Math class in Java SE 7 (Does not have getInstance()... meaning "REALLY do not get this instance"). Another example is the Java SE 7 Toolkit class which some games use for getting the screen width of your computer. It has a method called Toolkit.getDefaultToolkit() which might as well be Toolkit.getInstance().

That method ensures only ONE instance of the class EVER exists. You wouldnt want two logging classes posting to the console (in most cases) so you make it a singleton with getInstance() capability. Only one Watchdog will EVER exist. That is all that means.

You can freely use getInstance to have your own reference to the Watchdog object just so you are familiar. Like mine is named Scruffy.
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 09:10.

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