Skip to content

Two Wheel + IMU autotuner - #95

Merged
BaronClaps merged 1 commit into
Pedro-Pathing:pedro3from
Mithilessh2010:pedro3
Sep 2, 2026
Merged

Two Wheel + IMU autotuner#95
BaronClaps merged 1 commit into
Pedro-Pathing:pedro3from
Mithilessh2010:pedro3

Conversation

@Mithilessh2010

Copy link
Copy Markdown

Before issuing a pull request, please see the contributing page.

Copilot AI lite review requested due to automatic review settings September 2, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new tuner has correctness issues that can yield invalid calibration (division by zero/Infinity) and likely computes xPodOffset with the wrong sign.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new PedroPathing autotune Procedure to guide teams through configuring and calibrating a TwoWheelLocalizer + IMU setup (encoder scalars, encoder directions, and pod offsets), and outputs a ready-to-paste TwoWheelConfig snippet.

Changes:

  • Introduces TwoWheelTuner procedure with interactive setup inputs (encoder names, IMU name, Hub orientation).
  • Adds tuning OpModes for forward/strafe encoder resolution, direction detection, and 180° spin-based offset identification.
  • Emits result(...) values and a generated Java config snippet for easy transfer into constants/config.
File summaries
File Description
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/procedures/TwoWheelTuner.java New two-wheel + IMU autotuning procedure and supporting tuning opmodes (resolution, direction, offsets).
Review details

Suppressed comments (2)

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/procedures/TwoWheelTuner.java:225

  • If the robot is not pushed (or the localizer fails to update), localizer.pose().y() can be 0, making this return Infinity/NaN and producing an invalid ticks-to-inches scalar.
        return Math.abs(distance / localizer.pose().y());

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/procedures/TwoWheelTuner.java:362

  • The xPodOffset sign here is inconsistent with the established 180°-turn offset calculation used elsewhere in the codebase (e.g., OffsetsTuner reports xPodOffset = (-pose.y)/2). As written, this will likely produce the wrong xPodOffset sign.
            offsets = Arrays.asList(localizer.pose().y() / 2.0, -localizer.pose().x() / 2.0);
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@BaronClaps
BaronClaps merged commit 9ef0620 into Pedro-Pathing:pedro3 Sep 2, 2026
1 check failed
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.

3 participants