DeepBlueRobotics / lib199

Code that we reuse in different projects/years.
Other
2 stars 0 forks source link

Unify and simplify SmartDashboard output to make it harder to miss issues and easier to diagnose them #97

Open brettle opened 1 month ago

brettle commented 1 month ago

At the moment, an overheating or faulting Spark will result in errors being logged and SmartDashboard values being written, but it easy for the error messages to scroll away and there are too many SmartDashboard values to watch. To address this I recommend making lib199Subsystem extend SubsystemBase and adding an initSendable() implementation that adds to the SendableBuilder:

  1. A "Sparks OK" property that is set to false if any Spark overheats, faults, or sticky faults. The user can display this one property on ShuffleBoard and immediately know if a problem was detected.
  2. An "Overheating CAN IDs" property containing the CAN IDs of any overheating Sparks.
  3. A "Faulting CAN IDs" property containing the CAN IDs of Sparks with faults.
  4. A "Sticky Faulting CAN IDs" property containing the CAN IDs of Sparks with sticky faults.

Note: the code should not cause the Sparks to be queried directly. Instead, it should use the latest values read by the registered periodic methods.