Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy 2023 files #1

Merged
merged 48 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7157603
copied robot.py
fotnitfpro000 Jan 4, 2024
5f9e991
added a readme
fotnitfpro000 Jan 4, 2024
8c0a37a
copied 2023 requirements
fotnitfpro000 Jan 4, 2024
e83d3cd
copied other files
fotnitfpro000 Jan 4, 2024
76d5033
added ids
fotnitfpro000 Jan 4, 2024
356af0d
added necessary physics
fotnitfpro000 Jan 4, 2024
c11fb2b
copied 2023 chassis
fotnitfpro000 Jan 4, 2024
7acd657
added utilities
fotnitfpro000 Jan 4, 2024
5e54a88
updated some of the vendor libraries to beta 2024
fotnitfpro000 Jan 4, 2024
5f0d9f3
delete 2023 game specific imports
outsidermm Jan 4, 2024
f86d4bb
modified to the correct navx version number
outsidermm Jan 4, 2024
0f80c62
added necessary imports and deleted unused imports for physics.py
outsidermm Jan 4, 2024
0548d1f
deleted unused imports in physics.py
outsidermm Jan 4, 2024
8833eba
removed physics.py for decapitalisation
outsidermm Jan 4, 2024
94f9fa8
added physics.py lowercased file back
outsidermm Jan 4, 2024
e47b638
added missing function, object creation and imports (amber deleted to…
outsidermm Jan 4, 2024
3416631
reverted back to the full 2023 chasis using 2023 lib
outsidermm Jan 4, 2024
2ef5713
reverted back to the 2023 requirement to test sim before updating to …
outsidermm Jan 4, 2024
5c0961b
deleted recovery usage as it's 2023 specific
outsidermm Jan 4, 2024
10c9985
copied movement.py from 2023 as necessary for basic teleop function
outsidermm Jan 4, 2024
e897ddc
disabled vision pose estimator usage in robot.py (since only drivebas…
outsidermm Jan 4, 2024
671729d
deleted 2023-specific (balancing) methods
outsidermm Jan 4, 2024
88c785b
commented out later necessary methods and imports
outsidermm Jan 4, 2024
e6203de
more delete
outsidermm Jan 4, 2024
6f451f4
added movement object so now the sim actually opens without crashes
outsidermm Jan 4, 2024
5b41c9e
deleted commented vision code
outsidermm Jan 5, 2024
72f5178
Delete commented out code for clean repo
outsidermm Jan 5, 2024
49c201a
deleted commented out vision estimator
outsidermm Jan 5, 2024
7642e71
delete robot cam vision data
outsidermm Jan 5, 2024
d9940d4
added pre-commit
outsidermm Jan 5, 2024
dbd4631
Revert "added pre-commit"
outsidermm Jan 5, 2024
4f38ded
deleted unused imports
outsidermm Jan 5, 2024
55bc69f
dead code
outsidermm Jan 5, 2024
0ffc3d2
more deadcode
outsidermm Jan 5, 2024
9e2309a
Yeet the unused trigger events and joystick
auscompgeek Jan 5, 2024
aea86e5
Really remove the event loop
auscompgeek Jan 5, 2024
7c0ae61
runs movement before chassis
outsidermm Jan 5, 2024
524cdff
delete dead code
outsidermm Jan 5, 2024
9216b41
added pre-commit
outsidermm Jan 5, 2024
2508ea6
added ci and reviewdog
outsidermm Jan 5, 2024
ee05f8d
added tests
outsidermm Jan 5, 2024
362ba52
delete unused imports
outsidermm Jan 5, 2024
be314c5
removed reviewdog
outsidermm Jan 5, 2024
d51146b
removed manual drive state
fotnitfpro000 Jan 5, 2024
c07c7f7
Merge branch 'copy_2023_files' of https://github.com/thedropbears/pyc…
fotnitfpro000 Jan 5, 2024
1432916
moved basic teleop to robot.py and removed movement.py (traj gen and …
outsidermm Jan 5, 2024
770586d
delete 2023 field specific variable
outsidermm Jan 5, 2024
1a7c4fd
added __init__.py in folders
outsidermm Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .deploy_cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[auth]
hostname = 4774
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
branches:
- main
pull_request:
merge_group:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install coverage pytest-forked pytest-github-actions-annotate-failures
- run: python robot.py test -- -v --forked
- run: python robot.py coverage test -- -v
- uses: codecov/codecov-action@v3

mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy -r requirements-dev.txt
- name: mypy
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: mypy
run: mypy --show-column-numbers .
2 changes: 2 additions & 0 deletions .installer_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[auth]
hostname = 4774
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_prs: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# Side effects
- id: fix-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
# Non-modifying checks
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.267
hooks:
- id: ruff
args:
- "--fix"

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
25 changes: 25 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
numpy = "~=1.24.1"
robotpy = {version = "~=2023.4.2", extras = ["apriltag", "cscore"]}
robotpy-ctre = "~=2023.1.0"
robotpy-navx = "~=2023.0.3"
robotpy-rev = "~=2023.1.3.2"
robotpy-photonvision = "~=2023.3.0"
robotpy-wpilib-utilities = "~=2023.1.0"

[dev-packages]
hypothesis = "*"
pytest = ">=7.2.0"

[requires]
python_version = "3.11"

[scripts]
deploy = "python robot.py deploy"
sim = "python robot.py sim"
test = "python robot.py test"
706 changes: 706 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

58 changes: 57 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
# py2024
# py2024

The Drop Bears' robot code for FRC 2024

## Setup

### Install Dependencies

```
pip install -r requirements-dev.txt
```

### Setup pre-commit

Pre-commit is setup to automatically run formatters and linters when you commit.

```
pre-commit install
```


## Run

### Simulation

```
python robot.py sim
```

### Deploy to Robot

Once on robots network

```
python robot.py deploy
```

### Test

```
python robot.py test
```


## 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.
Empty file added autonomous/__init__.py
Empty file.
Empty file added components/__init__.py
Empty file.
Loading