CTRE CAN Recieve Timeout at edu.wpi.first.wpilibj.hal.CanTalonJNI.GetSensorPosition(Native Method)
edu.wpi.first.wpilibj.CANTalon.getPosition(CANTalon.java:818)
...
...
...
We were driving our practice robot, and we began getting this error seemingly out of nowhere for four different talons. And the real kicker is that it doesn’t just shut down our drive, it stops us from being able to move anything on the robot. I looked through the TalonSRX software manual and didn’t find anything about this. We have VersaPlanetary encoders hooked up to each TalonSRX too. Has anybody had this error before, and how did you solve it?
NOTE: We think it might’ve been caused by an earlier brownout, but this is untested.
Most of the time when I get this it is due to me using a talon in code that does not physically exist. My suggestion is to verify the talons have individual device id’s and then make sure those are the only ones you are talking to in code.
We get this error whenever the device isn’t properly hooked up, or otherwise isn’t visible to the RIO. Check out the web browser interface to your RIO and make sure it’s showing up on CAN, the self-tests pass, etc.
As to shutting down the whole drivetrain, we’ve shown this year that lots of CAN timeouts add lots of delay to the user controls code (we were clocking over 200ms to execute our teleopPeriodic control code with CAN timeouts, and ~10ms without the timeouts). Depending on the rest of your code, its possible you could be hitting watchdogs or other timeouts that are disabling the drive? In any case I’d expect it to be a lot less responsive.
Turns out the yellow CAN wire came out of the roboRIO. We realized this when every Talon wasn’t listed on the roboRIO page :D. Thanks for the help guys!