maliput_malidrive
malidrive::xodr Namespace Reference

Classes

class  AttributeParser
 Parses XML node's attributes descriptions. More...
 
struct  Connection
 Holds a Connection description of a XODR junction. More...
 
class  DBManager
 Database Manager in charge of: More...
 
struct  ElevationProfile
 Contains a series of elevation records which define the characteristics of the road's elevation along the reference line. More...
 
struct  Geometry
 Holds the values of a XODR description's geometry header. More...
 
struct  Header
 Holds the values of a XODR description's header. More...
 
struct  Junction
 Holds a junction description of a XODR road. More...
 
struct  Lane
 Holds the values of a XODR Lane. More...
 
struct  LaneLink
 Holds the lane link description in a XODR. More...
 
struct  LaneOffset
 Holds the values of a XODR Lane Offset. More...
 
struct  Lanes
 Holds the values of a XODR Lanes node. More...
 
struct  LaneSection
 Holds the values of a XODR LaneSection. More...
 
struct  LaneWidth
 Holds the values of a XODR Lane Width. More...
 
struct  LateralProfile
 Contains a series of superelevation records which define the characteristics of the road's lateral profile along the reference line. More...
 
class  NodeParser
 Parses XML nodes. More...
 
class  ParserBase
 Base class for parsing a tinyxml2::XMLElement node. More...
 
struct  ParserConfiguration
 Holds the configuration for the parser. More...
 
struct  PlanView
 Holds the plan view geometry description of a XODR road. More...
 
struct  ReferenceGeometry
 Holds the geometry description of a XODR road. More...
 
struct  RoadHeader
 Holds the values of a XODR description's Road header. More...
 
struct  RoadLink
 Holds the road link description of a XODR road. More...
 
struct  RoadType
 Holds the values of a XODR description of a type header. More...
 

Enumerations

enum  Unit { kMs = 0, kMph, kKph }
 Enumerates the units allowed in the XODR description. More...
 

Functions

std::unique_ptr< DBManagerLoadDataBaseFromFile (const std::string &filepath, const ParserConfiguration &parser_configuration)
 Loads a XODR description from a file. More...
 
std::unique_ptr< DBManagerLoadDataBaseFromStr (const std::string &xodr_str, const ParserConfiguration &parser_configuration)
 Loads a XODR description from a string. More...
 
std::ostream & operator<< (std::ostream &os, const Geometry &geometry)
 
std::ostream & operator<< (std::ostream &out, const Header &header)
 Streams a string representation of header into out. More...
 
std::ostream & operator<< (std::ostream &out, const Junction &junction)
 Streams a string representation of junction into out. More...
 
std::string ConvertXMLNodeToText (tinyxml2::XMLElement *element)
 Convert all the content of the XML node into text. More...
 
std::ostream & operator<< (std::ostream &out, const RoadHeader &road_header)
 Streams a string representation of road_header into out. More...
 
double GetDistanceBetweenGeometries (const Geometry &lhs, const Geometry &rhs)
 Calculates the Euclidean distance between the endpoint of lhs and the startpoint of rhs. More...
 
template<class XodrFunction >
double GetDistanceBetweenFunctions (const XodrFunction &lhs, const XodrFunction &rhs)
 Computes the distance between the images of lhs and rhs polynomials. More...
 
Vector2 ComputeEndpointWithNewLength (const Geometry &geometry, double length)
 Calculates the position of the geometry that starts in geometry.start_point and extends length distance. More...
 
template double GetDistanceBetweenFunctions< ElevationProfile::Elevation > (const ElevationProfile::Elevation &lhs, const ElevationProfile::Elevation &rhs)
 
template double GetDistanceBetweenFunctions< LateralProfile::Superelevation > (const LateralProfile::Superelevation &lhs, const LateralProfile::Superelevation &rhs)
 
std::string unit_to_str (Unit unit)
 Matches string with a Unit. More...
 
Unit str_to_unit (const std::string &unit)
 Matches Unit with a string. More...
 
double ConvertToMs (double value, Unit unit)
 Convert to meters per second. More...
 
std::string XodrExtract (tinyxml2::XMLDocument *xodr_doc, const std::vector< std::string > &road_ids, bool update_linkage)
 Extracts Roads out of a XODR file and creates a new XODR description. More...
 

Enumeration Type Documentation

◆ Unit

enum Unit
strong

Enumerates the units allowed in the XODR description.

Enumerator
kMs 
kMph 
kKph 

Function Documentation

◆ ComputeEndpointWithNewLength()

maliput::math::Vector2 ComputeEndpointWithNewLength ( const Geometry geometry,
double  length 
)

Calculates the position of the geometry that starts in geometry.start_point and extends length distance.

Parameters
geometryA Geometry to evaluate its endpoint. Its type must be a valid Geometry::Type.
lengthA positive distance to evaluate geometry's endpoint.
Returns
The position of the endpoint.
Exceptions
maliput::common::assertion_errorWhen tolerance is not positive.
maliput::common::assertion_errorWhen geometry.type is neither Geometry::Type::kLine nor Geometry::Type::kArc.

