View Single Post
  #1   Spotlight this post!  
Unread 10-04-2013, 17:31
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
Re: Loss of DS control authority while motors still operate

We found and fixed this problem but I thought I should reply to this thread for posterity in case it appears in anyone's future search results.

We typically see two types of error from the CAN system
  • something serious usually caused by wiring problems (power or CAN) and detected in the CANJaguar constructor, or
  • transitory errors from an occasional packet.
When we see a transitory error we set an indicator light for the appropriate subsystem on the SmartDashboard and recently we have also been logging the error message.
The error message was logged from the exception using the getMessage() method, but we discovered that getMessage() can return NULL so we were sometimes sending NULL to the SmartDashboard hence getting a runtime exception and user code crash.

To solve the problem we made two changes:
  • wrap the top level code in a try {} catch {}
  • using the toString() method for the exception to safely pass a string to SmartDashboard
Reply With Quote