Team 2509's 2019 FRC robot code for Resurgence. Resurgence's code is written in Java and is based off of WPILib's Java control system.
The code is divided into several packages, each responsible for a different aspect of the robot function. This README explains setup instructions, the function of each package, and some of the variable naming conventions used. Additional information about each specific class can be found in that class' Java file.
- Clone this repo
- Run
./gradlew
to download gradle and needed FRC libraries - Run
./gradlew tasks
to see available build options - Enjoy!
- Run
./gradlew build
to build the code. Use the--info
flag for more details - Run
./gradlew deploy -PteamNumber=2509
to deploy to the robot in Terminal (Mac) or Powershell (Windows)
Subsystem | Controller | Name | ID | PDP |
---|---|---|---|---|
Drive | TalonSRX | Right Master | 0 | ---- |
Drive | VictorSPX | Right Slave | 1 | ---- |
Drive | TalonSRX | Left Master | 2 | ---- |
Drive | VictorSPX | Left Slave | 3 | ---- |
Drive | Double Solenoid | Shifter | 0,1 | ---- |
Elevator | TalonSRX | Master | 4 | ---- |
Elevator | VictorSPX | Slave | 5 | ---- |
Elevator | Double Solenoid | Shifter | 12,13 | ---- |
Intake | VictorSP | Main | 1 | ---- |
Intake | Double Solenoid | Wrist | 1 | ---- |
Intake | Double Solenoid | Hatch Pistons | 1 | ---- |
Climb | TalonSRX | Main | 4 | ---- |
Climb | Double Solenoid | High System | 6,7 | ---- |
Climb | Double Solenoid | Low System | 8,9 | ---- |
-
Building with Gradle
Instead of working with Ant, we used GradleRIO, which is a powerful Gradle plugin that allows us to build and deploy our code for FRC. It automatically fetches WPILib, CTRE Toolsuite, and other libraries, and is easier to use across different IDEs.
-
frc.robot
Contains the robot's central functions and holds a file with all numerical constants used throughout the code. For example, the
Robot
class controls all routines depending on the robot state.
-
frc.robot.subsystems
Subsystems are consolidated into one central class per subsystem, all of which extend the Subsystem abstract class. Each subsystem uses state machines for control. Each subsystem is also a singleton, meaning that there is only one instance of each. To modify a subsystem, one would get the instance of the subsystem and change its state. The
Subsystem
class will work on setting the desired state. -
frc.robot.commands
Commands define the operation of the robot incorporating the capabilities defined in the subsystems. Commands are subclasses of
Command
orCommandGroup
. Commands run when scheduled or in response to buttons being pressed or virtual buttons from theSmartDashboard
.
- c*** (i.e.
cAutonomous
): Command instance variables - k*** (i.e.
kDriveWheelTrackWidthInches
): Final constants, especially those found in the Constants.java file - m*** (i.e.
mIsHighGear
): Private instance variables - s*** (i.e.
sDrivetrain
): Subsystems variables, especially those found in Robot.java file
- Start by setting
I
andD
to 0. - Increase
P
until the system starts oscillating for a period ofTu
. You want the oscillation to be large enough that you can time it. This maximumP
will be referred to asKu
. - Use the chart below to calculate different
P
,I
, andD
values.
Control Types | P | I | D |
---|---|---|---|
P | .5*Ku |
0 | 0 |
PI | .45*Ku |
.54*Ku /Tu |
0 |
PID | .6*Ku |
1.2*Ku /Tu |
3*Ku *Tu /40 |
- GoldenGollem 👾 <<<<<<< HEAD
- CRahne ⛳ =======
- CRahne :squirrel:
c7630bacc09ad36ca37ed3cb1608ca7cdbf61018
- DScheele1 💄 🏇 🎦
- ceciliaschmitz1 🐉
- FerisJumbo 🎡
- danevenson13 💪
- Tjwiseguy 🐯