Team-OKC-Robotics / FRC-2022-CPP

a c++ port of our FRC-2022 code as training in C++
Other
0 stars 2 forks source link

Check to make sure the code doesn't crash if motors are unplugged #20

Open jkleiber opened 1 year ago

jkleiber commented 1 year ago

Summary During the FRC 2020 season we learned that the motors are set to null in Java if the motors are not detected on the CAN bus. For 2020 and 2022, we mitigated this by simply not doing the motor commands if a given motor is null.

With the move to C++ and our separation of hardware I/O from software logic, it should be even easier to avoid causing problems if the motors are unplugged. However, in C++ things don't normally just get set to null. Perhaps the motors are nullptr if they are unplugged, but this probably won't be well known until we try the code on actual hardware.

Work to Do

Verification