◆ ConvertToMs()

double ConvertToMs ( double  value,
Unit  unit 
)

Convert to meters per second.

Parameters
valueIs the number to be converted.
unitIs the unit of value.
Returns
The equivalent in meters per second.
Exceptions
maliput::common::assertion_errorWhen unit isn't Unit::kMs, Unit::kMph or Unit::kph.

◆ ConvertXMLNodeToText()

std::string ConvertXMLNodeToText ( tinyxml2::XMLElement *  element)

Convert all the content of the XML node into text.

Parameters
elementIs the XML Node.
Returns
A string with the XML description.
Exceptions
maliput::common::assertion_errorWhen element is nullptr.

◆ GetDistanceBetweenFunctions()

double GetDistanceBetweenFunctions ( const XodrFunction &  lhs,
const XodrFunction &  rhs 
)

Computes the distance between the images of lhs and rhs polynomials.

Parameters
lhsLeft hand polynomial to evaluate on rhs.s_0.
rhsRight hand polynomial to evaluate on rhs.s_0.
Returns
The absolute difference between the two polynomial images.
Template Parameters
XodrFunctionOne of the Xodr cubic polynomial images:

◆ GetDistanceBetweenFunctions< ElevationProfile::Elevation >()

◆ GetDistanceBetweenFunctions< LateralProfile::Superelevation >()

◆ GetDistanceBetweenGeometries()

double GetDistanceBetweenGeometries ( const Geometry lhs,
const Geometry rhs 
)

Calculates the Euclidean distance between the endpoint of lhs and the startpoint of rhs.

Parameters
lhsGeometry that connects with its endpoint to next Geometry.
rhsGeometry that connects with its startpoint to previous Geometry.
Returns
The Euclidean distance.
Exceptions
maliput::common::assertion_errorWhen lhs.type is neither Geometry::Type::kLine nor Geometry::Type::kArc.

◆ LoadDataBaseFromFile()

std::unique_ptr< DBManager > LoadDataBaseFromFile ( const std::string &  filepath,
const ParserConfiguration parser_configuration 
)

Loads a XODR description from a file.

Parameters
filepathFilepath to the XODR file.
parser_configurationHolds the configuration for the parser.
Returns
A DBManager.
Exceptions
maliput::common::assertion_errorWhen XODR description couldn't be correctly loaded.

◆ LoadDataBaseFromStr()

std::unique_ptr< DBManager > LoadDataBaseFromStr ( const std::string &  xodr_str,
const ParserConfiguration parser_configuration 
)

Loads a XODR description from a string.

Parameters
xodr_strString containing the XODR description.
parser_configurationHolds the configuration for the parser.
Returns
A DBManager.
Exceptions
maliput::common::assertion_errorWhen XODR description couldn't be correctly loaded.

◆ operator<<() [1/4]

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

◆ operator<<() [2/4]

std::ostream & operator<< ( std::ostream &  out,
const Header header 
)

Streams a string representation of header into out.

Returns out. This method is provided for the purposes of debugging or text-logging. It is not intended for serialization.

◆ operator<<() [3/4]

std::ostream & operator<< ( std::ostream &  out,
const Junction junction 
)

Streams a string representation of junction into out.

Returns out. This method is provided for the purposes of debugging or text-logging. It is not intended for serialization.

◆ operator<<() [4/4]

std::ostream & operator<< ( std::ostream &  out,
const RoadHeader road_header 
)

Streams a string representation of road_header into out.

Returns out. This method is provided for the purposes of debugging or text-logging. It is not intended for serialization.

◆ str_to_unit()

Unit str_to_unit ( const std::string &  unit)

Matches Unit with a string.

Parameters
unitIs a string.
Returns
A Unit that matches with unit.
Exceptions
maliput::common::assertion_errorWhen unit doesn't match with a Unit.

◆ unit_to_str()

std::string unit_to_str ( Unit  unit)

Matches string with a Unit.

Parameters
unitIs a Unit.
Returns
A string that matches with unit.

◆ XodrExtract()

std::string XodrExtract ( tinyxml2::XMLDocument *  xodr_doc,
const std::vector< std::string > &  road_ids,
bool  update_linkage 
)

Extracts Roads out of a XODR file and creates a new XODR description.

  • Default header file with minimum information will be used.
  • Roads that aren't found will be skipped with the correspondant logging message.
  • Road linkage and junction value information can be updated depending on update_linkage argument.
    Parameters
    xodr_docXMLDocument pointer with a parsed XODR file.
    road_idsCollection of road ids that are wanted to be extracted.
    update_linkageTrue if predecessor,successor nodes and the junction id of the of the Roads should be updated by removing them. Otherwise those nodes won't be modified.
    Returns
    A XODR description with the selected Road ids.
    Exceptions
    maliput::common::assertion_errorWhen the XML file contained in xodr_doc isn't a XODR file.
    maliput::common::assertion_errorWhen XODR file's roads doesn't have 'id' attributes.
    maliput::common::assertion_errorWhen road_ids is empty.