A very simple first attempt at robot written in python
Before developing code on a new computer, perform the following:
- Download and install wpilib
- Download and install python
- Run these commands:
python -m pip install --upgrade pip
python -m pip install -r requirements_dev.txt
python -m pip install robotpy
robotpy sync
Click here to see documentation for common libraries.
robotpy deploy
will deploy all code to the robot. Be sure to be on the same network as the robot.
.deploy_cfg
contains specific configuration about the deploy process.
Note any folder or file prefixed with a .
will be skipped in the deploy.
"Linting" is the process of checking our code format and style to keep it looking nice
In vsCode, run the lint check via the tasks
.pylintrc
contains configuration about what checks the linter runs, and what formatting it enforces
Run the Test
configuration in the debugger in vsCode.
Run the Simulate
configuration in the debugger in vsCode.
Github runs our code on its servers on every commit to ensure our code stays high quality. This is called "Continuous Integration".
.github/workflows/ci.yml
contains configuration for all the commands that our continuous integration environment.
To minimize frustration and rework, before committing, be sure to:
- Run the test suite
- Run linter and fix any formatting errors.
CI will check python 3.11 and 3.12.
pyproject.toml
lists the python packages needed to run the robot code.
robotpy sync
will ensure the RIO and your development PC have the proper versions of everyhing in pyproject.toml
installed
requirements_dev.txt
lists everything needed just for software development. The things in here are not needed to run the code, and therefor should not get installed on a roborio.
Install the development dependencies with pip install -r requirements_dev.txt
.