Skip to content

This repo contains the FRC Team 6940's code for Rapid React(Season 2022)

Notifications You must be signed in to change notification settings

Team6940/2022RapidReact

Repository files navigation

FRC 2022

Team 6940's 2022 FRC robot code. The whole Code is written in Java and is based off 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.

Setup Instructions

  1. Clone this repo
  2. Run ./gradlew to download Gradle and needed FRC/Vendor libraries (make sure you're using Java 11 or greater)
  3. Run ./gradlew downloadAll to download FRC tools (ShuffleBoard, etc.)
  4. Run ./gradlew tasks to see available options
  5. Enjoy!

Visual Studio Code (Official IDE)

  1. Get the WPILib extension from the release page on this repository
  2. In .vscode/settings.json, set the User Setting, java.home, to the correct directory pointing to your JDK 11 directory

IntelliJ

  1. Run ./gradlew idea
  2. Open the 2022RapidReact.ipr file with IntelliJ
  3. When prompted, select import Gradle build

Eclipse

  1. Run ./gradlew eclipse
  2. Open Eclipse and go to File > Open Projects from File System...
  3. Set the import source to the 2022RapidReact folder then click finish

Basic Gradle Commands

  • Run ./gradlew deploy to deploy to the robot in Terminal (*nix) or Powershell (Windows)
  • Run ./gradlew build to build the code. Use the --info flag for more details
  • Run ./gradlew test to run all of the JUnit tests

Code Structure

6940 code structure

Code Highlights

  • Path following with PathPlanner(Credit @mjansen4857)

  • Shooter algorithm. We have two modes for shooting. One depends on the Ball Trajectory equation, the other depends on the interpolation table.

  • State machine control. We use state machine control in our subsystems, which brings tremendous convenience.

  • Pixy camera. We use Pixy2 to help us detect balls automatically both in tele-operated period and in autonomous period.