BLine-Lib Overview¶
BLine-Lib v0.9.1 is the Java/WPILib 2026 robot-side library. It loads or constructs paths and exposes FollowPath, a WPILib command for holonomic drivetrains.
The editor is optional. Robot code can either load an exported path JSON file or construct a custom Path directly from Java elements and constraints. Both forms are passed to the same FollowPath.Builder.build(Path) method.
Drivetrain contract¶
FollowPath.Builder needs:
- the drivetrain
Subsystemrequirement; - a field-relative
Pose2dsupplier; - a robot-relative
ChassisSpeedssupplier; - a robot-relative
ChassisSpeedsconsumer; and - translation, rotation, and cross-track
PIDControllerinstances.
The library returns ordinary robot-relative chassis-speed requests. Converting those into module states or vendor-specific requests remains the drivetrain's job.
Main public classes¶
| Class | Purpose |
|---|---|
Path |
Elements, global/path constraints, loading, transformations, start pose, and copies |
FollowPath |
Runtime command, builder, events, logging, rotation override, and diagnostics |
BLineCommands |
Requirement-safe wrappers for WPILib command composition around event-driven autos |
BLineField |
Draw path translation points into a WPILib Field2d |
JsonUtils |
Load/parse path and configuration JSON |
FlippingUtil |
Field flip/mirror helpers for poses, rotations, translations, speeds, and feedforwards |
ChassisRateLimiter |
Translation/rotation acceleration limiting used by the follower |
Minimal patterns¶
Configure one reusable follower builder:
FollowPath.Builder builder = new FollowPath.Builder(
driveSubsystem,
driveSubsystem::getPose,
driveSubsystem::getRobotRelativeSpeeds,
driveSubsystem::driveRobotRelative,
translationPid,
rotationPid,
crossTrackPid
).withDefaultShouldFlip();
Then choose either source for the path:
Path path = new Path(
new Path.Waypoint(1.0, 0.8, Rotation2d.fromDegrees(0)),
new Path.TranslationTarget(1.5, 1.1),
new Path.Waypoint(2.0, 0.8, Rotation2d.fromDegrees(0))
);
Command follow = builder.build(path);
No editor or path JSON is involved. Configure the global defaults in Java as well if this project does not deploy autos/config.json; see Create Paths in Java or Load JSON.
Path path = new Path("first-straight");
Command follow = builder.build(path);
This loads autos/paths/first-straight.json and the adjacent autos/config.json.
Reset localization once at the transformed start of an autonomous routine. See First Path Tutorial.
Runtime lifecycle¶
FollowPath:
- copies the supplied path when built;
- applies the configured flip and mirror at command initialization;
- optionally resets pose if the builder captured a pose-reset consumer;
- resets translation/rotation controller state;
- calculates constrained chassis speeds each execute cycle;
- fires eligible events;
- finishes on final translation/rotation tolerances; and
- sends zero
ChassisSpeedson end or interruption.
Shared static state¶
These APIs affect all BLine commands in the process:
- default global constraints;
- event-trigger registry;
- logging consumers; and
- rotation override.
Configure them intentionally during robot initialization and clear rotation overrides when their use ends.
Learn by task¶
- Follow Paths
- Create Paths in Java or Load JSON
- Events & Command Groups
- Rotation Overrides
- Optional Field2d Visualization
- Alliance Flip & Mirror
- Logging & AdvantageScope
- API Reference
For method-level detail, use the generated Javadocs.