Repository navigation
Fix three wheel tuners ignoring custom drive motor names - #121
Merged
BaronClaps merged 1 commit intoOct 15, 2026
Merged
Conversation
The ThreeWheelTuner and ThreeWheelIMUTuner prompted for custom odometry encoder names, but the localizer() helper still looked up drive motors by the hardcoded defaults lf/lr/rf/rr. Robots whose drive motors have custom HardwareMap names crashed the moment tuning started, and the forced setDirection() on the lf/lr ports silently perturbed the encoder polarity measured during tuning. - Add four drive motor name inputs (defaults lf, lr, rf, rr) to the setup screens of both tuners - Use the entered names in the float loop via HardwareMap.tryGet so missing motors are skipped instead of crashing the procedure - Drop the setDirection() call: power 0 + FLOAT is all the measurements need, and mutating motor direction flips the sign of any encoder sharing that port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Three Wheel and Three Wheel + IMU tuners prompt for custom odometry encoder names, but
localizer()in both procedures looks up the drive motors to float by the hardcoded defaultslf,lr,rf,rr:Two consequences:
HardwareMap.getthrows for missing names, killing the procedure on the default names — which looks exactly like "the tuner only uses the default names." The Mecanum tuner does not have this problem because it spins exactly the motors you enter.setDirection()silently perturbs measured encoder polarity.Encoder.getMultiplier()folds in the motor's direction, so forcingREVERSEon thelf/lrports flips the sign of any encoder sharing that port mid-procedure — baking a reversal into the tuned config that does not exist in the robot's real setup.The generated
ThreeWheelConfig/ThreeWheelIMUConfigencoder names themselves are applied correctly (the input plumbing is fine); the bug is this hardcoded float loop.Fix
In both
ThreeWheelTunerandThreeWheelIMUTuner:lf,lr,rf,rr), mirroring the existing encoder-name fields.HardwareMap.tryGet, skipping motors that are not present instead of crashing the procedure.setDirection()call — power 0 +FLOATis all the measurements need.Affected tuners
ThreeWheelTuner— fixedThreeWheelIMUTuner— fixed (identical loop)TwoWheelTuner,PinpointTuner,OTOSTuner,OctoQuadTuner,MecanumTuner— audited, clean (no hardcoded device lookups)Both changed files compile cleanly against the published artifacts (
com.pedropathing:core/revhub3.0.1,tuning1.0.1, FTCRobotCore/Hardware), andHardwareMap.tryGetis confirmed present in the SDK.