Open mandrews281 opened 6 years ago
@Aryan sounds like a great opportunity for some junit tests!
And some working code :-)
My scan of FieldMessageGetter is that 3 blanks is equivalent to "RRR"since our if statements are all basically : if ( char == "L") { setLeft() } else { setRight() }
Our current code crashes if the field message is empty. This happens when we don't set the message on the drivestation, but it also happens when the robot is disabled (so the dashboard gets updated). The origin of the problem is line 130 in Robot.java String gameMessage = DriverStation.getInstance().getGameSpecificMessage(); I don't know if gameMessage gets returned as null or a zero lengthed string. But FieldMessageGetter.convertGameMessageToFieldMessage(String gameMessage) Assumes the gameMessage is 3 characters long, so both a null or a zero lengthed string will cause it to crash.
I don't know what will happened on the field, but I don't want our code crashing while we are waiting for a match to start. I also don't know what would happened to our code if we pass in a dummy string of say 3 spaces.