Codebase for FTC game season 2023-24, CENTERSTAGE
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
!
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.
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:
Click the run (or rerun) button to upload the code.
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";
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.
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).
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.
Greetings, future captains, here are the steps you need to do to get ready for a new season.
- Create a new Repo and Team in the GitHub Organization
- Add the Repo to the Team and give everyone Maintainer access
- Update the season and repo names in this
README.md
- Edit the repository links in this
README.md
to the new Repo - Edit the repository links in
/.assets/setupRepo.sh
to the new Repo