maliput_malidrive
RoadType Struct Reference

Detailed Description

Holds the values of a XODR description of a type header.

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

<OpenDRIVE>
...
<road name="Road 0" length="4.9118886948705835e+1" id="0" junction="-1">
<type s="0.0000000000000000e+0" type="town">
<speed max="40" unit="mph"/>
</type>
...
</road>
...
</OpenDRIVE>

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

Classes

struct  Speed
 Speed description. More...
 

Public Types

enum  Type {
  kUnknown = 0, kRural, kMotorway, kTown,
  kLowSpeed, kPedestrian, kBicycle, kTownExpressway,
  kTownCollector, kTownArterial, kTownPrivate, kTownLocal,
  kTownPlayStreet
}
 Contains the types of road. More...
 

Public Member Functions

bool operator== (const RoadType &other) const
 Equality operator. More...
 
bool operator!= (const RoadType &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...
 
Type type {Type::kUnknown}
 Type of the road. More...
 
std::optional< std::string > country {std::nullopt}
 Country code of the road. More...
 
Speed speed {}
 Maximum speed allowed. More...
 

Static Public Attributes

static constexpr const char * kRoadTypeTag = "type"
 Convenient constants that hold the tag names in the XODR Type header description. More...
 
static constexpr const char * kS0 = "s"
 
static constexpr const char * kType = "type"
 
static constexpr const char * kCountry = "country"
 

Member Enumeration Documentation

◆ Type

enum Type
strong

Contains the types of road.

Enumerator
kUnknown 
kRural 
kMotorway 
kTown 
kLowSpeed 
kPedestrian 
kBicycle 
kTownExpressway 
kTownCollector 
kTownArterial 
kTownPrivate 
kTownLocal 
kTownPlayStreet 

Member Function Documentation

◆ operator!=()

bool operator!= ( const RoadType other) const

Inequality operator.

◆ operator==()

bool operator== ( const RoadType other) const

Equality operator.

◆ str_to_type()

RoadType::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 ( RoadType::Type  type)
static

Matches string with a Type.

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

Member Data Documentation

◆ country

std::optional<std::string> country {std::nullopt}

Country code of the road.

◆ kCountry

constexpr const char* kCountry = "country"
staticconstexpr

◆ kRoadTypeTag

constexpr const char* kRoadTypeTag = "type"
staticconstexpr

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

◆ kS0

constexpr const char* kS0 = "s"
staticconstexpr

◆ kType

constexpr const char* kType = "type"
staticconstexpr

◆ s_0

double s_0 {}

Start position (s-coordinate).

◆ speed

Speed speed {}

Maximum speed allowed.

◆ type

Type of the road.


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