Skip to content

Tests ignore the Distance input and always drive 48 in - #120

Merged
BaronClaps merged 1 commit into
Pedro-Pathing:masterfrom
forlack:fix-tests-ignore-distance
Oct 15, 2026
Merged

BaronClaps merged 1 commit into
Pedro-Pathing:masterfrom
forlack:fix-tests-ignore-distance

Conversation

@forlack

@forlack forlack commented Oct 15, 2026

Copy link
Copy Markdown

Problem

In Tests.java, the Line, Curve and Interpolation tests always drive 48 in, whatever Distance is entered on the tuning page.

Each test gets the Distance through its constructor and stores it in this.distance, but runTuningOpMode() then declares a local that shadows it:

double distance = 48;

Fix

Remove the three shadowing locals so the paths use the entered Distance. The 48.0 default on the input is unchanged, so nothing changes for anyone who leaves the field alone.

Testing

On a mecanum robot with a Pinpoint (revhub 3.0.1, tuning 1.0.1): with Distance = 12, the Line test now drives 12 in and returns; before this change it drove 48 in. Curve and Interpolation build their paths from the same field.

Each test receives the Distance from the Tests procedure and stores it in
this.distance, but runTuningOpMode() then declares a local
'double distance = 48;' that shadows the field. Every test drives 48 in no
matter what Distance is entered.

Remove the shadowing locals so the entered Distance is used.
@BaronClaps
BaronClaps merged commit b75637b into Pedro-Pathing:master Oct 15, 2026
1 check passed
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