View Single Post
  #1   Spotlight this post!  
Unread 23-01-2016, 13:16
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 330
fovea1959 will become famous soon enough
How to detect missing CAN devices from Java?

We are heavily using CAN this year, but our test chassis does not have any CAN Talons or a CAN PDB on it (yet).

If we deploy our CAN-Talon-using code to a RoboRIO that does not have CAN Talons present, the robot gets "stuttery"; the PWM-based drive system keeps cutting out. We commented out all the code to get data out of the PDB and Talons (we're doing a lot of data logging while we get things tuned), and things smoothed out. It *appears* the CAN Recieve timeouts are causing problems.

Is there a good way to determine in software if a CAN Talon or PDB is absent so that we can avoid the method calls that cause issues with missing hardware?

I know we can put in a compiled-in boolean, jumper detect, or dashboard toggle to avoid the code, but would really like to just have the software self-configure....