SolversLib Docs
QuickstartGitHubContact
0.2.3
0.2.3
  • Welcome
  • Installation
  • Javadocs
  • Features
    • Hardware
      • Motors
      • SolversHardware
    • Gamepad
    • Drivebases
    • Geometry
    • Controllers
    • Utility Functions
  • Pedro Pathing
    • Pedro Commands
      • FollowPathCommand
      • FollowPathChainCommand
      • HoldPointCommand
  • Vision
    • EasyOpenCV
  • Kinematics
    • Odometry
    • WPILib Kinematics
      • Differential Drive Kinematics
      • Differential Drive Odometry
      • Swerve Drive Kinematics
      • Swerve Drive Odometry
      • Mecanum Drive Kinematics
      • Mecanum Drive Odometry
  • Pathing
    • Pure Pursuit
    • Trajectory
      • Trajectory Generation
      • Trajectory Constraints
      • Manipulating Trajectories
      • Transforming Trajectories
      • Ramsete Controller
  • Command Base
    • Command System
      • Subsystems
      • Command
      • Command Groups
      • Command Scheduler
      • Binding Commands to Triggers
      • Robot and CommandOpMode
      • Convenience Features
    • Old Commands
  • Support SolversLib
  • Additional Reading
Powered by GitBook
On this page
  • 1. Installing from FTCLib
  • build.gradle
  • 2. Installing from SolversLib Quickstart
  • 3. Installing from Scratch
  • build.common.gradle
  • build.gradle (TeamCode)
  • Snapshot Versions
  • Repositories
  • Changing Imports
  • Sync Gradle and Finished!
Export as PDF

Installation

How to import SolversLib into your Android Studio FTC Project

PreviousWelcomeNextJavadocs

1. Installing from FTCLib

build.gradle

The first thing you need to change from FTCLib is the dependency in build.gradle

