Skip to content

Latest commit

 

History

History
98 lines (62 loc) · 1.74 KB

README.md

File metadata and controls

98 lines (62 loc) · 1.74 KB

py2024

The Drop Bears' robot code for FRC 2024

Setup

Install dependencies

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

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

Run

Simulation

Before your first run, copy the *.json.orig files to the main directory and remove the .orig extension.

pdm run robotpy sim

Deploy to Robot

Once on robots network

pdm run deploy

Test

pdm run test

Type checking

We use mypy to check our type hints in CI. You can install and run mypy locally:

pdm install --group typing
pdm run mypy .

Code Structure

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.