For Coders - Development Tools
On This Page
STEP 1: Install the Java Development Kit
STEP 2: Install VS Code and create a sample Java project
STEP 3: Install the WPILib extensions
STEP 4: Install and configure a GitHub connector
NOTE: To run the Driver Station, install the NI Tools and Driver Station
STEP 1: Install VS Code
Install the FRC Version of VS Code
The FRC Installer for VS Code comes with a bundled Java 11 OpenJDK. The correct version of VS Cole is downloaded by the installer and installed and configured automatically. The current installer is 2019.2.1 (Jan 2019)
The FRC Installer is found on GitHub
- Download the installer
- Unzip and run.
- Choose Install for All Users to put the FRC documentation in the Public User profile on Windows
- NOTE: The public directory used on Windows is c:\Users\Public\frc2019
Disable collection of Data (Optional)
If you want to disable the collection of usage data by Microsoft:
- Start Visual Studio Code
- Open File -> Preferences -> Settings
- Search for "telemetry"
- Disable the checkboxes that allow telemetry (usage) data to be sent to Microsoft
STEP 2: Create a sample project
Create a sample project
Create a sample project by:
- clicking the wpilib icon in the banner upper right. This will open a WPILib menu.
- select WPILib: Create a new project
- use the dialog menu to create a new project:
- select: example, template, Command Based Robot, and enter a directory, project name, and team number and click Generate.
- A pop-up will ask whether to open the project in the current window or a new window. Choose Current Window.
- compile the project by right clicking on the build.gradle component in the project explorer, and select Build Robot Code. This will build the new project and install gradle and all other required components. This will take a few minutes the first time a gradle project is built as additional components are downloaded!
- NOTE: Some Toronto District School Board (TDSB) teams may not be able to compile the first project due to Gradle dependencies being blocked by the TDSB network. This issue may be resolved as of the 2019 Release.
- the build can be deployed to a connected robot using build.gradle menu item "Deploy Robot Code".
NOTE: There is also and import tool to Import an eclipse project into VS Code.
NOTE: Additional VS Code settings are included in the GyroDrive project and can be set after the GyroDrive has been downloaded
Configure VS Code to AutoSave before a Robot Deploy
- open VS Code
- in the banner, click on the WPILib icon
- select WPILib: Set Auto Save On Deploy
- a pop-up will be displayed at the bottom of the VS Code Window:
- select Yes for Automatically Save On Deploy?
- select Globally for Save globally or project level?
STEP 2: Install and configure a GitHub connector
What is GitHub and why should I use it?
GitHub is an open, cloud based Git platform used for storing and synchronizing code among a group of developers. It is highly recommended that FRC teams use GitHub. An external backup of your code can save many heartaches, and it is always useful to be able to return to the last working version of the code for testing purposes. Do not keep the only working version of your code on the C: drive of someone's laptop (or on the driverstation - these can get dropped)! To use GitHub, create a GitHub account.
Git Tools are required to push and pull code from GitHub since this functionality is not built into VS Code. There are many possible GitHub integration tools that can be explored in the VS Code Marketplace (Ctrl+Shift+X), or external tools can be used.
TorontoCodingCollective recommends installing GitHub Desktop to allow committing of code within VS Code, and for a better user experience, GitKraken which is a graphical tool for viewing and managing branches, and for managing push/pull actions to GitHub.
Install GitHub Desktop and configure VS Code for Git
Download and install GitHub Desktop and then configure VS Code to use the Git installation. Click the button on the right to download and install GitHub Desktop. To configure VS Code:
- Open VS Code
- Choose File -> Preferences -> Settings
- Choose the User Settings tab
- Search for "Git: Path"
- Click Edit in Settings.json
- Click the edit pencil -> Copy to Settings
- Enter the path to the git.exe. In Windows, search the User Appdata folder to find the install path. example C:\Users\myUserName\AppData\Local\GitHubDesktop\app-1.6.1\resources\app\git\mingw64\bin\git.exe. Remember to escape the "\" by substituing "\\", and surround the whole text in double quotes. In this case, the escaped path would be: "C:\\Users\\myUserName\\AppData\\Local\\GitHubDesktop\\app-1.6.1\\resources\\app\\git\\mingw64\\bin\\git.exe"
- Restart VS Code
- Select the Source Control icon on the left pane. There should now be a source control connector.
(Optional) Install GitKraken
GitKraken is a great tool for viewing the status of all branches on your GitHub repository. Optionally install GitKraken to help you manage pushing and pulling changes from GitHub, and for viewing a nice graph of all branches and code comparisons for all commits.
During the install process, you can sign into GitKraken with your GitHub profile.
In order to allow GitKraken to help you manage your repository, you will need to allow 3rd party apps on your GitHub repository.
- log onto GitHub through the web interface
- navigate to the repository that you would like to authorize (can be a personal or organization repository)
- click settings -> Third-party access -> and Allow