Skip to content
S-PadiyarPublic

About

FTC mecanum robot code featuring Road Runner autonomous paths, three-wheel odometry, launcher controls, heading auto-alignment, AprilTag detection, and MeepMeep simulation.

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

FTC Road Runner Robot Code

Android Studio project for an FTC mecanum-drive robot, built on the official FTC Robot Controller and the Road Runner quickstart. The project adds robot-specific autonomous paths, three-wheel odometry, launcher/intake controls, heading-based auto-alignment, AprilTag detection, and desktop MeepMeep simulations.

This repository is not a from-scratch robot controller. The FTC SDK, Road Runner quickstart drive classes, tuning utilities, and supporting infrastructure are upstream projects. The custom work in this repository is summarized below.

Autonomous path preview

MeepMeep field preview of an autonomous trajectory

MeepMeep preview of a Road Runner autonomous route before deployment to the robot.

Custom work in this repository

  • Close- and far-start autonomous routines for both alliances using Road Runner actions
  • A three-ring launcher sequence integrated into autonomous and TeleOp code
  • Alliance-specific mecanum TeleOp driving with pose hold, adjustable launcher power, and a toggled intake
  • Shared Road Runner pose storage between autonomous and TeleOp OpModes
  • Three-dead-wheel odometry integration and robot-specific Road Runner tuning values
  • Odometry-based heading alignment toward a fixed field target
  • AprilTag ID 24 detection and Driver Station telemetry through an external webcam
  • MeepMeep programs for previewing the red and blue autonomous paths on a desktop

The primary custom source files are:

  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/BlueAutoClose.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/BlueAutoFar.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RedAutoClose.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RedAutoFar.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MainBlue.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MainRed.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PoseStorage.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Test.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Webcam_Test.java
  • Robot-specific changes in MecanumDrive.java and ThreeDeadWheelLocalizer.java
  • MeepMeepTesting/src/main/java/com/example/meepmeeptesting/BlueAutoClose.java
  • MeepMeepTesting/src/main/java/com/example/meepmeeptesting/RedAutoClose.java

See TeamCode/README.md for hardware names, controls, and OpMode details. See MeepMeepTesting/README.md for desktop path simulation.

Project structure

Path Purpose Ownership
TeamCode/ Robot OpModes, drive configuration, and localization Custom code plus adapted Road Runner quickstart files
MeepMeepTesting/ Desktop autonomous-path visualization Custom simulation code using MeepMeep
FtcRobotController/ Android robot-controller application FTC SDK/upstream
doc/, libs/, Gradle files SDK documentation, libraries, and build support Primarily FTC SDK/Road Runner infrastructure

Requirements

  • Android Studio with its bundled JDK (the modules target Java 11 source compatibility)
  • FTC-compatible Robot Controller hardware or Control Hub
  • A matching Driver Station
  • Internet access for the first Gradle dependency sync

Key versions currently declared by the project:

  • FTC SDK 11.0.0
  • Road Runner FTC 0.1.25
  • Road Runner Core/Actions 1.0.1
  • FTC Dashboard 0.5.1
  • MeepMeep 0.1.7
  • Gradle 8.13
  • Android Gradle Plugin 8.13.1

Open and run in Android Studio

This is an Android Studio/Gradle project. Do not open only TeamCode as a standalone Java project.

  1. Clone the repository.
  2. In Android Studio, choose Open and select the repository root (the folder containing settings.gradle).
  3. Allow Gradle to sync and download dependencies.
  4. Connect the Control Hub/Robot Controller device over USB or Wi-Fi.
  5. Select the FtcRobotController run configuration and deploy the app.
  6. Configure the robot hardware using the exact names in TeamCode/README.md.
  7. On the Driver Station, select the desired OpMode and test safely with the robot raised before placing it on the field.

The MeepMeepTesting module is a regular desktop Java module. Run either simulation class's main() method directly from Android Studio; it is not installed on the robot.

Road Runner tuning

FTC Dashboard graph and configuration panel used to tune Road Runner velocity control

FTC Dashboard velocity traces and PID configuration during Road Runner tuning.

Important configuration notes

The Road Runner constants and encoder geometry in this repository are specific to the robot on which they were tuned. Motor direction, hub orientation, encoder ports, wheel geometry, feedforward values, and controller gains may not work on another robot. Retune Road Runner before reusing this code on different hardware.

Webcam_Test uses odometry to calculate the heading to the fixed field coordinate (48, -72). Its AprilTag processor reports whether tag ID 24 is visible, but tag detections do not currently correct the robot pose or drive the aiming calculation.

Credits and license

This project is based on:

See LICENSE for this repository's license terms. Upstream components remain subject to their own licenses and attribution requirements.

About

FTC mecanum robot code featuring Road Runner autonomous paths, three-wheel odometry, launcher controls, heading auto-alignment, AprilTag detection, and MeepMeep simulation.

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages