Thread: Watchdogs
View Single Post
  #2   Spotlight this post!  
Unread 28-03-2011, 18:21
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Watchdogs

Quote:
Originally Posted by Ian McShane View Post
Can someone give me a brief overview on what watchdogs are? what they do and how they work.
A simple explanation is a watchdog is a protection in the software to be sure your code doesn't take too much time to execute. One example that may cause this is if your code gets stuck in an infinite loop.

How does this protect your robot (and protect you from getting hurt)?

Let's say you command your drive motors to full power. Then let's say your code gets stuck in an infinite loop somewhere. In this situation, your motors would be at full power forever and your robot would crash into something, which is bad. Since you aren't feeding the watchdog during the infinite loop, eventually the watchdog would time-out, killing the power to your motors.

Basically, the watchdog is protection in your code to kill your motors if something goes wrong in your code.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote