![]() |
Problems with the watchdog (I think)
Hello, we are having some problems with getting our code to work. At first, whenever we put the robot into enabled mode, it would immediately say watchdog not fed. The thing is, we are feeding the watch dog. I commented out the camera related code, which helped a lot, but consistently, about 2 minutes after the robot is turned on, it dies to the watch dog. I have the watch dog set to 100ms time out, which seems like plenty of time, especially considering that we don't have much code yet. All we have is a bit of camera initialization (which I commented out anyway) and the code to control the mecanum wheels.
I have resolved the problem if I comment out all code except the feed statement, so I'm confident that that is working. Anyways, does anyone have any idea what could because the watch dog to trigger? I also tried setting the time out up to 1000 which had no effect so I'm a little confused. |
Re: Problems with the watchdog (I think)
Could we please see your code? You might have returned the functions, caused an exception, overflow, endless loop, etc by accident that caused the cRio to break out of the function or keep cycling over the same code segment that does not include a feed function call.
|
Re: Problems with the watchdog (I think)
Sure, I'm at home right now, but I can post the code after school tomorrow.
|
Re: Problems with the watchdog (I think)
Are you running any printf()s to send data back to the target console? We were scratching our heads over why we were having so much trouble with the watchdog until we tried commenting out all the print statements. They are expensive.
|
Re: Problems with the watchdog (I think)
Thanks for the responses. Unfortunately, our mentor was not at school today, so no robotics, so I still do not have code to post. :(
As for the printfs, they are another issue I've been looking into. I have tried the code with and with our printfs and get the same result either way. I'm not sure whether this is relevant, but when I was using them, I was unable to get them to work. I have to do a little more investigation in to them though, so I think that is a separate issue. Thxe |
Re: Problems with the watchdog (I think)
Quote:
-Joe |
Re: Problems with the watchdog (I think)
Ok, here is the code. Sorry this took so long. It is based off of the Defaut Robot. The watchdog says it is not fed about 1:45 to 2:00 minutes into teleop mode.
DefaultRobot.cpp Code:
#include <iostream.h>Code:
/* |
Re: Problems with the watchdog (I think)
You have GetWatchdog().SetExpiration() set to 100 seconds, not 100 milliseconds. You probably want GetWatchdog().SetExpiration(0.1)
I'm not positive this is the cause of your problem, but it may be (it would make sense, 100s = 1m40s, so the watchdog might starve after not being fed for so long). |
Re: Problems with the watchdog (I think)
Good Call, thanks. But even if thats the case, why isn't the watchdog getting fed? Seems to me that that would imply that there is something in the code freezing up, any idea what that might be? That would also explain why even during the time it was not disabled it was still not working. Anyway, thanks, that narrows my search for the problem a considerable amount.
|
Re: Problems with the watchdog (I think)
Not sure if this is the problem, but in your tele-op phase, you never enable the watchdog...
Not sure if that is the problem? |
| All times are GMT -5. The time now is 10:39 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi