Drake
ArcLengthParameterizedSpline Class Reference

An extension for ignition::math::Splines that reparameterizes them by path length. More...

#include <drake/automotive/maliput/rndf/spline_helpers.h>

Public Member Functions

 ArcLengthParameterizedSpline (std::unique_ptr< ignition::math::Spline > spline, double error_boundary)
 Constructor that takes a spline and an error bound for path length parameterization approximations. More...
 
ignition::math::Vector3d InterpolateMthDerivative (int derivative_order, double s)
 Interpolates \( Q(s) \), that is, the spline parameterized by path length. More...
 
ignition::math::Spline * BaseSpline ()
 
double FindClosestPointTo (const ignition::math::Vector3d &point, double step) const
 Finds the closest point on the spline to a point in space. More...
 
Does not allow copy, move, or assignment
 ArcLengthParameterizedSpline (const ArcLengthParameterizedSpline &)=delete
 
ArcLengthParameterizedSplineoperator= (const ArcLengthParameterizedSpline &)=delete
 
 ArcLengthParameterizedSpline (ArcLengthParameterizedSpline &&)=delete
 
ArcLengthParameterizedSplineoperator= (ArcLengthParameterizedSpline &&)=delete
 

Detailed Description

An extension for ignition::math::Splines that reparameterizes them by path length.

Constructor & Destructor Documentation

ArcLengthParameterizedSpline ( std::unique_ptr< ignition::math::Spline >  spline,
double  error_boundary 
)
explicit

Constructor that takes a spline and an error bound for path length parameterization approximations.

Parameters
[in]splinethe spline to be parameterized by path length.
[in]error_boundarya positive constraint on the maximum error allowed when approximating the path length parameterization.
Exceptions
std::runtime_errorWhen spline is nullptr.
std::runtime_errorWhen error_boundary is not a positive number.

Member Function Documentation

ignition::math::Spline* BaseSpline ( )
inline
Returns
a mutable pointer to the underlying spline.

Here is the call graph for this function:

double FindClosestPointTo ( const ignition::math::Vector3d &  point,
double  step 
) const

Finds the closest point on the spline to a point in space.

It will iterate over the range of s of the spline which is 0 to 1 in terms of ignition::math::Spline's parameter at constant path length step increments. On each iteration we get the distance and save the path length coordinate that gives the minimum distance.

Parameters
pointthe point in space from which we want to get the s path length value whose image of the direct function (the spline) within 0 and the total length of the direct function.
stepthe path length increment to iterate over the complete spline path length.
Returns
the path length value that applied to the ignition::math::Spline, which was provided at construction time, has a minimum distance to point.

Here is the call graph for this function:

ignition::math::Vector3d InterpolateMthDerivative ( int  derivative_order,
double  s 
)

Interpolates \( Q(s) \), that is, the spline parameterized by path length.

Parameters
[in]derivative_ordera non-negative integer describing the order of the function derivative to interpolate. Since cubic interpolation is done, any derivative order greater than 3 will be zero.
[in]spath length to interpolate at, constrained by the curve dimensions [0, path_length].
Returns
the derivative_order derivative \( Q^{(derivative_order)}(s) \).
Exceptions
std::runtime_errorIf derivative_order is a negative integer.

The documentation for this class was generated from the following files: