Codebase for FTC season 2024-25
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.
git clone https://github.com/Big-Green-7245/teamcode2024
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 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. This requires git knowledge! Please ask for help if you are unsure.
- Create a new remote repository and team in the GitHub Organization
- Add the remote repository to the team and give everyone maintainer access
- Update the FTC Robot Controller using
git remote add FtcRobotController https://github.com/FIRST-Tech-Challenge/FtcRobotController git fetch FtcRobotController git merge --squash --allow-unrelated-histories -X theirs FtcRobotController/master
- Process the changed files and make sure not to overwrite our code (don't delete README.md for example)
- Update the season and repository names in this
README.md
- Edit the local repository links in this
README.md
to the new remote repository - Commit and push the local repository to the new remote Repository