maliput_malidrive
RoadCurveOffset Class Reference

Detailed Description

Creates functors to compute numerical arc length integral of an offset of a RoadCurve and its inverse function.

This class implements piecewise cubic polynomial integration via samples of a RoadCurve::WDot() at different \( (p, r, h=0) \) points generating functors that wrap the results of those integrals and allow interpolation for faster computation.

Implementation of this class controls the tolerance via a heuristic. It uses a relative tolerance based on the GroundCurve's arc length and the linear tolerance. Careful revision of complex compound MalidriveRoadCurves must be done to assure RoadGeometry's linear tolerance.

#include <src/maliput_malidrive/road_curve/road_curve_offset.h>

Public Member Functions

 MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN (RoadCurveOffset)
 
 RoadCurveOffset (const RoadCurve *road_curve, const Function *lane_offset, double p0, double p1)
 Constructs a RoadCurveOffset. More...
 
const RoadCurveroad_curve () const
 Returns the constructor RoadCurve argument. More...
 
double relative_tolerance () const
 The relative tolerance is computed as the proportion of the road_curve's linear tolerance with respect to its GroundCurve arc length. More...
 
double CalcSFromP (double p) const
 Computes the arc length of a constant r lateral offset at p. More...
 
std::function< double(double)> PFromS () const
 Builds a functor that represents the relation \( P(s, r) -> p \) which is a function that maps the arc length \( s \) of an offset road curve. More...
 
std::function< double(double)> SFromP () const
 Builds a functor that represents the relation \( S(p, r) -> s \) which is a function that maps the parameter \( p \) of the reference road curve and a lateral offset with the arc length of that offset road curve. More...
 
double p0 () const
 
double p1 () const
 

Constructor & Destructor Documentation

◆ RoadCurveOffset()

RoadCurveOffset ( const RoadCurve road_curve,
const Function lane_offset,
double  p0,
double  p1 
)

Constructs a RoadCurveOffset.

Parameters
road_curveThe RoadCurve to compute offsets. It must not be nullptr.
lane_offsetNeeded to calculate the derivative of the lateral component. It must not be nullptr.
p0Initial \( p \) parameter value of the curve.
p1Final \( p \) parameter value of the curve.
Exceptions
maliput::common::assertion_errorWhen road_curve is nullptr.
maliput::common::assertion_errorWhen lane_offset is nullptr.
maliput::common::assertion_errorWhen p0 is negative.
maliput::common::assertion_errorWhen p0 is greater than p1.

Member Function Documentation

◆ CalcSFromP()

double CalcSFromP ( double  p) const

Computes the arc length of a constant r lateral offset at p.

Parameters
pThe parameter of road_curve.
Returns
The arc length of the offset road_curve at p.

◆ MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN ( RoadCurveOffset  )

◆ p0()

double p0 ( ) const
Returns
The lower bound range of \( p \).

◆ p1()

double p1 ( ) const
Returns
The upper bound range of \( p \).

◆ PFromS()

std::function< double(double)> PFromS ( ) const

Builds a functor that represents the relation \( P(s, r) -> p \) which is a function that maps the arc length \( s \) of an offset road curve.

Returns
A functor that returns \( p \) given \( s \).

◆ relative_tolerance()

double relative_tolerance ( ) const

The relative tolerance is computed as the proportion of the road_curve's linear tolerance with respect to its GroundCurve arc length.

Returns
The relative tolerance.

◆ road_curve()

const RoadCurve* road_curve ( ) const

Returns the constructor RoadCurve argument.

◆ SFromP()

std::function< double(double)> SFromP ( ) const

Builds a functor that represents the relation \( S(p, r) -> s \) which is a function that maps the parameter \( p \) of the reference road curve and a lateral offset with the arc length of that offset road curve.

Returns
A functor that returns \( s \) given \( p \).

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