maliput_malidrive
Geometry Struct Reference

Detailed Description

Holds the values of a XODR description's geometry header.

For example, a XML node describing a XODR's geometry:

<OpenDRIVE>
...
<planView>
<geometry s="0.0000000000000000e+0" x="0.0000000000000000e+0" y="0.0000000000000000e+0"
hdg="1.3734007669450161e+0" length="1.4005927435591335e+2">
<line/>
</geometry>
<geometry s="0.0000000000000000e+00" x="0.0" y="0.0" hdg="0.0" length="100.0">
<arc curvature="0.025"/>
</geometry>
<geometry s="0.0000000000000000e+00" x="0.0" y="0.0" hdg="0.0" length="100.0">
<spiral curvStart="0.025" curvEnd="0.05"/>
</geometry>
</planView>
...
</OpenDRIVE>

#include <src/maliput_malidrive/xodr/geometry.h>

Classes

struct  Arc
 Arc geometry description. More...
 
struct  Line
 Line geometry description. More...
 
struct  Spiral
 Spiral geometry description. More...
 

Public Types

enum  Type { kLine = 0, kArc, kSpiral }
 Contains the types of geometric elements. More...
 

Public Member Functions

bool operator== (const Geometry &other) const
 Equality operator. More...
 
bool operator!= (const Geometry &other) const
 Inequality operator. More...
 

Static Public Member Functions

static std::string type_to_str (Type type)
 Matches string with a Type. More...
 
static Type str_to_type (const std::string &type)
 Matches Type with a string. More...
 

Public Attributes

double s_0 {}
 Start position (s-coordinate). More...
 
maliput::math::Vector2 start_point {}
 Start position (X-Y inertial). More...
 
double orientation {}
 Start orientation (inertial heading). More...
 
double length {}
 Length of the element's reference line. More...
 
Type type {Type::kLine}
 Type of geometric element. More...
 
std::variant< Line, Arc, Spiraldescription
 Description of the geometric type. More...
 

Static Public Attributes

static constexpr const char * kGeometryTag = "geometry"
 Convenient constants that hold the tag names in the XODR Geometry header description. More...
 
static constexpr const char * kS0 = "s"
 
static constexpr const char * kStartPointX = "x"
 
static constexpr const char * kStartPointY = "y"
 
static constexpr const char * kOrientation = "hdg"
 
static constexpr const char * kLength = "length"
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const Geometry &geometry)
 Streams a string representation of geometry into os. More...
 

Member Enumeration Documentation

◆ Type

enum Type
strong

Contains the types of geometric elements.

Enumerator
kLine 
kArc 
kSpiral 

Member Function Documentation

◆ operator!=()

bool operator!= ( const Geometry other) const

Inequality operator.

◆ operator==()

bool operator== ( const Geometry other) const

Equality operator.

◆ str_to_type()

Geometry::Type str_to_type ( const std::string &  type)
static

Matches Type with a string.

Parameters
typeIs a string.
Returns
A Type that matches with type.
Exceptions
maliput::common::assertion_errorWhen type doesn't match with a Type.

◆ type_to_str()

std::string type_to_str ( Geometry::Type  type)
static

Matches string with a Type.

Parameters
typeIs a Type.
Returns
A string that matches with type.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const Geometry geometry 
)
related

Streams a string representation of geometry into os.

Returns os.

Member Data Documentation

◆ description

std::variant<Line, Arc, Spiral> description

Description of the geometric type.

◆ kGeometryTag

constexpr const char* kGeometryTag = "geometry"
staticconstexpr

Convenient constants that hold the tag names in the XODR Geometry header description.

◆ kLength

constexpr const char* kLength = "length"
staticconstexpr

◆ kOrientation

constexpr const char* kOrientation = "hdg"
staticconstexpr

◆ kS0

constexpr const char* kS0 = "s"
staticconstexpr

◆ kStartPointX

constexpr const char* kStartPointX = "x"
staticconstexpr

◆ kStartPointY

constexpr const char* kStartPointY = "y"
staticconstexpr

◆ length

double length {}

Length of the element's reference line.

◆ orientation

double orientation {}

Start orientation (inertial heading).

◆ s_0

double s_0 {}

Start position (s-coordinate).

◆ start_point

maliput::math::Vector2 start_point {}

Start position (X-Y inertial).

◆ type

Type type {Type::kLine}

Type of geometric element.


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