Stealthy Lib is a library created, mantained, and used by Cedarcrest High School's FIRST Team, which includes:
- FIRST Robotics Competition Team 4089 - Stealth Robotics
- FIRST Tech Challenge Team 7759 - Autonomous Prime
- FIRST Tech Challenge Team 7760 - Mishap
- FIRST Tech Challenge Team 13648 - Jankbot
- FIRST Tech Challenge Team 22152 - Smelt
- FIRST Tech Challenge Team 22153 - Xero
This library includes code that is consistently reused throughout multiple seasons, across multiple teams, and that tends to be useful for FTC and FRC codebases.
This library is structured as a Gradle project, with the following modules:
core
: The core module that contains league agnostic code.ftc
: The FTC-specific module, which contains code that is useful for FTC codebases.frc
: The FRC-specific module, which contains code that is useful for FRC codebases.
Please make sure you are using the correct modules for your codebase.
-
Open your FTC SDK project in Android Studio.
-
Open
build.common.gradle
file of your project. -
Scroll to the bottom where you should find a
repositories
block. Here add the following to therepositories
block:maven { url 'https://jitpack.io' }
-
Open the
build.gradle
file of yourTeamCode
module (This is thebuild.gradle
in theTeamCode
folder. -
Go to the bottom of the file, and add the following to the
dependencies
block.implementation 'com.github.Stealth-Robotics.StealthyLib:core:v1.0.0' // core lib implementation 'com.github.Stealth-Robotics.StealthyLib:ftc:v1.0.0' // ftc lib
Add the line under already existing dependencies if the
dependencies
block already exists. If it doesn't exist, you can create one similar to what is shown below. It should look something like this:dependencies { implementation '...' // example of an already existing dependencies implementation 'com.github.Stealth-Robotics.StealthyLib:core:v1.0.0' // core lib implementation 'com.github.Stealth-Robotics.StealthyLib:ftc:v1.0.0' // ftc lib }
-
In
build.common.gradle
, change the minSdkVersion from 23 to 24:defaultConfig { applicationId 'com.qualcomm.ftcrobotcontroller' minSdkVersion 24 targetSdkVersion 28 }
-
Ensure your Java version is set to 8. This should already be the case with the latest SDK. If not, you will need to change your Java version. Scroll down in
build.common.gradle
until you find thecompileOptions
block.compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 }
Change the 7 to an 8 like so:
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
-
Perform a Gradle sync your project. You should now be able to use the library in your project files (inside
TeamCode
)!
NOTE: If your module has a few dependencies, you might have an error related to multidex on building the project. This is caused by the project exceeding the limit for imports enforced by Android Studio. To solve this, add multiDexEnabled true
to the below location inside the build.common.gradle
file.
defaultConfig {
applicationId 'com.qualcomm.ftcrobotcontroller'
minSdkVersion 24
targetSdkVersion 28
multiDexEnabled true
}
Open your FRC project in VSCode, and follow the instructions below.
-
Install The Following Vendor Libraries (WPILib Plugin → Manage Vendor Libraries → Install New Libraries (Online))
- CTRE Phoenix (Phoenix 5 & Phoenix 6
- REV Robotics
- PathPlanner
-
Open the
build.gradle
file of your project. -
After the
plugins
block, add the following:repositories { maven { url 'https://jitpack.io' } }
-
Add the following to the
dependencies
block in thebuild.gradle
file.implementation 'com.github.Stealth-Robotics.StealthyLib:core:v0.1.0-beta' // core lib implementation 'com.github.Stealth-Robotics.StealthyLib:frc:v0.1.0-beta' // frc lib
Add the line under already existing dependencies if the
dependencies
block already exists. If it doesn't exist, you can create one similar to what is shown below. It should look something like this:dependencies { implementation '...' // example of an already existing dependencies implementation 'com.github.Stealth-Robotics.StealthyLib:core:v0.1.0-beta' // core lib implementation 'com.github.Stealth-Robotics.StealthyLib:frc:v0.1.0-beta' // frc lib }
-
Build your project through the WPILib plugin (WPILib Plugin → Build Robot Code). You should now be able to use the library in your project files!