Match info from WPILib question

We are in the process of making a recording software which takes the footage from the camera on the robot and saves it as a file on our laptop to debrief our matches after they end. We want the file name to automatically match the match type and number, so for example, if it is qualification match number 45, the file name will be “Q45”.
We know how to do this through the getMatchType and getMatchNumber methods from the DriverStation class.
However, DriverStation.MatchType includes only four match types: “Elimination”, “None”, “Practice” and “Qualification”.
How can we distinguish between different finals, that is to distinguish quarter-finals to semi-finals to finals?
Thank you!

You might be able to guess from the match number, maybe? I have no idea how the data the FMS reports changes with tie-breakers though.

Yes, I thought about that, but the tie-breakers really are the problem.

Each playoff match gets a unique match number, including tie-breakers.
Match numbers that aren’t needed as tie-breakers will just not get used.

For example Quarterfinals will be matches 1,2,3,4 (round 1), then 5,6,7,8 (round 2).
Any tie-breakers will be matches 9,10,11,12.
Any replays of tie-breakers will repeat the tie-breaker match number, as will any replays of other matches.

Semi-finals will be numbered: 13,14 (round 1), then 15,16 (round 2).
Semi tie-breakers will be 17,18

Finals matches are: 19 (round 1), 20 (round 2)
Final tie-breaker would be 21

So a typical elimination set of matches might look like:
Match — Description
1 ---- Quarterfinal 1
2 ---- Quarterfinal 2
3 ---- Quarterfinal 3
4 ---- Quarterfinal 4
5 ---- Quarterfinal 5
6 ---- Quarterfinal 6
7 ---- Quarterfinal 7
8 ---- Quarterfinal 8
12 ---- Tiebreaker 4
13 ---- Semifinal 1
14 ---- Semifinal 2
15 ---- Semifinal 3
16 ---- Semifinal 4
19 ---- Final 1
20 ---- Final 2
21 ---- Tiebreaker

If your robot has been in playoffs in the past, you can check the match numbers used in the DS Logs (the example shows the robot played in Quarterfinal 2 and Quarterfinal 6).
DS logs always hang around forever on your Driver Station laptop.


Wow! Thank you very much for this comprehensive explanation!

Also be aware that it can take some time after you boot before this information is reliable. Put something like this in your disabledPeriod:


    if (!haveMatchData && DriverStation.getInstance().isFMSAttached()) {
      if (DriverStation.getInstance().getMatchType() != None) {
        haveMatchData = true;
        // do something here...
      }
    }
  }
1 Like