ADocumentation Index
Fetch the complete documentation index at: https://mintlify.com/saquer916/odyssey/llms.txt
Use this file to discover all available pages before exploring further.
Path is an ordered chain of BezierCurve segments that the robot traverses end-to-end as a single continuous route. Rather than commanding the robot to drive each segment in isolation, Path stitches them together by cumulative arc length, so higher-level components like VelocityProfile and the Follower can reason about the entire route with a single scalar: distance from path start.
Arc-length caching
Computing the arc length of a Bézier curve via Gauss–Legendre integration is accurate but not free.Path avoids repeating that work on every query by computing and storing each segment’s length once, at construction time:
getTotalLength() returns the sum in O(1) and all distance-walking loops read from curveLengths[] without touching the integrator again.
Building a two-segment path
BezierCurve objects — the varargs constructor accepts one or more segments.
Key API
getPointOnPath(double distance)
Returns a Pose2d (position + heading) at the given arc-length distance from the start of the path. Internally it walks the cached segment lengths to find which curve contains that distance, then calls getTAtDistance on that curve and delegates heading to the curve’s HeadingInterpolator:
distance, Odyssey calls curve.getTAtDistance(remainingDist) — the Brent-solver inversion — exactly once.
Boundary behaviour:
distance ≤ 0→ returns the pose at the very start of the first segment.distance ≥ totalLength→ returns the pose at the very end of the last segment.
getDistanceOnPath(Vector2d pose)
Projects the robot’s measured position onto the path and returns a scalar distance from path start. This is the primary feedback signal used by the Follower.
For each segment it calls getClosestT (two-phase coarse/fine search) to find the nearest point on that segment, then converts the winning t back to a cumulative arc-length distance using curve.getLength(t):
Additional queries
| Method | Description |
|---|---|
getTotalLength() | Total arc length of the entire path (mm) |
getCurvatureFromPathDistance(double dist) | Curvature κ at a given path distance — fed to VelocityProfile |
getTangentFromPathDistance(double dist) | Unit tangent vector at a given path distance |
getCentripetalVectorPath(double dist) | Centripetal acceleration direction at a given path distance |
Heading seams between segments
Heading is controlled independently by each segment’s ownHeadingInterpolator — there is no global heading interpolation across the whole Path. This means the robot’s commanded heading at the end of one segment and the start of the next are determined by two separate interpolator instances.
Because getPointOnPath always queries heading from the curve’s own interpolator, a well-matched seam produces a continuous heading profile with no discontinuity as the path crosses from one segment to the next.