Robot code for 2022 FRC Season
- Automated intake system with ball indexing
IntakeSubsystem
- Vibration feedback on cargo acquisition
- Semi-autonomous high-rung climb with configurable positions
ClimberSubsystem
- Modular swerve drive system built on SDS Mk4 hardware and Falcon 500 motors
SwerveDriveSubsystem
- Custom module state optimizer with support for continuous module rotation
argos_lib::swerve::Optimize
- Persistent module homes using non-volatile memory
FileSystemHomingStorage
- Custom module state optimizer with support for continuous module rotation
- 370-degree turret with full-field vision targeting
ShooterSubsystem
- Vibration feedback on target lock
- Automatic hood angle and flywheel speed setpoints based on distance interpolation maps from 10 inches to 30 feet
shooterRange
- Target range estimation using target pitch and perspective distortion adjustment
ShooterSubsystem::AutoAim
- Automatic hood homing
HomeHoodCommand
- Persistent turret home using non-volatile memory
FSHomingStorage
- Modular autonomous selection system
AutoSelector
- Autonomous routines for all starting positions with 1-ball, 2-ball, 5-ball, and 2-ball with defensive shots commands/autonomous
- Support for separate red and blue alliance position setpoints to account for field assembly variance
- Common absolute field position configuration for drive paths to reduce duplication
field_points
When commissioning a new robot, you should set the instance type to either "Competition" or "Practice" by creating a text file readable by lvuser
on the RoboRIO at path /home/lvuser/robotInstance
. The content of this file should be just the text Competition
or Practice
with no whitespace preceding. If no valid instance is found at runtime, competition instance will be used and an error will be generated.
See vision readme for information on which pipelines to use and which indices to install these pipelines on.
This project uses pre-commit to check code formatting before accepting commits.
First install the prerequisites:
-
python3 (with pip) - instructions
- Python 3.9.x from the Python website works well. Make sure to check the add to path option in the installer.
-
pip packages:
- You may need to add the pip install path to your shell's path if you're using Git Bash. In git bash:
- Open (or create) new file
~/.bashrc
by runningvim ~/.bashrc
- Add this to the end:
PATH=$PATH:$LOCALAPPDATA/Programs/Python/Python39/Scripts/
(changePython39
to match your python version)- Note: The actual path you need to add (
$LOCALAPPDATA/Programs/Python/Python39/Scripts/
in the above example) depends on your Python installation. If y ou do thepip install
steps first, pip will print the path you need to add. - To type in Vim, type i and you should see
INSERT
at the bottom of the window to indicate you're editing in insert mode
- Note: The actual path you need to add (
- Exit by pressing Esc then type
:wq
and press Enter - Run
source ~/.bashrc
to update your session
- Open (or create) new file
- wpiformat -
pip install wpiformat
- clang-format -
pip install clang-format
- pre-commit -
pip install pre-commit
Make sure to run
pip install <package>
commands in an administrator terminal if installing in windows - You may need to add the pip install path to your shell's path if you're using Git Bash. In git bash:
Then initialize:
pre-commit install
pre-commit run
The first run may take a moment, but subsequent automatic runs are very fast.
You'll now have the linter run before each commit! For compatibility with Windows, we recommend the pip version of clang-format, but wpi-format will find any installed clang-format
binary in the system path.
Driver:
Button | Function |
---|---|
Left JS X | Drive |
Left JS Y | Drive |
Right JS X | Turn |
Right JS Y | Unused |
DPad Up | Unused |
DPad Right | Move Pre-Climb Forward One Position |
DPad Down | Confirm climb |
DPad Left | Move Pre-Climb Backward One Position |
A | Home Swerve (hold with B and X) |
B | Home Swerve (hold with A and X) |
X | Home Swerve (hold with A and B) |
Y | Field Home (hold) |
LB | Hold For Robot Centric |
RB | Reverse Intake |
LT | Shoot |
RT | Intake |
Back | Swap (hold with Start) |
Start | Swap (hold with Back) |
Left JS Button | Unused |
Right JS Button | Unused |
Operator:
Button | Function |
---|---|
Left JS X | Manual Aim |
Left JS Y | Manual Hood |
Right JS X | Climbing Hooks |
Right JS Y | Climbing Arm |
A | Home Turret (hold with X and B) + Lower Arm |
B | Home Turret (hold with X and A) + Extend Hook |
X | Home Turret (hold with A and B) + Retract Hook |
Y | Home Hood (hold) |
DPad Up | Front Close Up Shot |
DPad Right | Right Close Up Shot |
DPad Down | Back Close Up Shot |
DPad Left | Left Close Up Shot |
LB | Move Pre-Climb Backward One Position |
RB | Move Pre-Climb Forward One Position |
LT | Unused |
RT | Vision Target |
Back | Swap (hold with Start) |
Start | Swap (hold with Back) |
Left JS Button | Unused |
Right JS Button | Unused |
- Check turret position
- Check wheel tread
- Drive and Turn
- Drive forward
- Drive backward
- Drive left
- Drive right
- Turn left
- Turn right
- Drive forward
- Intake
- Intake a ball
- Outtake a ball
- Shooter
- Move turret left and right manually
- Move hood up and down manually
- Check the four setpoints (using the d-pad on the operator controller) for the proper turret positions
- Aim (vision; make sure camera is working)
- Intake and shoot a ball (this also checks the elevator functionality)
- Climber
- Move the climb arms up and down
- Move the hooks up and down
- Go through the climb sequence
- Wait for air
- Change battery
As of the end of the 2022 season, we're using the following dependencies:
- CTRE Phoenix 5.21.1
- Limelight 2022.2.3
- Playing With Fusion 2022.03.03
- REVLib 2022.1.1
- WPILib 2022.4.1
- Our sponsors for the 2022 season. Thank you for your continued support
- Doxygen Awesome - for making our documentation look great
This software is licensed under the BSD 3-clause license. If you would like to use this software under the terms of a different license agreement, please contact us.