ReedsSheppPath

class ReedsSheppPath(val start: Vector2, val startDirection: Vector2, val radius: Double, val segments: List<ReedsSheppSegment>)(source)

A Reeds-Shepp path: a path from start with the car heading in startDirection, for a car that drives forwards and in reverse and turns at most as sharply as a circle of radius. It consists of up to five segments; where the sign of their lengths changes, the car changes gear and the path has a cusp.

Constructors

Link copied to clipboard
constructor(start: Vector2, startDirection: Vector2, radius: Double, segments: List<ReedsSheppSegment>)

Properties

Link copied to clipboard
val cusps: Int

The number of gear changes.

Link copied to clipboard
val end: Vector2

The end point.

Link copied to clipboard
val endDirection: Vector2

The heading of the car at the end.

Link copied to clipboard

The total length driven, forwards and in reverse.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val start: Vector2
Link copied to clipboard
val startDirection: Vector2

Functions

Link copied to clipboard
fun contour(polarity: YPolarity = YPolarity.CW_NEGATIVE_Y): ShapeContour

The path as a single contour of lines and cubic Béziers, one per at most 90 degrees of arc. It is continuous, but reverses direction at every cusps gear change.

Link copied to clipboard
fun direction(s: Double): Vector2

The heading of the car after driving a distance s along the path; in reverse it points against the motion.

Link copied to clipboard
fun gearContours(polarity: YPolarity = YPolarity.CW_NEGATIVE_Y): List<Pair<ShapeContour, Boolean>>

The path split at its gear changes, with for every part whether it is driven forwards. Every part is tangent-continuous.

Link copied to clipboard

Whether the car drives forwards at distance s along the path.

Link copied to clipboard
fun position(s: Double): Vector2

The position after driving a distance s along the path, forwards or in reverse.