Branch | Status |
---|---|
main | |
develop |
- FRC 2025
- RobotPy Example Repository: https://github.com/robotpy/examples
When using the Lab PCs, you're going to want to use your GitHub account so the rest of the team knows who worked on what. If you don't have one, create one here.
If you're using a lab PC, follow these steps to link your GitHub account to VsCode:
- Create a new script in the
switch-gituser
folder and use your real name as the name of the file (Ex: create new fileNathanGrenier.sh
in folderswitch-gituser
). - Replace the
USERNAME
andEMAIL
variables in the newly created file with your GitHub username and password.
Example:
# Set your GitHub username and email
USERNAME="{REPLACE ME WITH GITHUB YOUR USERNAME}" # Make sure to remove the {}
EMAIL="{REPALCE ME WITH YOUR GITHUB EMAIL}" # Make sure to remove the {}
git config user.name "$USERNAME"
git config user.email "$EMAIL"
echo "Git user has been set to: $USERNAME ($EMAIL)"
- In order to change VsCode's GitHub credentials, use the script by running the following command:
Windows (PowerShell):
bash .\switch-gituser\{THE NAME OF YOUR FILE}.sh
In order to use this option you need to install git (and Git Bash). Make sure to add
C:\Program Files\git\bin\
to your Windows PATH.
Windows (GitBash):
./switch-gituser/{THE NAME OF YOUR FILE}.sh
To view all available robotpy commands, use the following command:
# Windows
py -3 -m robotpy
# Linux
python3 -m robotpy
You can pass the
--help
argument to see more information about the subcommand.For example, to see help for the sim command you can do the following:
# Windows py -3 -m robotpy sim --help # Linux python3 -m robotpy sim --help
In order to run the robot code, use the following command:
# Windows
py -3 robot.py
# Linux
python3 robot.py
See full guide on running robot code here
The following command can be used to format the code:
# Windows
py -3 -m ruff format
# Linux
ruff format
When code is pushed to the repository, a workflow will be run to check if the code is properly formatted. If it isn't, you won't be able to merge the code. In order to check if the project is properly formatted, run:
# Windows
py -3 -m ruff format --check
# Linux
ruff format --check
Code linting is like a spell check for your code. It helps find mistakes and keeps your code neat and consistent, making it easier to read and understand.
To run the linting check, use the following command:
# Windows
py -3 -m ruff check .
# Linux
ruff check .
This guide shows you how to setup the FRC driver station in order to run your test programs.
You can deploy robot code to a robot you're connected to using:
# Windows
py -3 robot.py deploy
# Linux
python3 robot.py deploy
Before deploying, make sure you have used the
cd
command to navigate to the/src
directory. This needs to be done because we only want to deploy the code present in the/src
folder to the robot (due to memory limitations).
See full guide on deploying robot code here
WPILib provides a simulator to test your code without being physically connected to a robot.
A robot simulation is available for testing. Read the full documentation here.
You can run it with the following command:
# Windows
py -3 -m robotpy sim
# Linux and macOS
python3 -m robotpy sim
Follow this guide to enable whichever dashboard you plan on using during the simulation.
You can also manually run unit tests using:
# Windows
py -3 -m robot.py test
# Linux
python3 -m robot.py test
To install FRC's game tools for 2025, follow this guide.
Make sure to choose the most recent version. FRC comes out with patches fairly often throughout the season.
Note: If you're on windows and you don't see the mount option after right clicking the iso file, you can open the file using
Open with
thenWindows Explorer
.
Once installed, you'll have access to these tools:
- FRC Driver Station
- FRC roboRIO Imaging Tool and Images
To install the 2025 WPILib programming environment for python, either follow this guide.
If you're unsure of what options to choose during the install, follow these steps:
To get started, install python version 3.12.8 from these links and run the installer:
Installation Steps:
- Select Modify
- Click Next
- Select
Associate files with Python
then click install - After installing you can check if everything worked by:
- Opening a terminal (Press the windows key and search for
cmd
) - Using the following command to check the version of python installed on your system:
py --version
- Opening a terminal (Press the windows key and search for
Follow the instructions here to install VSCode.
If you're new to VSCode, WPILib's docs have a good starting guide explaining the basics.
Note: Since our team uses Python to program the robot, we can't make use of the WPILib VsCode extension (So there's no need to install it).
In order to gain access to the robot code, clone the Sonic Howl frc2025 repo.
If you don't know how to do this, follow these steps:
- Open the repository link in your browser
- Click on the green
<> Code
button, choose HTTPS and copy the link to your clipboard. - Launch the
2025 WPILib VS Code
application. - Open the terminal by pressing the
CTRL + ~
keys. - Try to navigate to the
code
directory using the following commands:- Windows:
cd ~; cd code
- Linux / MacOS:
cd ~ && cd code
- Windows:
- If you get an error saying "Cannot find path 'C:\code' because it does not exist." or similar, use the following command to create a new
code
directory:mkdir code
- Enter the command
git clone <<the link you copied here>>
. (The command should look like this:git clone https://github.com/sonic-howl/frc2025
) - Use the following command to open the newly cloned repository:
cd frc2025
- From the terminal, you can use the
code .
command to open VsCode in the current directory. Just make sure you're in the~/code/frc2025
directory before using it (The~
represents your system's home directory [Example:C:\Users\Nathan
]). - Extra: Ask one of the organization admins to add you to the repo. (Neil, Nathan, Ramez).
If you get an error mentioning that git isn't installed (or that no command named git exists), download and install it here.
Now that you've cloned the project we can proceed to downloading the project's dependencies.
Depending on your operating system, run the appropriate command in your terminal to install the project's dependencies.
For Windows
# Uninstall old version of robotpy
py -m pip uninstall robotpy
# Install robotpy
py -3 -m pip install robotpy
# You can use the --upgrade flag before the robotpy command to upgrade your version
py -3 -m pip install --upgrade robotpy
# Install project's dependancies
py -3 -m robotpy sync
I got a lot of issues with my python packages since they were previously installed globally. If you encounter any issues with the install, try running this command
py -3 -m pip freeze | ForEach-Object { py -3 -m pip uninstall -y $_ }
to uninstall all of your packages. Then, rerun the installation steps above.
For Linux and macOS
# Uninstall old version of robotpy
python3 -m pip uninstall robotpy
# Install robotpy
python3 -m pip install robotpy
# You can use the --upgrade flag before the robotpy command to upgrade your version
python3 -m pip install --upgrade robotpy
# Install project's dependancies
python3 -m robotpy sync
Through the season we're going to be typing py -3 -m
A LOT. In order to simplify things, we can create an alias for this command.
Windows:
- Open your terminal (In VsCode press
~
, or press the windows key and search forcmd
) - Check if you already have a windows profile file by typing
$PROFILE
in your terminal.
- If the file doesn't exist create it with
New-Item -Path $PROFILE -ItemType File -Force
- Open the file by using
code $PROFILE
- Insert and save this block of code in the file:
Set-Alias cl clear Function pym { py -3 -m $args }
- Reload the profile file by using
. $PROFILE
- Now instead of typing
py -3 -m
you can simply use the much shorter commandpym
.
If you get an error saying "running scripts is disabled on this system", use this command to change windows execution policy:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Here's an example of how you'd use the command before and after adding the alias:
- Before:
py -3 -m pip install robotpy
- After:
pym pip install robotpy
We use opencv for the vision processing of apriltags. This dependency isn't installed when running sync and must be installed manually (due to an issue with pyproject.toml).
To install it, use the following command:
# Windows
py -3 -m pip install opencv-python
# Linux
python3 -m pip install opencv-python
This project uses ruff to provide formatting and linting capabilities.
Note: There's currently an error with the
pyproject.toml
file's requirements where it isn't able to locate and installruff
. Instead, we'll install it manually in the upcoming steps.
To install ruff, run:
# Windows
py -3 -m pip install ruff
# Linux
python3 -m pip install ruff
You can also integrate ruff in VsCode by installing the ruff
extension.
To configure the ruff VsCode extension, follow these steps:
- Create a folder called
.vscode
- Create a file in this folder named
settings.json
- Copy these settings in the file:
{
"editor.formatOnSave": true,
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
Note: These formatting settings are scoped to this workspace only.
In order to complete these steps, you will need to install the FRC Game Tools.
The FRC 2025 season will require all RoboRIOs to be flashed with a new image. To update the RoboRIOs, please follow the guide depending on what version of RIO you have.
Similar to the RoboRIO, the radio used to communicate with the bot must also be flashed with the latest firmware. Follow this guide to do so.