Code for the FRC 1757 2022 Competition Bot
Configure the roboRio | Item | Value |
---|---|---|
Team number | 1757 |
|
Firmware | 6.0.0f1 |
|
Image | FRC_roboRIO_2021_v3.0 |
|
Static IP | 10.17.57.2 |
|
Subnet Mask | 255.255.255.0 |
Device | Class | Range | ID |
---|---|---|---|
robo_rio | core | 0 - 9 | master (no ID) |
pdp | core | 0 - 9 | 0 |
pneumatic_hub | core | 0 - 9 | 1 |
front_left_drive | motors | 10 - 29 | 10 |
front_left_steer | motors | 10 - 29 | 11 |
front_right_drive | motors | 10 - 29 | 12 |
front_right_steer | motors | 10 - 29 | 13 |
back_left_drive | motors | 10 - 29 | 14 |
back_left_steer | motors | 10 - 29 | 15 |
back_right_drive | motors | 10 - 29 | 16 |
back_right_steer | motors | 10 - 29 | 17 |
shooting_hood | motors | 10 - 29 | 21 |
shooting_turret | motors | 10 - 29 | 22 |
shooting_shooting | motors | 10 - 29 | 23 |
left_climb_motor | motors | 10 - 29 | 24 |
right_climb_motor | motors | 10 - 29 | 25 |
front_left_encoder | sensors | 40 - 59 | 40 |
front_right_encoder | sensors | 40 - 59 | 41 |
back_left_encoder | sensors | 40 - 59 | 42 |
back_right_encoder | sensors | 40 - 59 | 43 |
Device | ID |
---|---|
left_climber_brake | 0 |
right_climber_brake | 1 |
right_climber_pivot_forward | 2 |
left_climber_pivot_forward | 3 |
intake_deploy | 4 |
left_climber_pivot_backward | 12 |
right_climber_pivot_backward | 13 |
Device | IP Address | Subnet Mask |
---|---|---|
OpenMesh radio | 10.17.57.1 |
???.???.???.??? |
roboRIO | 10.17.57.2 |
255.255.255.000 |
Driver Station (laptop) | 10.17.57.5 |
255.000.000.000 |
Recommend placing the virtualenv in the mentorbot
repo folder under .venv
(to keep everything together) however the virtualenv is local to your system and should not be uploaded (ignored in .gitignore
)
cd <path-to-mentorbot-repo>
py -3 -m venv ./.venv
source <path-to-mentorbot-repo>/.venv/Scripts/activate
source <path-to-mentorbot-repo>/.venv/bin/activate
python -m pip install --upgrade pip wheel
python -m pip install -r requirements.txt
(examples: robotpy
, robotpy[ctre,navx]
, robotpy[all]
) (see: robotpy on pypi)
python -m robotpy_installer download-python
python -m robotpy_installer download robotpy
(examples: robotpy
, robotpy[ctre,navx]
, robotpy[all]
) (see: robotpy on pypi)
python -m robotpy_installer install-python
python -m robotpy_installer install robotpy
(examples: robotpy
, robotpy[ctre,navx]
, robotpy[all]
) (see: robotpy on pypi)
Deploy robotpy program
python robot.py deploy
python robot.py sim
pylint
black
python -m pip install -U black
pylint $(git ls-files "*.py")
# pylint: disable-next=no-self-use
black .
-You also may need to format json files using Prettier. When opening a json file in VSCode, it should prompt you to download Prettier in a small window in the bottom right. If not, go to the extensions tab on the left and search "Prettier". The top result is it (about 19 million downloads)