API
Curve Types
CurveLineSegmentArcSegmentClothoidPolyCurve
SmoothCurves.Curve — Type.Abstract base class for all specialized curve types.
SmoothCurves.LineSegment — Type.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.
SmoothCurves.ArcSegment — Type.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.
SmoothCurves.Clothoid — Type.Clothoid(origin, shift, rotation, λ, l0, l1)Describes a clothoid which in standard orientation.
It is here defined as
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.
SmoothCurves.PolyCurve — Type.PolyCurve(curves...)Collection of curves joined at their start and endpoints.
Curve Interface
smaxpointstartpointendpointdpointlengthdlengthcurvaturedcurvaturetangentangleradialangle
SmoothCurves.smax — Function.smax(C::Curve)Maximum parameter $s$ for which the given curve $\mathcal{C}$ is defined.
SmoothCurves.point — Function.point(C::Curve, s)Point (x, y) of the curve $\mathcal{C}$ at $s$. Returns a StaticArrays.SVector.
SmoothCurves.startpoint — Function.startpoint(C::Curve)Return the first point $C(0)$ of the curve.
SmoothCurves.endpoint — Function.endpoint(C::Curve)Return the last point $C(s_\mathrm{max}$ of the curve.
SmoothCurves.dpoint — Function.dpoint(C::Curve, s)Derivative $\frac{dC(s)}{ds}$ of the curve $\mathcal{C}$ at $s$. Returns a StaticArrays.SVector.
Base.length — Function.length(C::Curve, s)Length of the given curve $\mathcal{C}$ between $0$ and $s$.
length(C::Curve)Total length of the given curve. Equal to length(C, smax(C)).
SmoothCurves.dlength — Function.dlength(C::Curve, s)Derivative $\frac{dl}{ds}$ at $s$.
SmoothCurves.curvature — Function.curvature(C::Curve, s)Curvature of the Curve $\mathcal{C}$ at $s$.
SmoothCurves.dcurvature — Function.dcurvature(C::Curve, s)Derivative $\frac{dκ}{ds}$ of the curve $\mathcal{C}$ at $s$.
SmoothCurves.tangentangle — Function.tangentangle(C::Curve, s)Angle between the tangent of the curve $\mathcal{C}$ at $s$ and the $x$-axis. Always between $-π$ and $π$.
SmoothCurves.radialangle — Function.radialangle(C::Curve, s)Angle between the radial vector of the curve $\mathcal{C}$ at $s$ and the $x$-axis. Always between $-π$ and $π$.
Curve specific functions
LineSegment
SmoothCurves.direction — Method.direction(C::LineSegment)Returns the unitvector from the start point to the endpoint of the line segment.
ArcSegment
Base.sign — Method.sign(C::ArcSegment)Sign of the curvature of the ArcSegment.
Clothoid
SmoothCurves.fresnel — Function.fresnel(λ, s)Solve the generalized Fresnel integrals
SmoothCurves.standardlength — Function.l(C::Clothoid, s)Signed distance to the origin of the Clothoid.
PolyCurve
SmoothCurves.subcurveindex — Function.subcurveindex(C::PolyCurve, s)Index of the subcurve reached at the given parameter s.
SmoothCurves.subcurveparameter — Function.subcurveparameter(C::PolyCurve, s)Parameter $s_i$ for which $C(s)=C_i(s_i)$
SmoothCurves.dispatch — Function.dispatch(f, C::PolyCurve, s::Real)Apply function f to appropriate subcurve i.e. $f(C_i, s_i)$.
Frenet Frame
SmoothCurves.frenet.coordinates — Function.frenet.coordinates(p0::Pose, p::Pose)Coordinates of p in the Frenet frame defined by p0.
frenet.coordinates(C::Curve, s, p::Pose)Coordinates of p in the Frenet frame at $C(s)$.