|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Watchdog not being fed
Is this a Watchdog error, or is this the "MotorSafetyHelper: Motor has not been updated often enough" error?
MotorSafetyHelper errors can be pretty common. They occur if you don't constant send new control values to your motors. If you're convinced your code is alright, you can use the SetSafetyEnabled(false) method to disable the MotorSafetyHelper for a particular motor or motors. |
|
#2
|
|||
|
|||
|
Re: Watchdog not being fed
Here is the code we are using, its in C++. Please check it and tell us if there is anything wrong with it. We still haven't found anything in the code, hopefully one of you can.
Quote:
|
|
#3
|
||||
|
||||
|
Re: Watchdog not being fed
If it's not fed, you have to kill it and bury its body in the backyard.
- WPILibrary |
|
#4
|
|||
|
|||
|
Re: Watchdog not being fed
The code you posted isn't using the Watchdog, can you post exactly the error you are seeing and where on the DS you are seeing it?
Also try installing the Driver Station Update 3 from here: http://joule.ni.com/nidu/cds/view/p/id/2263 Then you can look at your Trip Time and Lost Packets in green and blue respectively on the Charts tab of the DS. Last edited by RufflesRidge : 17-02-2013 at 18:15. |
|
#5
|
|||||
|
|||||
|
Re: Watchdog not being fed
I agree that you don't seem to be using the watchdog anywhere. While there's a Watchdog that's a member of the SimpleRobot class you derive from, the SimpleRobot constructor disables it by default. You have to actively enable it for it to do something. If you're really sure that's the problem, you can call GetWatchdog to get it, or simply access it directly at m_watchdog. If you put m_watchdog.SetEnabled(false) in your constructor, that'll guarantee it's disabled.
On the other hand, your buttons for driving the robot forward,backward, etc. for a fixed amount of time will definitely cause problems and MotorSafetyHelper errors. Putting a Wait() in your OperatorControl while loop is a really bad idea, because it stops everything else and waits. It's also not likely to do what you want. If you have MotorSafety enabled, then your robot drive is expecting a new TankDrive or ArcadeDrive or somethingDrive command every 0.1 seconds. If you don't update it, MotorSafety will disable that motor until you command it again. So you give it that TankDrive(-.3,-.3) command, then wait 2 seconds with a command, which kills your motor, then you command it (0,0). On the other hand, if you have MotorSafety disable, everything else keeps doing what it was doing just before you hit that button. If your armmotor was going down and you hit the backup button, that armmotor is going to keep going down for two seconds, limit switch or no. So mostly, you shouldn't be using a Wait() in your OperatorControl loop. |
|
#6
|
|||
|
|||
|
Re: Watchdog not being fed
What is the alternative to Wait? That is what we have been using to release CPU time to other threads. So far, we have not had a problem. Although, we use wait only at the bottom of the code, not inside the code. We use timers for that.
Last edited by rich2202 : 18-02-2013 at 17:59. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|