The following procedure can be used to easily create a simple “Getting Started” Robot Application using the WPI Library. Much more information on WPI Library Robot Application programming can be found at the WPILib Overview.
Running the Project Creator
A simplified Robot Application Project Creator tool is available via the “Create a new project” option provided by the WPI Library VSCode Extension.
The WPILib New Project Creator Dialog allows the selection of the key elements of the Robot Application Project. To get started, select:
- “Example” for the project type
- C++ or Java depending upon your chosen development language
- “Getting Started” as the example project base
You’ll need to specify an existing file system folder on your development machine, in which the project will be created, as well as a project name and a team number (a 4-digit number).
You can also optionally indicate that a new folder should be created [recommended], and also whether you’d like “Desktop Support” – which is not required unless you are using simulation and unit testing support [not recommend for the Getting Started project].
Once you’ve specified all necessary items, press the “Generate Project” button, which will generate a new project; open the project by selecting of the “Yes” options in the project creation success dialog.
Opening the Project
At this point, the project will be opened in VSCode. In the left-hand “tree” control you’ll see the project name (“Getting Started”), and the source code files which were generated.
For Java, the key Robot source code file is Robot.java. For C++, the key Robot source code file is Robot.cpp.
Another key project file is the build.gradle file, which contains the “recipe” for how to build the robot application so it is ready to execute on VMX-pi.
Next Steps
At this point, your Robot Application is configured to run on the RoboRIO Platform. To run the robot application on VMX-pi, you’ll next need to Configure your Robot Application for VMX-pi.