Robot code for 2023 FRC season
Color | Pattern | Strips | Meaning | Trigger |
---|---|---|---|---|
Red/Blue | Solid | All | Robot disabled; indicates alliance received from DS | Robot disabled |
Cat Yellow | Solid | All | Robot disabled; no connection to FMS or driver station since startup | Robot startup |
Red/Blue | Uniform fade in/out | All | Teleop enabled; indicates alliance received from DS | Robot enabled in teleop mode |
Red/Blue | Fade sweeping from front to back | All | Autonomous enabled; indicates alliance received from DS | Robot enabled in autonomous mode |
Cone Yellow/Magenta | Solid | Top 10 LEDs of each strip | Indicates game piece selected on operator control box for intake and placement positions | Operator flips game piece switch |
Cone Yellow/Magenta | Flash | All | Request game piece | Operator controller D-pad up/down |
Green | Flash | All | Game piece intake | Game piece detected in intake while driver is intaking |
White | Flash | All | Game peice is lost | Gampiece is no longer detected prior to placement |
Green | Solid | Front left & right | Vision alignment successful | Vision alignment activated and cone node is detected in correct position |
Cat Yellow | Flash | Front left/right | Vision alignment adjusting; flashes in direction of adjustment | Vision alignment activated and cone node is detected at lateral offset from desired position |
Red | Solid | Front left & right | Vision alignment no target | Vision alignment activated and no cone node is detected |
:fire: | :fire: | All | :fire: :fire: :fire: | Operator control box missile switch |
Pattern | Controller | Meaning |
---|---|---|
Continuous 100% | Both | Swapping controllers activated. Swap occurs after vibration ends |
500 ms pulse (along with green flash LEDs) | Driver | Game piece detected in intake while driver is intaking |
500 ms right only (along with white flash LEDs) | Driver | Game piece lost |
When commissioning a new robot, you should set the instance type to either "Competition" or "Practice" by creating a text file using FTP 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.
Go to http://10.17.56.2:5812 while connected to the robot to update firmware or change addresses.
This project uses pre-commit to check code formatting before accepting commits.
First install the prerequisites:
pip packages:
~/.bashrc
by running vim ~/.bashrc
PATH=$PATH:$LOCALAPPDATA/Programs/Python/Python39/Scripts/
(change Python39
to match your python version)
$LOCALAPPDATA/Programs/Python/Python39/Scripts/
in the above example) depends on your Python installation. If y ou do the pip install
steps first, pip will print the path you need to add.INSERT
at the bottom of the window to indicate you're editing in insert mode:wq
and press Entersource ~/.bashrc
to update your sessionpip install wpiformat
pip install clang-format
pip install pre-commit
Make sure to run pip install <package>
commands in an administrator terminal if installing in windows
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.
To properly start up, the following mechanisms need to be started up in a state such that:
The Oui Oui Placer is pointing upwards towards the sky, against it's n-stop.
The Bash Guards are all the way back, inside the robot to their n-stops.
The Arm assembly needs to be reasonably close to the stow position (not up and out).
Arm Extension Warning: Because of the use of the function ExtensionFromRotation()
, the extension has a condition where it can believe it "wraps" around. To home, the extension treats some absolute value as zero degrees [0-360), if the extension is physically held beyond this zero, the absolute encoder might read 359° rather than 0° (or any other value beyond the home) causing the extension to "wrap around" and initialize the motor with completely incorrect soft limits, and current position.
Ex: You home the arm at absolute encoder 5° (which may map to 0 in extension depending on gearing of encoder rotation to extension), the arm is homed at an absolute encoder value of 3° because it was mechanically held past 5° before start. The extension now believes it's at 357° (which may be an extension of 30 in). A huge error!
Driver: | Button | Function |
---|---|---|
Left JS X | Drive | |
Left JS Y | Drive | |
Right JS X | Turn | |
Right JS Y | Unused | |
DPad Up | Unused | |
DPad Right | Unused | |
DPad Down | Locks Wheels (in a cool x pattern) | |
DPad Left | Unused | |
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 | Cube Intake | |
RB | Cone Intake | |
LT | Enable vision alignment | |
RT | Cone/Cube Score (game piece selected by operator control box switch) | |
Back | Swap (hold with Start) | |
Start | Swap (hold with Back) | |
Left JS Button | Unused | |
Right JS Button | Unused |
Operator: | Button | Function |
---|---|---|
Left JS X | Extend/retract arm | |
Left JS Y | Raise/lower arm | |
Right JS X | Rotate wrist CW/CCW | |
Right JS Y | Stick down articulates oui oui placer outside of robot, Stick up commands the opposite direction | |
A | Home Shoulder (hold with B) | |
B | Home Shoulder (hold with A) | |
X | Home Wrist (hold with Y) | |
Y | Home Wrist (hold with X) | |
DPad Up | Request cone | |
DPad Right | Reinitialize wrist from absolute position (hold alone) | |
DPad Down | Request cube | |
DPad Left | Unused | |
LB | Intake Reverse | |
RB | Intake Forward | |
LT | Retract bash guard | |
RT | Extend bash guard | |
Back | Swap (hold with Start) | |
Start | Swap (hold with Back) | |
Left JS Button | Unused | |
Right JS Button | Unused |
:memo: Note: Wrist should start near 0° orientation (wheels up, bar down).
We're using the following dependencies:
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.