frc1418 / 2020-offseason

Experimental code for the 2021 season
MIT License
0 stars 4 forks source link

Create UNSET enum #29

Open BobbyMi11er opened 3 years ago

BobbyMi11er commented 3 years ago

Fixes #25 I added the enum but I'm pretty sure this is just adding another layer of abstraction for a NPE error.

ArchdukeTim commented 3 years ago

There shouldn't be an NPE anywhere with this, but somewhere you should be checking to see if the color is UNSET. I think there's somewhere in the code where there's a null check? Maybe one should go before here: https://github.com/frc1418/2020-offseason/blob/c8b5bebdb08a78c3775d67b8d07548d8b00e13ad/src/main/java/frc/robot/commands/ControlPanelColorCommand.java#L38 and maybe also a check in the isFinished method?

ArchdukeTim commented 3 years ago

All of this color sensing code seems very complex. I wonder if there's a way to simplify it.