View Single Post
  #1   Spotlight this post!  
Unread 29-02-2012, 23:27
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: How to tell if hardware component is detached?

Well then, if you want to do the work. Unfortunately, different components have different ways to report failures. For example, if you are using CANJaguar, WPILib will set error status when an operation failed. So in theory, you can query this status.
So for each component that you wish to write recovery code for, you need to look through the source code of WPILib and find a way to "poll" the health status of the hardware. CANJaguar is an easy one. If you are using PWM for Jaguars, that may be harder. Since PWM is an output only signal. So there is no feedback you can examine. Regarding camera, I haven't looked through it in too much details, but it seems the camera task also has some sort of status that you may be able to query. Like I said, if you want to do the work, you need to dig into the source code of WPILib.
__________________
Reply With Quote