|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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);
....
Last edited by Jay Meldrum : 02-17-2014 at 01:05 PM. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|