maliput_malidrive
|
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 RoadCurve * | road_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 |
RoadCurveOffset | ( | const RoadCurve * | road_curve, |
const Function * | lane_offset, | ||
double | p0, | ||
double | p1 | ||
) |
Constructs a RoadCurveOffset.
road_curve | The RoadCurve to compute offsets. It must not be nullptr. |
lane_offset | Needed to calculate the derivative of the lateral component. It must not be nullptr. |
p0 | Initial \( p \) parameter value of the curve. |
p1 | Final \( p \) parameter value of the curve. |
maliput::common::assertion_error | When road_curve is nullptr. |
maliput::common::assertion_error | When lane_offset is nullptr. |
maliput::common::assertion_error | When p0 is negative. |
maliput::common::assertion_error | When p0 is greater than p1 . |
double CalcSFromP | ( | double | p | ) | const |
Computes the arc length of a constant r
lateral offset at p
.
p | The parameter of road_curve . |
road_curve
at p
. MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN | ( | RoadCurveOffset | ) |
double p0 | ( | ) | const |
double p1 | ( | ) | const |
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.
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.
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.