FRC2706 / 2020-2706-Robot-Code

The Robot Code for the 2020 FIRST Robotics Competition INFINITE RECHARGE
Other
4 stars 2 forks source link

Graceful failure if Robot Configuration is not found #77

Closed kevlam2706 closed 4 years ago

kevlam2706 commented 4 years ago

As we discovered on Saturday, it is possible that the robot specific constants can fail, if the robot ID cannot be found.

The original default action was to assume a robot ID (0). However, this causes problems with some robots. Motors drive into each other, etc. This is not good.

Add some bulletproofing to the Constants system and to the whole robot initialization. If the robot ID cannot be found - do not do anything. We don't know if the robot has Talons or Victors, we don't know if they're going to drive against each other, we don't know if there's an intake or an arm or not... anything we default to could potentially cause a hardware failure or a software exception. So.... we should do nothing.

If the robot ID cannot be found (which should never happen after we've set it up), log it as a severe error, and don't allow Robot.java or any of its subsystems to initialize anything. The drivetrain should not be set up, driving commands and buttons should do nothing except possibly stream error messages to the log files.