build.gradle (Module: TeamCode)
dependencies {
    // implementation "org.ftclib.ftclib:core:2.1.1" remove FTCLib core
    // FTCLib's vision is no longer supported in SolversLib
    implementation "org.solverslib:core:0.2.5" // add SolversLib core

Or, if you are using pedroPathing, change to this dependency block

build.gradle (Module: TeamCode)
dependencies {
    // implementation "org.ftclib.ftclib:core:2.1.1" remove FTCLib core
    // FTCLib's vision is no longer supported in SolversLib
    implementation "org.solverslib:core:0.2.5" // core
    implementation "org.solverslib:pedroPathing:0.2.5" // pedroPathing
}

The latest version numbers (as well as a list of all version numbers) are available at:

  • Latest core version:

  • Latest pedroPathing version:

Please note that you should not and cannot have both FTCLib and SolversLib installed at the same time.

Repositories:

Changing Imports:

2. Installing from SolversLib Quickstart

In addition, the Quickstart also has the Pedro Pathing library installed and added along with the SolversLib pedroPathing dependency, meaning that it is hassle-free. If you don't want the Pedro Pathing part, you can simply delete the relevant files.

3. Installing from Scratch

build.common.gradle

First, you need to add the mavenCentral library repository to your build.gradle file at the project root:

build.gradle
    repositories {
        mavenCentral()
    }

Next, minSdkVersion to 24 and multiDexEnabled to true:

build.common.gradle
defaultConfig {
    applicationId 'com.qualcomm.ftcrobotcontroller'
    minSdkVersion 24
    targetSdkVersion 28
    multiDexEnabled true

Next, change JavaVersion to 8 :

build.common.gradle
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

build.gradle (TeamCode)

Add this dependency block for the base library:

build.gradle (Module: TeamCode)
dependencies {
    implementation "org.solverslib:core:0.2.5" // core
build.gradle (Module: TeamCode)
dependencies {
    implementation "org.solverslib:core:0.2.5" // core
    implementation "org.solverslib:pedroPathing:0.2.5" // pedroPathing
}

The latest version numbers (as well as a list of all version numbers) are available at:

Snapshot Versions

SolversLib is graciously hosted on the Dairy Foundation (thanks to Oscar!), and has release versions and snapshots versions.

  • Release versions:

    • Are official, verified versions of SolversLibs

    • Less likelier to have problems/bugs

    • Are in the form: implementation "org.solverslib:core:x.y.z" (where x, y, and z are version numbers).

  • Snapshots versions:

    • Are unofficial, and effectively beta versions with newere features and additions

    • More likelier to have problems/bugs

    • Are in the form: implementation "org.solverslib:pedroPathing:SNAPSHOT-abc1234" (7 random letters & numbers).

For most people, it is HIGHLY recommended to use the releases versions. Should you still want to use the snapshots versions instead of releases, you can use the dependencies instead:

Repositories:

Look at the section below. Make sure to follow the snapshot versions part.

Repositories

In your repositories block, add the following code. You may have other content here, especially if you have the Pedro Pathing library installed. If you do not have a repositories block, you can add it above your dependencies block.

build.gradle (Module: TeamCode)
repositories {
    maven {
        url "https://repo.dairy.foundation/releases"
    }
}

Only for Snapshot Versions

You also need to add the maven for snapshots in your repositories block in addition to the releases one. Again, if you do not have a repositories block, you can add it above your dependencies block.

build.gradle (Module: TeamCode)
repositories {
    maven {
        url "https://repo.dairy.foundation/releases"
    }
    maven {
        url "https://repo.dairy.foundation/snapshots"
    }
}

Changing Imports

Because the package names will be different, you can either manually replace all instances of com.arcrobotics.ftclib with com.seattlesolvers.solverslib , or use a command in a terminal to replace them all at once for you. Please make sure you either open a terminal into your Android Studio project or use the built-in Android Studio terminal to run the commands below.

FTCLib Imports to SolversLib Imports (MacOS/Linux):

find . -type f -name "*.java" -exec sed -i '' 's/com.arcrobotics.ftclib/com.seattlesolvers.solverslib/g' {} +

SolversLib Imports to FTCLib Imports (MacOS/Linux):

find . -type f -name "*.java" -exec sed -i '' 's/com.seattlesolvers.solverslib/com.arcrobotics.ftclib/g' {} +

FTCLib Imports to SolversLib Imports (Windows):

Get-ChildItem -Recurse -Filter *.java | ForEach-Object { (Get-Content $.FullName) -replace 'com.arcrobotics.ftclib', 'com.seattlesolvers.solverslib' | Set-Content $.FullName }

SolversLib Imports to FTCLib Imports (Windows):

Get-ChildItem -Recurse -Filter *.java | ForEach-Object { (Get-Content $.FullName) -replace 'com.seattlesolvers.solverslib', 'com.arcrobotics.ftclib' | Set-Content $.FullName }

Sync Gradle and Finished!

Warning: If you choose to use the Pedro Pathing module, you still need to in order to use it.

Then, follow the steps in the section. Then follow the final step below (changing imports).

Lastly, follow the steps in the section and then Gradle Sync!

An alternative option is to simply use the SolversLib Quickstart. Similar to the FTCLib Quickstart, SolversLib has a Quickstart with this library fully set up. You can view it at . You can either fork or clone this repository as needed to use it.

Latest core version:

Latest pedroPathing version:

Warning: If you choose to use the Pedro Pathing module, you still need to in order to use it.

Latest core snapshot version:

Latest pedroPathing snapshot version:

https://repo.dairy.foundation/#/releases/org/solverslib/core
https://repo.dairy.foundation/#/releases/org/solverslib/pedroPathing
install Pedro Pathing
https://github.com/FTC-23511/SolversLib-Quickstart
https://repo.dairy.foundation/#/releases/org/solverslib/core
https://repo.dairy.foundation/#/releases/org/solverslib/pedroPathing
install Pedro Pathing
https://repo.dairy.foundation/#/snapshots/org/solverslib/core
https://repo.dairy.foundation/#/snapshots/org/solverslib/pedroPathing
Repositories
Changing Imports
Click that button and if successful, you can now use SolversLib