feat: add AutoBuilder.configureDistanceBased for distance-based mode#3
Closed
JosephTLockwood wants to merge 1 commit into
Closed
Conversation
Adds four overloads of configureDistanceBased that mirror the existing time-based configure(...) parameter shape: full vs Consumer-only output, with explicit end conditions vs defaults. Sets the same globals fields as configure(...) and uses FollowPathDistanceCommand as the path-following command builder. Explicitly leaves pathfindingConfigured = false since PathfindingCommand is intrinsically time-based; integrating distance-based pathfinding is a separate concern. No unit tests: RobotConfig's static initializer transitively loads WPILib NT JNI, which isn't available in pure-Java test scope. PathPlannerLib follows the same convention (no existing AutoBuilder unit tests). Verified via compile + spotless.
Owner
Author
|
Re-targeting upstream against mjansen4857/pathplanner. See replacement PR there. |
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.
Summary
Third and final PR in the distance-based path-following stack. Stacks on top of PR #2 (
feat/follow-path-distance-command).Adds four overloads of `AutoBuilder.configureDistanceBased(...)` that mirror the existing time-based `configure(...)` parameter shape:
Sets the same `globals` fields as `configure(...)` and builds a `pathFollowingCommandBuilder` that creates `FollowPathDistanceCommand`. Explicitly leaves `pathfindingConfigured = false` since `PathfindingCommand` is intrinsically time-based; integrating distance-based pathfinding is a separate concern.
Why
First-class API parity with `configure(...)` so users can opt into distance-based mode with one call instead of wiring `configureCustom` themselves.
Tests
None added. PathPlannerLib has zero existing `AutoBuilder` unit tests because `RobotConfig`'s static initializer transitively loads WPILib NetworkTables JNI, which isn't available in pure-Java test scope. Following the same convention; verified via compile + `spotlessJavaCheck`.
`followPath(PathPlannerPath)` and the rest of the public `AutoBuilder` surface work transparently with distance-based mode -- they all delegate to the `pathFollowingCommandBuilder` lambda which now produces `FollowPathDistanceCommand`. The `pathfindToPose` / `pathfindThenFollowPath` family correctly throws when used in distance-based mode (the standard not-configured error).
Test plan