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
Test the code on actual hardware and see if we get weird errors
Find mitigation for any anomalies we come across during the initial hardware test
Verify that the I/O classes are set up with correct safeguards to avoid spams
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 isnull
.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 arenullptr
if they are unplugged, but this probably won't be well known until we try the code on actual hardware.Work to Do
Verification