TalonSRX + Encoder - Detecting Failure

We’re diving into using the Rev Through Bore encoder with a Talon SRX to control shooter RPMs.

Anyone know what the “correct” way to detect if the encoder is connected? Our hope is if the encoder gets unplugged by matchplay (or by someone forgetting to plug it in, which obviously never happens) that we revert to some other behavior.

Surprisingly an hour of googling around hasn’t returned anything obvious. My best guess without much testing is to see if the sensor is returned by the “TalonSRX.getSensorCollection()” method. But I wanted to see if anyone else has experience here.

I attempted to solve this problem a while ago, the solution in this thread is what I ended up going with. Note that I have had 1 false positive of a failure (and as far as I know, no false negatives) in it’s usage over 3 robot, 2 years.

Another thing to note that in the above thread, the sensor connected to the TalonSRX was a CTRE mag encoder.

1 Like

That method should work if the absolute output from the hex bore encoder is connected to the SRX.


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.