Skip to content

Pinpoint tuner always reports FORWARD: read direction before Stop - #115

Merged
BaronClaps merged 1 commit into
Pedro-Pathing:masterfrom
forlack:fix-pinpoint-direction-after-stop
Oct 8, 2026
Merged

BaronClaps merged 1 commit into
Pedro-Pathing:masterfrom
forlack:fix-pinpoint-direction-after-stop

Conversation

@forlack

@forlack forlack commented Oct 4, 2026

Copy link
Copy Markdown

Problem

The Pinpoint tuner reports every odometry pod as FORWARD, regardless of which way the robot is pushed. Robots whose pods actually need REVERSED get a wrong config, and with it an inverted axis.

Both direction steps (PinpointForwardDirection, PinpointStrafeDirection) read their result after the OpMode is stopped:

while (!isStopRequested()) {
    localizer.update();
}
return localizer.pose().y() < 0;

By the time that line runs, the Pinpoint has reset its pose to zero, so y < 0 is false and the step returns "not reversed".

Evidence

I added logging to the strafe step on a goBILDA 4-bar Pinpoint (strafe pod physically reversed) and pushed the robot 15" left:

strafe live y=-1.63   heading=356.5  rawStrafe=-822
strafe live y=-14.88  heading=3.1    rawStrafe=-7602
strafe live y=-14.96  heading=3.4    rawStrafe=-7641    <- holding, still correct
strafe FINAL y=0.0    rawStrafe=150077  returns reversed=false   <- after Stop

During the push the localizer correctly reads y ≈ −15" with the heading steady, which should produce REVERSED. After Stop it reads y = 0.0 (and a garbage raw count), and the step returns FORWARD.

The forward step has the same flaw (x < 0). It is only hidden on robots whose forward pod happens to be FORWARD.

Fix

Keep the last reading taken before Stop, and return based on that:

double y = 0;
while (!isStopRequested()) {
    localizer.update();
    if (!isStopRequested()) {
        y = localizer.pose().y();
    }
}
return y < 0;

Same change for x in the forward step.

Tested

On the same robot, the unmodified tuner returned yPodDirection FORWARD / yPodOffset -6.58 on every run. That config inverted the strafe axis: the Tests hold test drifted when pushed instead of resisting, and the pod test failed. With this fix, the tuner returns REVERSED / +6.62 on its own. That matches a hand-verified config, and Tests pass.

https://claude.ai/code/session_01XpssWQZ6aU4sZnFsKwFz4x

Both Pinpoint direction steps read their answer after the OpMode is
stopped. By then the Pinpoint has reset its pose to zero, so 'x < 0' and
'y < 0' are always false and every pod is reported FORWARD, no matter which
way the robot was pushed. Robots whose pods need REVERSED get a wrong
config and an inverted axis.

Keep the last reading taken before Stop instead.
@BaronClaps
BaronClaps merged commit 41158ec into Pedro-Pathing:master Oct 8, 2026
1 check passed
@BaronClaps

Copy link
Copy Markdown
Member

Thank you.

@forlack

forlack commented Oct 10, 2026

Copy link
Copy Markdown
Author

No problem thanks for merging

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