API

API

Curve Types

Curve
LineSegment
ArcSegment
Clothoid
PolyCurve

Abstract base class for all specialized curve types.

source
LineSegment(p0, p1)

A line segment starting from p0 and ending at p1. Besides the Curve protocol, also a direction function is implemented, which calculates the unit vector pointing from p0 in direction of p1.

source
ArcSegment(origin, radius, angle0, angle1)

ArcSegment centered at origin with the given radius going from the first to the second angle. As parametrization the angle difference to the starting angle is used.

source
Clothoid(origin, shift, rotation, λ, l0, l1)

Describes a clothoid which in standard orientation.

It is here defined as

\[x(s) = \int_0^s \cos(λ t^2) \mathrm{d}t \\ y(s) = \int_0^s \sin(λ t^2) \mathrm{d}t\]

for parameter $s ∈ [l0, l1]$. (Note that l1 may also be smaller to l0). It is placed at origin, shifted along the x-axis and rotated around the origin by the given angle.

source
PolyCurve(curves...)

Collection of curves joined at their start and endpoints.

source

Curve Interface

smax
point
startpoint
endpoint
dpoint
length
dlength
curvature
dcurvature
tangentangle
radialangle

SmoothCurves.smaxFunction.
smax(C::Curve)

Maximum parameter $s$ for which the given curve $\mathcal{C}$ is defined.

source
SmoothCurves.pointFunction.
point(C::Curve, s)

Point (x, y) of the curve $\mathcal{C}$ at $s$. Returns a StaticArrays.SVector.

source
startpoint(C::Curve)

Return the first point $C(0)$ of the curve.

source
SmoothCurves.endpointFunction.
endpoint(C::Curve)

Return the last point $C(s_\mathrm{max}$ of the curve.

source
SmoothCurves.dpointFunction.
dpoint(C::Curve, s)

Derivative $\frac{dC(s)}{ds}$ of the curve $\mathcal{C}$ at $s$. Returns a StaticArrays.SVector.

source
Base.lengthFunction.
length(C::Curve, s)

Length of the given curve $\mathcal{C}$ between $0$ and $s$.

source
length(C::Curve)

Total length of the given curve. Equal to length(C, smax(C)).

source
SmoothCurves.dlengthFunction.
dlength(C::Curve, s)

Derivative $\frac{dl}{ds}$ at $s$.

source
curvature(C::Curve, s)

Curvature of the Curve $\mathcal{C}$ at $s$.

source
dcurvature(C::Curve, s)

Derivative $\frac{dκ}{ds}$ of the curve $\mathcal{C}$ at $s$.

source
tangentangle(C::Curve, s)

Angle between the tangent of the curve $\mathcal{C}$ at $s$ and the $x$-axis. Always between $-π$ and $π$.

source
radialangle(C::Curve, s)

Angle between the radial vector of the curve $\mathcal{C}$ at $s$ and the $x$-axis. Always between $-π$ and $π$.

source

Curve specific functions

LineSegment

direction(C::LineSegment)

Returns the unitvector from the start point to the endpoint of the line segment.

source

ArcSegment

Base.signMethod.
sign(C::ArcSegment)

Sign of the curvature of the ArcSegment.

source

Clothoid

SmoothCurves.fresnelFunction.
fresnel(λ, s)

Solve the generalized Fresnel integrals

\[x(s) = \int_0^s \cos(λ t^2) \mathrm{d}t \\ y(s) = \int_0^s \sin(λ t^2) \mathrm{d}t\]
source
l(C::Clothoid, s)

Signed distance to the origin of the Clothoid.

source

PolyCurve

subcurveindex(C::PolyCurve, s)

Index of the subcurve reached at the given parameter s.

source
subcurveparameter(C::PolyCurve, s)

Parameter $s_i$ for which $C(s)=C_i(s_i)$

source
SmoothCurves.dispatchFunction.
dispatch(f, C::PolyCurve, s::Real)

Apply function f to appropriate subcurve i.e. $f(C_i, s_i)$.

source

Frenet Frame

frenet.coordinates(p0::Pose, p::Pose)

Coordinates of p in the Frenet frame defined by p0.

source
frenet.coordinates(C::Curve, s, p::Pose)

Coordinates of p in the Frenet frame at $C(s)$.

source