How this calculation works
A Reeds Shepp vehicle moves forward or backward while keeping its curvature within a fixed bound. Its shortest obstacle-free path joins two positions and headings, using straight pieces and circular arcs. Reversing motion allows paths unavailable to a forward-only Dubins vehicle.
Implement complete ReedsShepp canonical family enumeration with reflection,timeflip,andbackward transformations as OMPL reference; preservelicense ifport. Normalize relativeposebyrho, evaluatealladmissiblefamilies, signedlengths indicateforward/reverse. Pathlengthrho*sumabssegments. Integrate each straight/circularsegment using signed distance; rejectendpointresidualabove tolerance; returncuspsatnonzerosignedlengthdirectionchanges. Dubins-only oraddingonereverseoption isnotReedsShepp. OMPL actualsource provides18types andcanonical formulas.A worked example
With the prefilled inputs, length = 1.5707963267948966. Poses [x,y,headingRadians]. Forward/reverse obstacle-free bounded-curvature car.
Good to know
Full twelve canonical formula families with time-flip/reflection symmetries,ported from PythonRobotics; analytic endpoint filtering. Obstacle-free reversible bounded-curvature car; floating geometric degeneracies may reject. Headings in radians.
Reference: Primary method reference or author-maintained documentation (opens in a new tab) ↗
Shortest paths that may reverse
A Reeds Shepp vehicle moves forward or backward while keeping its curvature within a fixed bound. Its shortest obstacle-free path joins two positions and headings, using straight pieces and circular arcs. Reversing motion allows paths unavailable to a forward-only Dubins vehicle.
The direction changes are called cusps. A cusp changes travel direction while the vehicle heading remains continuous. It is not an instantaneous heading rotation, and a plotted corner should not suggest that the vehicle can spin in place.
Compare with the Dubins shortest path calculator between oriented points. Allowforwardandreverseboundedcurvaturemotionwithcusps; forward-onlyDubins pathsdo notsolvethisstateconstraintproblem.
Pose and turning-radius inputs
Poses [x,y,headingRadians]. Forward/reverse obstacle-free bounded-curvature car.Each pose contains an x coordinate, a y coordinate and a heading. Headings are supplied in radians in this release. The positive turning radius must not exceed ten thousand. The turning radius is strictly positive and uses the same length units as the coordinates; it controls the curvature limit on every circular piece.
The problem contains no obstacles. A geometrically shortest result can pass through a wall or outside a road boundary. It should therefore be read as a local kinematic connection or lower bound for a larger planning problem, not a collision-free driving instruction.
Canonical path families
The mathematical solution can be found by evaluating a finite collection of canonical straight-and-turning patterns and their symmetry transforms. Each candidate has admissibility conditions. Applying a formula outside those conditions can produce a short number with no valid geometric path.
A complete implementation needs the forward, reverse, reflected and time-reversed cases represented by the chosen reference. Evaluating only forward patterns and one backward straight line does not solve the general problem. The engine evaluates twelve canonical formula families with reflection and time-flip symmetries, following the cited PythonRobotics construction. It reports valid-candidate count, selected signed segments, sampled poses and endpoint residual.
Integrating the selected segments
A signed segment length carries both distance and direction. Its sign determines whether the vehicle travels forward or backward; its type determines straight motion or left/right curvature. The total distance is the sum of absolute lengths, scaled by the turning radius.
After selecting a candidate, integrate every segment from the original start pose and compare the endpoint with the requested goal. This independent geometric reconstruction catches sign and symmetry errors that can survive a minimum-length comparison alone.
A reverse-straight worked example
Start at the origin facing along the positive x axis and end at x equal to minus two with the same heading. A reverse straight segment of length two reaches the goal for any positive turning radius. Its travel direction is backward throughout.
No path can have length less than the straight-line displacement of two, so this segment is globally optimal. It has no cusp because the direction never changes. Nontrivial cusp examples still need comparison with a complete independent reference implementation.
Reading cusps and the static path
The figure should mark straight and circular pieces and label each direction interval. The output reports a cusp count after removing negligible-length segments. It does not return a separate cusp-coordinate array; a drawing can identify direction changes from segment boundaries and the sampled path without claiming that extra output exists. Endpoint headings are useful because matching positions alone does not solve the pose problem.
Zero-length pieces should be removed before counting direction changes. Otherwise a redundant zero can create a false cusp. Several distinct canonical families can tie for shortest length; reporting one valid minimizer is acceptable if the tie policy is stated.
Precision and scope
Normalize distances by the turning radius before evaluating formulas, then scale the answer back. Near-degenerate configurations need tolerant admissibility checks and endpoint verification. A numerical tolerance must not quietly turn an invalid candidate into a claimed exact optimum.
This bounded problem excludes steering-rate limits, acceleration, reverse penalties and collisions. Adding a penalty for reversing changes the objective and can change the best path. Such a result would no longer be the standard shortest-distance Reeds Shepp calculation. Full twelve canonical formula families with time-flip/reflection symmetries,ported from PythonRobotics; analytic endpoint filtering. Obstacle-free reversible bounded-curvature car; floating geometric degeneracies may reject. Headings in radians.
A few questions, answered
How is this different from Dubins paths?
Reeds Shepp motion permits reversing, whereas Dubins motion is forward only.
Does a cusp rotate the vehicle instantly?
No; it changes travel direction while the heading remains continuous.
Is the returned path collision free?
Only obstacles absent from the problem; collision checking is not included.
Can I charge extra for reversing?
That changes the shortest-distance objective and needs a different optimization problem.