A lightweight motion-planning library for FIRST Tech Challenge teams.
Getting Started • Features • Installation • Usage Examples • FAQ • Contributing • License
Cyan-FTC is a community-driven project independent of any single FTC team.
Its mission is to make advanced autonomous movement approachable for rookie teams while still being powerful enough for veterans.
Using Cyan-FTC at the Greek FTC Championship?
Come say hi—I’d love to hear about your experience and help with any issues.
Category | Highlights |
---|---|
Localization | Plug-and-play odometry (GyroTankOdometry , TankKinematics ) or bring your own by implementing PositionProvider . |
Path Following | Pure Pursuit with configurable look-ahead, distance tolerance, and PID gains. |
Unit-Aware Math | Smart Distance , Vector , and Point classes—convert seamlessly between in, cm, m, ticks, etc. |
Modularity First | Works with tank, 2-wheel, 3-wheel, and (soon™) mecanum drivetrains. |
Rookie Friendly | Clean API, extensive Javadoc, and annotated examples. |
- Java Development Kit (JDK 8+ recommended)
- Android-compatible IDE (Android Studio, IntelliJ, VS Code, etc.)
- Official FTC SDK: github.com/FIRST-Tech-Challenge/FtcRobotController
-
Add JitPack to your root
build.dependencies.gradle
:repositories { // …other repositories… maven { url "https://jitpack.io" } }
-
Add Cyan-FTC to
TeamCode/build.gradle
:dependencies { implementation "com.github.bouyio:Cyan-FTC:1.2.3" }
-
Sync Gradle & build. Done! 🎉
The quickest way to explore Cyan-FTC is via the disabledSamples
package in the quickstart repository.
Below is a high-level tour—see 📚 Javadocs (link once published) for full details.
-
Create a measurement provider
DoubleSupplier leftEnc = leftEncoder::getCurrentPosition; DoubleSupplier rightEnc = rightEncoder::getCurrentPosition; DoubleSupplier heading = imu::getAngle; // degrees (CCW +) double ticksPerMeter = /* 2 π r / ticksPerRev */; var provider = new GyroTankOdometry.MeasurementProvider( leftEnc, rightEnc, heading, ticksPerMeter);
-
Initialize odometry
SmartVector2 startPos = new SmartVector2(0, 0, DistanceUnit.METER); double startHeading = 0; // rad GyroTankOdometry odometry = new GyroTankOdometry(startPos, startHeading, provider);
-
Update (automatic or manual)
odometry.update(); // call in your OpMode loop if manual
No IMU? Use TankKinematics
DoubleSupplier leftEnc = leftEncoder::getCurrentPosition;
DoubleSupplier rightEnc = rightEncoder::getCurrentPosition;
double trackWidth = 0.32; // meters
var provider = new TankKinematics.MeasurementProvider(
leftEnc, rightEnc, ticksPerMeter);
TankKinematics odometry =
new TankKinematics(startPos, startHeading, trackWidth, provider);
PathFollower follower = new PathFollower(odometry); // default PID
Point goal = new Point(1.2, 0.8, DistanceUnit.METER);
follower.followPoint(goal);
double[] motor = follower.getCalculatedPowers();
leftMotor.setPower(motor[0] + motor[1]);
rightMotor.setPower(motor[0] - motor[1]);
PointSequence
for visiting waypoints in order.Path
+purePursuitSetup()
for smooth curves (Pure Pursuit).
- New
copy
andreverse
methods for paths and point sequences. - Fixed
PathFollower
bug leading to endless oscillation. - Renamed
GyroTankOdometry.GyroTankMeasurementProvider
andTankKinematics.TankKinematicsMeasurementProvider
toGyroTankOdometry.MeasurementProvider
andTankKinematics.MeasurementProvider
respectively.
- Added reverse driving capabilities.
- Added system identification info.
Find example opModes in the disabledSamples
package of the quickstart repository.
Question | Answer |
---|---|
“When will mecanum be supported?” | Soon™ |
“Can I use XYZ drivetrain?” | Of course—implement PositionProvider . |
“Is there documentation?” | Javadoc is generated each release. Detailed guides are WIP. |
More Qs? | Open an issue or ping me on Discord. |
Contributions are welcome! Please:
- Fork & create a feature branch.
- Follow the code-style guidelines (KTlint/Checkstyle config coming soon).
- Make sure
./gradlew check
passes. - Open a PR—fill in the template.
This project is MIT-licensed.
See LICENSE for details.
Path-following logic was inspired by Gluten Free’s excellent tutorials—watch them here.
Dedicated to Foivos, my rookie-year teammate who made autonomous fun.