Documentation 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 composes one or more BezierCurve segments into a single continuous path indexed by arc-length distance from the start. At construction time it caches the full arc length of every segment so that subsequent distance-based queries — position, heading, curvature, tangent, centripetal vector — each pay only the cost of locating the right segment and a single getTAtDistance call, rather than re-integrating the whole curve.
Package: org.firstinspires.ftc.teamcode.odyssey.path
Constructor
One or more
BezierCurve segments in traversal order. Passed as a varargs list so any number of segments can be composed without building an array manually. Each segment’s full arc length (getLength(1)) is computed and cached at construction time.Arc-length caching happens once, eagerly, during the constructor call. For long multi-segment paths with tight Gauss–Legendre tolerances this may take a few milliseconds — construct
Path objects during initialisation, not inside a control loop.Methods
getTotalLength
Total path length in the same units as the control points (millimetres for a standard FTC field). This value is computed once at construction and returned in O(1).
getPointOnPath
Distance from the start of the path in millimetres.
A
Pose2d containing the field-frame (x, y) position and heading (radians, normalised to (−π, π]) at the requested distance. The heading is provided by the HeadingInterpolator attached to the containing segment.getPointOnPath clamps to path endpoints for out-of-range values: a distance ≤ 0 returns the pose at t = 0 of the first segment, and any distance beyond getTotalLength() returns the pose at t = 1 of the last segment.getDistanceOnPath
getClosestT on every segment and picks the segment with the smallest squared distance.
Current robot position in the field frame (millimetres).
Arc-length distance from the path start to the closest point on the path, in millimetres.
getCurvatureFromPathDistance
Distance from path start in millimetres. Values
≤ 0 return the curvature at t = 0 of the first segment; values beyond the total length return the curvature at t = 1 of the last segment.Curvature
κ = |B' × B''| / |B'|³ at the resolved parameter, in mm⁻¹. Returns 0 on degenerate (zero-length) segments.getTangentFromPathDistance
Distance from path start in millimetres. Clamped to path endpoints as with the other distance-based methods.
First derivative
B'(t) of the containing segment at the resolved parameter. The vector magnitude reflects the parametric speed, not physical speed; normalise with vector.normalize() if you need a unit direction.getCentripetalVectorPath
B''(t) orthogonal to the tangent. This is used by VelocityProfile to compute lateral acceleration when enforcing the centripetal limit.
Distance from path start in millimetres. Clamped to path endpoints.
The centripetal vector
B''(t) − (B''·B' / |B'|²)·B' at the resolved parameter.Multi-Segment Example
For smooth heading across segment boundaries, ensure the
endHeading of one segment’s interpolator matches the startHeading of the next. Path applies each segment’s HeadingInterpolator independently — there is no global heading sweep across the full path.