Robots operate independently following pre-programmed instructions for the first fifteen seconds of the match.
Alliances score points by:
• Reaching their own autonomous line
• Gaining ownership of the scale or their switch
More information, including competition rules and game information, can be found on FIRST FRC website.
https://www.firstinspires.org/resource-library/frc/competition-manual-qa-system
Prior to the start of AUTO, the assignments of ALLIANCE colors for SWITCH and SCALE PLATES are randomized among the four states in Figure 4-1 and transmitted to the OPERATOR CONSOLE by the Field Management System (FMS).
Read the following about how FMS works.
https://wpilib.screenstepslive.com/s/currentCS/m/getting_started/l/826278-2018-game-data-details
When the match begins, the FMS will send a string to DriverStation. We will need to use the string and determine which direction that the robot will go.
One example you would get would be "LRL" or "RRR".
String gameData;
gameData = DriverStation.getInstance().getGameSpecificMessage();
if(gameData.charAt(0) == 'L')
{
//Put left auto code here
} else {
//Put right auto code here
}
Edited by Dexin on 12/9/2018