wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.08k stars 611 forks source link

CANTalon: no warnings when creating a device that isn't actually plugged in #96

Closed virtuald closed 8 years ago

virtuald commented 8 years ago

I tried it tonight with a variety of different configurations, in RobotPy and using Java just to double check. When I create a CANTalon object with a device number that isn't connected, I expect the robot to inform me somehow, but there are no exceptions, no error messages, nothing.

I think the CANJaguar used to throw random exceptions at runtime if a Jaguar became disconnected, and I don't think that's a good behavior -- but now the pendulum has swung to the other extreme. I think reasonable expectations are:

At robot startup, if the device doesn't exist:

If the device becomes disconnected after the object has been created:

2423 got bit by this a lot during the season. :(

virtuald commented 8 years ago

One thing that I didn't try, which I would be interested in knowing, is whether or not the Talon can respond if its communication wires are plugged in properly, but the power has been interrupted. I expect that it would not be able to respond, but if it could respond I would expect it to be treated as disconnected.

calcmogul commented 8 years ago

Since CAN bus does not provide power, the CANTalon won't be able to send or receive CAN frames while its power source is interrupted. This does not affect other devices on the bus.

Kevin-OConnor commented 8 years ago

CANTalon moved to CTRE managed external library.