Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Is a watchdog necessary? (http://www.chiefdelphi.com/forums/showthread.php?t=126441)

mr_abomination 14-02-2014 12:44

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?

Jay Meldrum 17-02-2014 13:03

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);
....



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

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