Clothoid

class pyclothoids.Clothoid(clothoid_curve)

An object representing a single clothoid curve. Pickling and unpickling is supported. The class constructor is meant for internal use for interfacing with the C++ layer. To initialize a Clothoid, use one of the classmethods instead.

classmethod StandardParams(x0, y0, t0, k0, kd, s_f)

A method to initialize a Clothoid given a starting point, starting tangent, starting curvature, curvature rate, and final length.

classmethod G1Hermite(x0, y0, t0, x1, y1, t1, tol=1e-10)

A method to numerically compute the solution to the G1 Hermite interpolation problem and initialize a Clothoid object with the solution parameters.

classmethod Forward(x0, y0, t0, k0, x1, y1, tol=1e-10)

A method to numerically compute the solution to the forward problem given a starting point, starting tangent, starting curvature, and final point and initialize a Clothoid object with the solution parameters.

Parameters

Complete data describing the calling Clothoid

Getter:Returns the initialization parameters of a clothoid, fit to be used as args to StandardParams
Setter:Parameters cannot be modified
Type:tuple
length

The total arc length of the Clothoid

Getter:Returns the arc length of the clothoid
Setter:Arc length cannot be modified
Type:float
dk

The curvature rate of the Clothoid

Getter:Returns the curvature rate of the clothoid
Setter:Curvature rate cannot be modified
Type:float
XStart

The X coordinate of the Clothoid at its starting point

Getter:Returns the initial X coordinate of the clothoid
Setter:Initial X coordinate cannot be modified
Type:float
XEnd

The X coordinate of the Clothoid at its end point

Getter:Returns the final X coordinate of the clothoid
Setter:Final X coordinate cannot be modified
Type:float
YStart

The Y coordinate of the Clothoid at its starting point

Getter:Returns the initial Y coordinate of the clothoid
Setter:Initial Y coordinate cannot be modified
Type:float
YEnd

The Y coordinate of the Clothoid at its end point

Getter:Returns the final Y coordinate of the clothoid
Setter:Final Y coordinate cannot be modified
Type:float
ThetaStart

The tangent angle of the Clothoid at its starting point

Getter:Returns the initial tangent angle of the clothoid in radians
Setter:Initial angle cannot be modified
Type:float
ThetaEnd

The tangent angle of the Clothoid at its end point

Getter:Returns the final tangent angle of the clothoid in radians
Setter:Final angle cannot be modified
Type:float
KappaStart

The curvature of the Clothoid at its starting point

Getter:Returns the initial curvature of the clothoid
Setter:Initial curvature cannot be modified
Type:float
KappaEnd

The curvature of the Clothoid at its end point

Getter:Returns the final curvature of the clothoid
Setter:Final curvature cannot be modified
Type:float
X(s)

Returns the X coordinate of the clothoid at arc length s from the initial point

XD(s)

Returns the derivative of the X coordinate of the clothoid at arc length s from the initial point

XDD(s)

Returns the second derivative of the X coordinate of the clothoid at arc length s from the initial point

XDDD(s)

Returns the third derivative of the X coordinate of the clothoid at arc length s from the initial point

Y(s)

Returns the Y coordinate of the clothoid at arc length s from the initial point

YD(s)

Returns the derivative of the Y coordinate of the clothoid at arc length s from the initial point

YDD(s)

Returns the second derivative of the Y coordinate of the clothoid at arc length s from the initial point

YDDD(s)

Returns the third derivative of the Y coordinate of the clothoid at arc length s from the initial point

Theta(s)

Returns the tangent angle of the clothoid at arc length s from the initial point

ThetaD(s)

Returns the derivative of the tangent angle of the clothoid at arc length s from the initial point

ThetaDD(s)

Returns the second derivative of the tangent angle of the clothoid at arc length s from the initial point

ThetaDDD(s)

Returns the third derivative of the tangent angle of the clothoid at arc length s from the initial point

SampleXY(npts)

A method to return a vector of X coordinates and Y coordinates generated by evaluating the Clothoid at npts equally spaced points along its length.

Roughly shorthand for:

def SampleXY(self,npts):
    sample_points = [self.length * m/(npts-1) for m in range(0,npts)]
    X = [self.X(i) for i in sample_points]
    Y = [self.Y(i) for i in sample_points]
    return [X,Y]
Scale(sfactor, center=(0, 0))

Returns a copy of the calling clothoid subjected to a scaling transform with a scale of sfactor and a stationary point at center

Translate(xoff, yoff)

Returns a copy of the calling clothoid subjected to a pure translation transform described by a vector (xoff,yoff)

Rotate(angle, center=(0, 0))

Returns a copy of the calling clothoid subjected to a pure rotation transform of angle and a stationary point at center

Flip(axis='y')

Returns a copy of the calling clothoid that has been flipped symmetrically along a specified axis

currently supported options are:

  • ‘y’
  • ‘x’
  • ‘start’

Where ‘start’ represents a line tangent to the clothoid at its starting point.

Reverse()

Returns a copy of the calling clothoid with the direction of the arc length parameter reversed

Trim(s_begin, s_end)

Returns a copy of the subsection of the calling clothoid that lies between s_begin and s_end