Code for FRC 2067's 2023 Robot for the game Charged Up
-
wpilib getting started covers how to wire and program a robot
-
documentation for software libraries and hardware we'll use:
-
2023 Game manual
The motors that move the robot chassis around the field.
-
Actuators:
- 2x TalonFX motor controllers (right)
- 2x TalonFX motor controllers (left)
-
Sensors:
- Pigeon IMU for measuring robot heading and pitch
A set of rollers on a arm that can extend & retract.
Mounted at the front of the chassis, for game piece acquisition from the floor.
-
Actuators:
- 2x SparkMax motor controllers to pull in game pieces
-
Sensors:
- 1x Discrete input for game piece detection
Motors on the left and right of the intake assembly to extend and retract the intake roller assembly
We should set one up as a follower to the other so that the two motors stay synchronized
- Actuators:
- 2x TalonFX motor controllers for moving the intake in & out
Mounted at the front of the chassis, along the ground. Aids in bringing the game pieces into the chassis.
- 1x SparkMax motor controller for running the belts on the conveyor assembly
- Actuators:
- 1x DoubleSolenoid for extending and retracting the assembly
Telescoping assembly. Extend to move game pieces away from chassis.
-
Actuators:
- 1x TalonFX motor controller
-
Sensors:
- 1x hall effect sensor for zero position / full retract
Game piece manipulator mounted on the arm
-
Actuators:
- 1x TalonSRX motor controller
- 1x Solenoid (open/close)
-
Sensors:
- 🤷♀️ 1x Discrete input for game piece detection
mechanism used to raise/lower arm assembly.
Brings game pieces to appropriate elevation for scoring
-
Actuators:
- 1x SparkMax Motor controller to rasie/lower arm
-
Sensors:
- 2x Discrete Inputs for end of travel in either direction
A rotating platorm on which the arm assembly sits.
Pivoting this platorm allows placing game pieces at scoring locations when the chassis isn't perfectly aligned.
-
Actuators:
- 1x SparkMAX motor controller for rotating the assembly
-
Sensors:
- 🤷♀️ 2x end of travel limit switches.
Container for interacting with camera based sensor(s)
- Sensors:
- 1x photonvision camera
-
Download and Install the latest WPIlib 2023 release
- If you're on Windows, download the
.iso
file (e.g.WPILib_Windows-2023.1.1.iso
). - While connected to the internet, open the ISO
- run the
WPILibInstaller.exe
file - follow the on-screen instructions, to install vscode for your user
- run the
- If you're on Windows, download the
-
Other tools you need should install:
-
- You need this to control a robot (includes the driverstation application)
- You can skip license entry / activation for the NI Vision component we won't
- Open th driverstation and enter our team number (2067) from the
Setup
Tab on the left (gear)
-
- Software libraries for CTRE devices
- Includes phoenix tuner for configuring/updating firmware on CTRE devices
-
Rev Hardware Client For upgrading firmware on REV Robitics devices
- After installation, perform an update to download device firmwares so you'll have them avaialable later if you're not online (e.g. at a competition)
-
-
Install git bash
- Download the appropriate installer for your OS
- Install following onscreen instructions
TODO
any additional setup steps - dry run on fresh install
-
Create an account at
github.com
, you should have recieved an invite at the email you used to register for slack.
The following steps will authorize vscode to access your github account through OAuth.
This is in place of setting up ssh keys. If you'd rather do that, feel free to do so.
Similar steps to what we're doing are covered here if the below isn't clear enough.
-
Open the
2023 WPILib VS Code
link (on your desktop?) -
Click the
Source Control
tab on the right ( Ctrl+Shift+G ) -
Click the
Clone Repository
button- This will open the
Command Palette
at the top middle. You will come to know this VS Code feature well... - Click the
Clone from GitHub
option - Follow the on-screen steps to authorize vscode to access your github account
- This will open the
-
Choose the
applepi-2067/2023_Robot
project -
Choose a directory to clone the project into that you will remember (e.g. Documents\FRC) a new subdirectory for the project will be created
-
The first time the project opens it should start downloading dependencies and building the code. You should see the status of the build process listed at the bottom
Terminal
panel in vscode- If the build fails, you may not have completed the installation of the Phoenix Framework Installer (above).
-
Most actions in vscode can be performed through the Command Palette
- Open with ( Ctrl + Shift + P ) or
View
>Command Palette
- Open with ( Ctrl + Shift + P ) or
-
Some example commands you can run from the
Command Palette
Build Robot Code
- Compiles the code in the projectDeploy Robot Code
- Compiles, deploys, and runs the code on the roborio (you need to be connected)Simulate Robot Code
- Compiles, deploys and runs the code in simulation.- You need to have the driverstation or simulated driverstation running to get into Auto or Teleoperated mode.
- Requires simulation models to be implemented for verification of some functionality, but with a little work up front this can be a great way to test your code when you don't have access to robot hardware.
- Complete list of commands here
TODO