maliput_malidrive
GroundCurve Class Referenceabstract

Detailed Description

Describes a parametric, flat and on-the-ground 2D curve.

It will be also referred as the reference curve.

In mathematical terms:

Let \( G(p) \) be a curve that maps \( p, p0, p1 ∈ ℝ / p ⊂ [p0, p1] ∧ p >= 0 \), to the \( (x, y) \) space, i.e. ℝ² in the INERTIAL Frame. Its arc-length is \( L \) and the heading of the tangent vector in the INERTIAL Frame is \( θ \). \( G(p) \) is G¹ in the domain of \( p \).

There exist:

  • \( G(p) \mapsto ℝ² \).
  • \( G'(p) \mapsto ℝ² \).
  • \( θ(p) \mapsto [-π; π] \).
  • \( θ'(p) \mapsto [-π; π] \) where \( θ' \) is the derivative of the heading with respect to \( p \).
  • \( G⁻¹(x, y) \mapsto [p0, p1] \), where \( G⁻¹\) is the inverse function of \( G \).

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

Inheritance diagram for GroundCurve:
[legend]

Public Member Functions

 MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN (GroundCurve)
 
virtual ~GroundCurve ()=default
 
double PFromP (double xodr_p) const
 Calculates the \( p \) value that matches with the \( p \) value in the XODR description. More...
 
maliput::math::Vector2 G (double p) const
 Evaluates \( G(p) \). More...
 
maliput::math::Vector2 GDot (double p) const
 Evaluates \( G'(p) \). More...
 
double Heading (double p) const
 Evaluates \( θ(p) \). More...
 
double HeadingDot (double p) const
 Evaluates \( θ'(p) \). More...
 
double GInverse (const maliput::math::Vector2 &xy) const
 Evaluates \( G⁻¹(x, y) \). More...
 
double ArcLength () const
 
double linear_tolerance () const
 
double p0 () const
 
double p1 () const
 
bool IsG1Contiguous () const
 

Static Public Attributes

static constexpr double kEpsilon = 1e-13
 Implementations may opt to allow a tolerance or be up to kEpsilon away from [p0(); p1()]. More...
 

Protected Member Functions

 GroundCurve ()=default
 

Constructor & Destructor Documentation

◆ ~GroundCurve()

virtual ~GroundCurve ( )
virtualdefault

◆ GroundCurve()

GroundCurve ( )
protecteddefault

Member Function Documentation

◆ ArcLength()

double ArcLength ( ) const
Returns
The arc-length of \( G(p) \) in the range \( [`p0()`; `p1()`] \).

◆ G()

maliput::math::Vector2 G ( double  p) const

Evaluates \( G(p) \).

Parameters
pThe parameter. It must be in the range \( [`p0()`; `p1()`] \).
Exceptions
maliput::common::assertion_errorWhen p is not in \( [`p0()`; `p1()`] \).
Returns
The image of \( G(p) \).

◆ GDot()

maliput::math::Vector2 GDot ( double  p) const

Evaluates \( G'(p) \).

Parameters
pThe parameter. It must be in the range \( [`p0()`; `p1()`] \).
Exceptions
maliput::common::assertion_errorWhen p is not in \( [`p0()`; `p1()`] \).
Returns
The image of \( G'(p) \), i.e. the tangent vector.

◆ GInverse()

double GInverse ( const maliput::math::Vector2 xy) const

Evaluates \( G⁻¹(x, y) \).

Parameters
xyA point in ℝ² that is used as a point in the domain of \( G⁻¹ \). When it does not belong to the domain of the inverse function, a point that minimizes its distance is used instead.
Returns
The p parameter that would minimize the Euclidean distance of G(p) to xy.

◆ Heading()

double Heading ( double  p) const

Evaluates \( θ(p) \).

Parameters
pThe parameter. It must be in the range \( [`p0()`; `p1()`] \).
Exceptions
maliput::common::assertion_errorWhen p is not in \( [`p0()`; `p1()`] \).
Returns
The heading of \( G(p) \) at p.

◆ HeadingDot()

double HeadingDot ( double  p) const

Evaluates \( θ'(p) \).

Parameters
pThe parameter. It must be in the range \( [`p0()`; `p1()`] \).
Exceptions
maliput::common::assertion_errorWhen p is not in \( [`p0()`; `p1()`] \).
Returns
The derivative of the heading of \( G(p) \) at p.

◆ IsG1Contiguous()

bool IsG1Contiguous ( ) const
Returns
True when \( F(p) \) is G¹ in the interval \( [`p0()`; `p1()`] \).

◆ linear_tolerance()

double linear_tolerance ( ) const
Returns
The linear tolerance used by implementations to adapt to maliput::api::RoadGeometry requirements.

◆ MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN ( GroundCurve  )

◆ p0()

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

◆ p1()

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

◆ PFromP()

double PFromP ( double  xodr_p) const

Calculates the \( p \) value that matches with the \( p \) value in the XODR description.

Parameters
xodr_pThe parameter in the XODR description.
Returns
The \( p \) value in the GroundCurve domain.
Exceptions
maliput::common::assertion_errorWhen xodr_p doesn't match to any parameter value in the XODR domain.

Member Data Documentation

◆ kEpsilon

constexpr double kEpsilon = 1e-13
staticconstexpr

Implementations may opt to allow a tolerance or be up to kEpsilon away from [p0(); p1()].


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