Setting up 2025 Programming tools - quasics/quasics-frc-sw-2015 GitHub Wiki
THIS IS A WORK IN PROGRESS
Overview
There's a series of things that need to be done in order to be able to get, modify, build, and deploy the code for the team's robot:
- Get an account set up on GitHub (this site).
- Install Visual Studio Code and the FRC development tools that are used to edit/build/deploy code for the robot, along with some libraries from hardware vendors to work with specific devices.
- Install Git tools, which are used to access the team's source code repository.
- Check out an initial copy of the code for the project.
- Open up the project in Visual Studio Code.
- Configuring Visual Studio Code to work with the Git tools.
- Build the code for the robot (e.g., after making changes).
- Deploy the code to the robot.
Some of these you should only need to do once (e.g., getting an account set up); others need to be done once per computer that you're going to use (e.g., installing various programs); still others you'll be doing very often (e.g., building/deploying code).
Note: These instructions are currently being "beta-tested". As a result, it's possible that there could be problems that need to be corrected. If you find anything "funny", please talk to Mr. Healy (or someone else on the software sub-team that you think may be able to help you). And, of course, please feel free to update the docs to fix any bugs that you find!
Getting a GitHub account set up
Instructions are here.
Note: This doesn't actually need to be finished until you're ready to make changes to the code, but it can take time (and people sometimes run into problems), so it's worth starting early. You can continue on with the rest of what's outlined below while you're waiting to get an "invitation to collaborate" with the team on GitHub.
Installing Visual Studio Code and the FRC development tools
To install the FRC development tools, follow the instructions here as appropriate for your platform (Windows, MacOS, or Linux).
In summary, you'll need to:
- Download the WPILib installer release for your operating system (here).
- On Windows or Mac machines, mount the disc image (.img or .dmg file, respectively) by double-clicking on it; on Linux machines, unpack the archive (.tar.gz) by double-clicking on it.
- Run the installer (
WPILibInstaller
). - When asked what install mode you would like, select "Everything".
- On the team laptops, always select to install for all users.
- Otherwise, you can likely get away with the "Install for this user" option.
- When asked about VS Code during the installation, pick the option to "Download for this computer only", and then click "Next".
- After the install finishes:
- On Windows/Mac, you can right-click on the disc in your file browser and eject it, and then delete the disc image you downloaded.
- On Linux, you can delete both the archive you downloaded and the unpacked version of its contents.
Important notes to supplement the directions from FIRST:
- For Windows machines that will be set up as driver's stations, you should install the software for "programming-only" machines and also follow the directions for "Installing the FRC Game Tools".
Suggested additional VSCode extensions
The following extension modules can be really helpful, and you're encouraged to include them when installing the tools for a new year on a machine. (They do need to be re-installed every year, as they "drop into" the version of VSCode that's included with the WPILib installation.)
Installing Git tools to access the team's repository
There's a couple of different options here, depending on the operating system you're using.
- If you're working on Microsoft Windows, the easiest tool set to use is probably TortoiseGit; see directions here.
- If you're working on a Mac or Linux machine, it may be simplest to install the command-line tools for these environments. (They're also available for Windows, and will be installed as a part of the instructions above.) You can largely use them from within the Visual Studio Code via some extensions (covered below).
- The process for running an install on either of the systems is covered in a number of places, including here.
- If you're unfamiliar with the basics of using a terminal window in either OS, please talk to Mr. Healy.
Note: this (mostly) only needs to be done once, as the tools are installed at the machine level, rather than in VSCode. However, you may be prompted to update the tools every so often, as new versions are released. (And if you are prompted, please do so!)
Checking out the code for the robot
-
Using TortoiseGit on Windows
- Right-click on the desktop for TortoiseGit and select
clone
. - Paste the URL
https://github.com/quasics/quasics-frc-sw-2015.git
and click "Next". - The default options should work.
- Using command-line tools on Mac/Linux/Windows
- Open a terminal window ("command shell" on Windows).
- Change directory to wherever you want to check out the code (e.g.,
cd ~/Desktop
on Mac/Linux, orcd %HOME%\Desktop
on Windows). - Use the "git clone" command to create/populate a working copy (and local repo) for the team's code:
git clone https://github.com/quasics/quasics-frc-sw-2015.git
- Right-click on the desktop for TortoiseGit and select
Opening up the project in Visual Studio Code
- Start Visual Studio Code (VSCode).
- If you're on Windows, the installer will typically have put a shortcut to this on your desktop, and you can just double-click that.
- If you're on a Mac, you will hopefully have added a shortcut to the system dock. If not, the app can be found in your home directory, in the "wpilib/2024/vscode" folder.
- Select "Open Folder..." from the "File" menu, browse into the project folder that you checked out and want to work in, and click on the "Select Folder" button.
- VSCode will update the UI to show the folder's contents, and will building its idea of how everything works. Be patient, as this can take a little while.
- Among other things, a panel will open up, showing that it's "Executing task: gradlew generateVsCodeConfig" and other stuff (such as "Starting Daemon").
- Keep being patient.
- A number of warnings and other indications may pop up periodically, such as "Intellisense configurations might have been updated. Refresh them now?" Feel free to say "Yes" when these appear. (You may then be prompted to restart something: feel free to say "Yes" to this, too.)
- Eventually, you should see a "BUILD SUCCESSFUL" message in green letters. This isn't actually telling you that it's built the code to be deployed on the robot, it's just finished building the configuration files that VSCode uses to do that. But it's a good sign.
- If you see an error message that you don't understand, come find Mr. Healy or a more experienced coder, and they'll help you out.
Setting up Visual Studio Code to work with Git (global settings)
Visual Studio Code will have been installed with some standard "extensions", which include support for using Git from within the editor. However, there are a couple of things that you'll need to do in order to configure the Git tools. (These could be included in the earlier steps, but working with the tools can vary depending on your OS, so it's easiest to do it in the context of Visual Studio Code.)
- Start Visual Studio Code (VSCode) and open the desired project for the robot.
- In VSCode, select "Windows | New Terminal"
- In the terminal window:
- Set your email address by typing
git config --global user.email "[email protected]"
and hitting <Return>. - Set your user name by typing
git config --global user.name "YOUR_FIRST_NAME YOUR_LAST_NAME"
and hitting <Return>. - Set how changes coming in when you "pull" from the repo will be handled by typing
git config pull.rebase false
and hitting <Return>.- There are other possibilities here, and you can find out more about them from the Git docs online, etc. However, when working with a public repo (like ours), this is frequently the best approach to take. If you know what you're doing and want to use a different setting, please talk to Mr. Healy first.
- (Optional, but encouraged) Tell Git to use extra colors when lines of code are simply being moved around in a file by typing
git config --global diff.colorMoved zebra
and hitting <Return>.
- Set your email address by typing
Building code for the robot
- Start Visual Studio Code (VSCode) and open the desired project for the robot.
- Open the "command window" by either hitting <Ctrl+Shift+P>, or by clicking on the WPILib icon (looks like a "W" in a red hexagon) on the top of the window.
- Pick the "WPILib: Build Robot Code" command to compile the robot code.
- Be patient while the code builds.
- When the build finishes, you should see a "BUILD SUCCESSFUL" message in green letters.
Deploying code on the robot
Instructions are here
Additional resources
- Version control in Visual Studio Code
- This focuses on using the Git version control tools
THE FOLLOWING STEPS NEED TO BE UPDATED FOR 2025: Proceed with extreme caution....
- Password-based access to the repository has been shut down; we need to update this doc to include instructions on how to create "Personal Access Tokens" on GitHub, which are then used in place of a password with Git tools. (Passwords will still work on the web site/wiki.)