The Competition Template is an example project that has commands already included to communicate with the Field Control System during competitions, ensures commands are in compliance with field regulations, and aids in setting up projects in order to avoid complications and disqualification ("competition" refers to a VRC event using the official field control hardware).
Open the Competition Template from the Examples Page
Three sections of the template: Pre-autonomous, Autonomous Mode, and Driver Control
Note: In order for your project to work at a competition, you must leave these functions in your project. Add commands where the comments indicate for each section.
Use the pre_autonomous Function for any Setup
The pre_autonomous function is used for any set-up your robot may need such as calibrating a Gyro, setting variables, or other device settings. These commands will run immediately when the project is started, before the autonomous portion of the match begins.
Ensure that all commands are properly indented to that the guiding line is visible between the pre_autonomous and autonomous functions.
Note: If no setup is needed, this function can remain empty.
Autonomous
The autonomous function is used for controlling your robot during the autonomous portion of a VRC match. Commands within this function will run when the match begins the Autonomous period.
Ensure that all commands are properly indented to that the guiding line is visible between the pre_autonomous and autonomous functions.
Note: If no setup is needed, this function can remain empty.
User Control
The user_control function is used for controlling your robot during the driver control portion of a VRC match. Commands within this function will run when the match begins the Driver Control period.
Note: The while True loop is shown above so the robot will respond to input from the V5 Controller for the entirety of the match.
Ensure that all commands are properly indented within the while True loop while coding the user control portion. Two guiding lines should be visible as shown here. One because the while True is within the user_control function. The other to ensure commands are within the while True loop.