The Drop Bears' robot code for FRC 2024
We use pdm
to manage our dependencies in a virtual environment.
First, install pdm
, either by using your system package manager, using pipx
,
or following the instructions on the pdm
website.
After installing pdm
, use it to create a virtual environment and install our dependencies.
pdm install
pdm run python -m ensurepip
pdm run download
pre-commit is configured to run our formatters and linters. These are enforced for all code committed to this project.
You must install pre-commit outside of this project's virtual environment.
Either use your system package manager, or use pipx
:
pipx install pre-commit
Setup the pre-commit hooks to run on commit:
pre-commit install
Before your first run, copy the *.json.orig
files to the main directory and remove the .orig
extension.
pdm run robotpy sim
Once on robots network
pdm run deploy
pdm run test
We use mypy to check our type hints in CI. You can install and run mypy locally:
pdm install --group typing
pdm run mypy .
We use RobotPy's Magicbot framework
robot.py
: Entry point, has mapping from driver inputs to high level robot actions.
components/
: Abstracts hardware into robot actions.
controllers/
: Automates robot actions, mostly with state machines.
autonomous/
: Controls robot during autonomous period.
ids.py
: Has CAN ids, PH channels and other port numbers.