maliput_malidrive
Connection Struct Reference

Detailed Description

Holds a Connection description of a XODR junction.

Provides information about a single connection within a junction. For example:

<OpenDRIVE>
...
<connection id="0" incomingRoad="166" connectingRoad="409" contactPoint="start">
<laneLink from="-2" to="-2"/>
<laneLink from="-3" to="-3"/>
<laneLink from="-4" to="-4"/>
</connection>
...
</OpenDRIVE>

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

Classes

struct  LaneLink
 Holds a LaneLink description of a XODR junction. More...
 

Public Types

enum  ContactPoint { kStart = 0, kEnd }
 Enum the contact points. More...
 
enum  Type { kDefault = 0, kVirtual }
 Enum junction types. More...
 
using Id = maliput::api::TypeSpecificIdentifier< struct Connection >
 

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

Id id {"None"}
 Connetion's id. More...
 
std::string incoming_road {}
 ID of the incoming road. More...
 
std::string connecting_road {}
 ID of the connecting path. More...
 
ContactPoint contact_point {ContactPoint::kStart}
 Contact point on the connecting road. More...
 
std::optional< Idconnection_master {std::nullopt}
 ID of the connection which will act as master. More...
 
std::optional< Typetype {Type::kDefault}
 Type of the connection, required for virtual connections only. More...
 
std::vector< LaneLinklane_links {}
 Links between lanes. More...
 

Static Public Attributes

static constexpr const char * kConnectionTag = "connection"
 Convenient constants that hold the tag names in the XODR connection description. More...
 
static constexpr const char * kId = "id"
 
static constexpr const char * kIncomingRoad = "incomingRoad"
 
static constexpr const char * kConnectingRoad = "connectingRoad"
 
static constexpr const char * kContactPoint = "contactPoint"
 
static constexpr const char * kConnectionMaster = "connectionMaster"
 
static constexpr const char * kType = "type"
 

Member Typedef Documentation

◆ Id

Member Enumeration Documentation

◆ ContactPoint

Enum the contact points.

Enumerator
kStart 
kEnd 

◆ Type

enum Type

Enum junction types.

Enumerator
kDefault 
kVirtual 

Member Function Documentation

◆ contact_point_to_str()

std::string contact_point_to_str ( ContactPoint  contact_point)
static

Matches string with a ContactPoint.

Parameters
contact_pointIs a ContactPoint.
Returns
A string that matches with contact_point.

◆ operator!=()

bool operator!= ( const Connection other) const

Inequality operator.

◆ operator==()

bool operator== ( const Connection other) const

Equality operator.

◆ str_to_contact_point()

Connection::ContactPoint str_to_contact_point ( const std::string &  contact_point)
static

Matches ContactPoint with a string.

Parameters
contact_pointIs a string.
Returns
A ContactPoint that matches with contact_point.
Exceptions
maliput::common::assertion_errorWhen contact_point doesn't match with a ContactPoint.

◆ str_to_type()

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

Matches string with a Type.

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

Member Data Documentation

◆ connecting_road

std::string connecting_road {}

ID of the connecting path.

◆ connection_master

std::optional<Id> connection_master {std::nullopt}

ID of the connection which will act as master.

◆ contact_point

ContactPoint contact_point {ContactPoint::kStart}

Contact point on the connecting road.

◆ id

Id id {"None"}

Connetion's id.

◆ incoming_road

std::string incoming_road {}

ID of the incoming road.

◆ kConnectingRoad

constexpr const char* kConnectingRoad = "connectingRoad"
staticconstexpr

◆ kConnectionMaster

constexpr const char* kConnectionMaster = "connectionMaster"
staticconstexpr

◆ kConnectionTag

constexpr const char* kConnectionTag = "connection"
staticconstexpr

Convenient constants that hold the tag names in the XODR connection description.

◆ kContactPoint

constexpr const char* kContactPoint = "contactPoint"
staticconstexpr

◆ kId

constexpr const char* kId = "id"
staticconstexpr

◆ kIncomingRoad

constexpr const char* kIncomingRoad = "incomingRoad"
staticconstexpr

◆ kType

constexpr const char* kType = "type"
staticconstexpr

◆ lane_links

std::vector<LaneLink> lane_links {}

Links between lanes.

◆ type

std::optional<Type> type {Type::kDefault}

Type of the connection, required for virtual connections only.


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