Go to Post I had a life before FIRST - I just can't remember what it was. - Tom Ore [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 02-14-2014, 12:44 PM
mr_abomination mr_abomination is offline
Registered User
FRC #4733
 
Join Date: Feb 2014
Rookie Year: 2012
Location: Canada
Posts: 9
mr_abomination is an unknown quantity at this point
Is a watchdog necessary?

We are arguing about whether or not we need a watchdog for our autonomous code.

If we do need one can we stick it out of the way in a separate class watching itself?

Last edited by mr_abomination : 02-14-2014 at 12:58 PM.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-17-2014, 01:03 PM
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
Re: Is a watchdog necessary?

Although it is good programming practice, you do not need to use the watchdog.

You can easily turn it off by setting the SetSafetyEnabled in your RobotDrive object to false.

This applies to both auton and teleop.

Code:
#include "WPILib.h"

class BuiltinDefaultCode : public IterativeRobot
{
private:
	//Declare drive motors
	Talon* m_lDrive; 
	Talon* m_rDrive;
        RobotDrive* m_robotDrive;

public:


	BuiltinDefaultCode()	{
		//Initialze drive controllers
		m_lDrive = new Talon (1);
		m_rDrive = new Talon (2);

		//Initialize robot drive
		m_robotDrive = new RobotDrive (m_lDrive, m_rDrive);
		m_robotDrive->SetSafetyEnabled(false);
....
__________________
2012-2015 - FRC 67 - Programming/Controls Lead Mentor
2003-2005 - FRC 857 - Driver

Check us out at http://www.hotteam67.org
Previous year design docs, programming tutorials, and more!

Last edited by Jay Meldrum : 02-17-2014 at 01:05 PM.
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:19 AM.

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