Skip to content

Add interactive pose recorder for capturing field coordinates - #171

Open
aryanmathur1 wants to merge 1 commit into
Pedro-Pathing:mainfrom
aryanmathur1:main
Open

Add interactive pose recorder for capturing field coordinates#171
aryanmathur1 wants to merge 1 commit into
Pedro-Pathing:mainfrom
aryanmathur1:main

Conversation

@aryanmathur1

@aryanmathur1 aryanmathur1 commented Jul 14, 2026

Copy link
Copy Markdown

By Metal Magic FTC 23362

We added a TeleOp workflow for authoring field coordinates by moving the robot instead of measuring the field by hand. Set a starting pose in code, then drag or drive the robot around the field and press a button to capture the robots current pose. Captures accumulate in a numbered, copy pasteable list on the Driver Station and stream to the coding computer via adb logcat, so they drop straight into path code.

Two new classes in com.pedropathing.ftc.util:

  • PoseRecorder: reusable helper taking (follower, gamepad, telemetry). Call update() each loop to detect button rising-edges, capture follower.getPose(), render the live pose + recorded list, and log each capture. Default buttons A/B/Back+Y for capture/undo/clear, all reconfigurable; exposes capture()/undo()/clear()/getRecordedPoses().
  • PoseRecorderOpMode: turnkey abstract LinearOpMode. Teams implement createFollower(hardwareMap) and optionally override startingPose() to declare their start position in code. Enables gamepad teleop driving while leaving the robot free to be hand-dragged.

Poses are captured in the follower's native Pedro coordinate frame. Compiles against the existing compileOnly FTC SDK. No build changes.

an example of code (woa i figured out markdown):

@TeleOp(name = "Pose Recorder")
public class MyPoseRecorder extends PoseRecorderOpMode {
    @Override
    protected Follower createFollower(HardwareMap hardwareMap) {
        return Constants.createFollower(hardwareMap); // your normal follower setup
    }

    @Override
    protected Pose startingPose() {
        return new Pose(9, 111, Math.toRadians(90)); // where the robot starts
    }
}

on gamepad then:
A to capture current pose
B to undo last
Back + Y to clear all

Then, on computer, check logcat to get lines u can copy paste like "new Pose(12.000, 34.000, Math.toRadians(90.00))"

By Metal Magic FTC 23362

Adds a TeleOp workflow for authoring field coordinates by moving the
robot instead of measuring the field by hand. Set a starting pose in
code, then drag or drive the robot around the field and press a button
to capture the robot's current pose. Captures accumulate in a numbered,
copy-pasteable list on the Driver Station and stream to the coding
computer via RobotLog (adb logcat), so they drop straight into path code.

Two new classes in com.pedropathing.ftc.util:

- PoseRecorder: reusable helper taking (follower, gamepad, telemetry).
  Call update() each loop to detect button rising-edges, capture
  follower.getPose(), render the live pose + recorded list, and log each
  capture. Default buttons A/B/Back+Y for capture/undo/clear, all
  reconfigurable; exposes capture()/undo()/clear()/getRecordedPoses().

- PoseRecorderOpMode: turnkey abstract LinearOpMode. Teams implement
  createFollower(hardwareMap) and optionally override startingPose() to
  declare their start position in code. Enables gamepad teleop driving
  while leaving the robot free to be hand-dragged.

Poses are captured in the follower's native Pedro coordinate frame.
Compiles against the existing compileOnly FTC SDK; no build changes.
@Tyler-Stocks

Copy link
Copy Markdown
Contributor

Hello! This is a really cool idea but I think it would make more sense to implement this in the quickstart instead of at the library level.

Everything involving the Gamepad and telemetry should be moved from the PoseRecorder to the OpMode and the OpMode should be made concrete (since the user can just edit the start position and or creation method).

Also, if you move the gamepad logic to the OpMode you can use the built in rising edge detection on Gamepad instead of a custom Button interface.

Maybe consider make it an @Utility class (The one in the new SDK update)

@aryanmathur1

Copy link
Copy Markdown
Author

Yeah sure that is a great suggestion! I created the new file and made a pull request to implement it in the quickstart. It is now just in one OpMode rather than a helper class. The @Utility class did not work properly for me (probably because of SDK issues), so I made it an @TeleoOp instead

@Tyler-Stocks

Copy link
Copy Markdown
Contributor

Yeah, I realized after I said the @Utility that the quickstart hasn't been updated to the latest SDK version, so @TELEOP works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants