At the Finger Lakes Regional in week 3, our alliance ran into some odd issues regarding receiving the field configuration from getGameSpecificMessage. I’m going to outline the problems and ways to mitigate these problems so that you don’t run the wrong auto like we did. Here is the complete story of what happened:
In 340s last qual match – qm82 – we had the field config of RRR. Everything ran as expected and we went into the elimination rounds. In our first quarterfinal match, the match started, and to the observers, we saw the field config was LLL. However, 340 then drove to the right side of the scale and scored the cube, and 1507 didn’t move at all. (It’s worth noting that 1507 uses C++ and we use Java, however, it doesn’t really change anything. It’s the same problem.)
The first thing 1507 noticed is that in autonomousInit, they had not received any game data – more specifically, that GetGameSpecificMessage returned an empty string. Since they did not handle that case, they didn’t move. We were already going through our code to try and find out why we scored on the wrong side, but we hadn’t changed anything, and we’d been running the same auto code for nearly 30 matches at that point. We found that, while 1507 had gotten an empty string from the method, we had actually gotten RRR – the last field config we got, in our previous qual match.
We immediately jumped to the question box, but (after a long delay) were not granted a replay. This isn’t really important, aside from letting you all know that if this issue happens to you, you probably won’t get a replay. The reason for this is that we were told they verified the FMS sent the correct data to the driver stations, but had no way of verifying the driver stations sent the correct data to the robots. Thus it was not a field fault.
Okay, so you might be wondering why 1507 and 340 got totally different data. This is because there are two different legal versions of the Driver Station – 1507 had the first version, and we had the second. In the first version, if the DS has not yet received anything from the FMS, it returns an empty string. In the second, if the DS has not received anything, it returns the last field config that it got (in our case, the field config from qm82 - RRR). As far as I know, this was an intentional change. This is just the info that I’ve received from others – if there is more information necessary here that I am unaware of (or wrong about), please inform/correct me.
So, what can you do, if you’re scared about this happening to you? I hate to say this – but honestly, not much. As far as I know, closing the driver station and re-opening it doesn’t clear the cache. We got LRL in our last match at FLR, and when we opened the driver station at our next meeting, it still returned LRL (after a complete reboot of the machine). We are going to downgrade the driver station because we would rather get an empty string than the wrong field config.
Okay, so if you can an empty string… now what? Technically you could use CV to look for LED colors on the switch/scale but that’s probably not realistic for most teams (and it’s definitely not what I’m investing our time into). Since we took the side for most elimination matches, we’ve elected to treat an empty string as such: If we get a field config, do the auto. If not, start a timer. Continue to ask for a field config while the timer is going, and if we get a field config, start the auto. If after 8-10 seconds, if we still don’t have a field config, run a drive forwards auto.
Aside from this, you can try to reduce your network usage. We had one print statement running in disabledPeriodic which apparently was too much. I trust the people that are smarter than I am that have told me that’s the issue, but we ran the same code for close to 30 matches before it became an issue even once.
This issue did not re-appear after the match it happened. It happened in the very first match after alliance selections. The FLR field traveled to the Pittsburgh Regional this week and it looks like the exact same thing happened there, in the first match after alliance selections, causing the 1 alliance to (attempt to / successfully) score in the wrong side of both the switch and the scale.
I’ve attached our DS logs to the post. There are logs from both the first quarterfinal match (where things went haywire) and our last elimination match (where things behaved correctly) if you would like to compare them. The log from the qf match is rather sizable, so looking through it can be tricky. The logs with the timestamp 13_17_24 are from the first match, and the final match has the timestamp 17_08_30. Unfortunately, in the heat of the moment, we did not think to create a git commit of the exact code we were running. We have a commit from after practice day and after eliminations, but anything between there is mostly guessing what we were running.
If anyone has more info on this interesting situation, please post it. I honestly do not have a solution and it worries me with the championship approaching.
logs.zip (697 KB)
logs.zip (697 KB)