Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Codebase for FTC game season 2023-24, CENTERSTAGE

Notifications You must be signed in to change notification settings

Big-Green-7245/teamcode2023

Repository files navigation

Teamcode 2023

Codebase for FTC game season 2023-24, CENTERSTAGE

Setting up the Development Environment

Downloading FtcRobotController and Team Code

Run the following command in the terminal at the location you wish to store the project.
This will download FtcRobotController, the library for FTC, and our team code.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Big-Green-7245/teamcode2023/main/.assets/setupRepo.sh)"

Then, open the project you just downloaded (called FtcRobotController) in Android Studio or Intellij.
These two IDEs (Android Studio & Intellij) are essentially the same, and you should use Android Studio unless you know what you're doing.

Now, you are ready to edit the Team Code will be located in /TeamCode/src/main/java/org/firstinspires/ftc/teamcode!


Introduction to the Code

The main programs which the robot can execute are stored in the base teamcode folder.
Each feature/component on the robot is implemented in its own class in the modules folder.
The state folder offers a library to create a state machine, which is very useful in automating robots.
The util folder contains miscellaneous classes that help us interact with the robot and things like telemetry.

Uploading the code to the robot

To upload code to the robot, connect to the Control Hub via USB or WiFi-Direct.

If connected wirelessly, you need to run this command after connecting.

adb connect 192.168.43.1:5555

Once connected, it should look like this: Connected

Click the run (or rerun) button to upload the code.

Making sure the code updates

Every TeleOp/Autonomous program should have a programVer variable to keep track of version increments. Sometimes Android Studio does not update the code right away.

final String programVer="1.0";

Trouble Shooting / Misc

Sdk Not Found

If you get an error saying that the Android Sdk is not found, try adding local.properties in your project root directory with the following line

sdk.dir=/Users/yourusernamehere/Library/Android/sdk

or pointing to wherever your Android Sdk is located.

Using Java 17+ 😎

To use Java 17, two files need to be edited: build.common.gradle and /FtcRobotController/build.gradle.
Note that everyone running this code would need to do this.

Locate

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

and

compileSdkVersion 29

in both files and replace VERSON_1_8 with VERSION_17 and compileSdkVersion 29 with compileSdkVersion 30. Then reload gradle through a button that should appear towards the top right or through the gradle menu on the right (Gradle -> Reload All Gradle Projects).


Continuous Integration

This repository uses GitHub Actions to automatically build the code with the official FTC Robot Controller on every push and pull request to the main branch.
This allows you to see if your code compiles successfully on every change.

For Maintainers

Greetings, future captains, here are the steps you need to do to get ready for a new season.

  1. Create a new Repo and Team in the GitHub Organization
  2. Add the Repo to the Team and give everyone Maintainer access
  3. Update the season and repo names in this README.md
  4. Edit the repository links in this README.md to the new Repo
  5. Edit the repository links in /.assets/setupRepo.sh to the new Repo

About

Codebase for FTC game season 2023-24, CENTERSTAGE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •