maliput_malidrive
DBManager Class Reference

Detailed Description

Database Manager in charge of:

  • loading the XODR file (XML format).
  • parsing the XML nodes into known structures.
  • providing XODR data.

The common workflow is to: 1 - Construct a DBManager object using the provided methods. std::unique_ptr<xodr::DBManager> manager = xodr::LoadDataBaseFromFile(<path_to_xodr_file>)

See also
LoadDataBaseFromFile LoadDataBaseFromStr. 2 - Query the data base, e.g.: manager->GetRoadHeaders();

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

Classes

struct  XodrGapBetweenFunctions
 Holds gap between cubic polynomials of a specific feature of the road such as elevation and superelevation. More...
 
struct  XodrGapBetweenGeometries
 Holds gap between Geometries related information. More...
 
struct  XodrGeometriesToSimplify
 Defines a structure that informs which actions can be performed to simplify the map geometry description. More...
 
struct  XodrGeometryLengthData
 Holds Geometry related information: More...
 
struct  XodrLaneSectionLengthData
 Holds LaneSection related information: More...
 

Public Member Functions

 MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN (DBManager)
 
 DBManager (tinyxml2::XMLDocument *xodr_doc, const ParserConfiguration &parser_configuration)
 Creates a database manager from a XMLDocument which contains a XODR description. More...
 
 DBManager ()=delete
 
 ~DBManager ()
 
const HeaderGetXodrHeader () const
 
const std::map< RoadHeader::Id, RoadHeader > & GetRoadHeaders () const
 
const std::unordered_map< Junction::Id, Junction > & GetJunctions () const
 
const std::vector< XodrGeometriesToSimplifyGetGeometriesToSimplify (double tolerance) const
 Analyses all the RoadHeaders' geometries looking for pieces that can be unified or merged together into a simpler description. More...
 
const XodrGeometryLengthDataGetShortestGeometry () const
 Xodr geometry introspection queries. More...
 
const XodrGeometryLengthDataGetLargestGeometry () const
 
const XodrLaneSectionLengthDataGetShortestLaneSection () const
 
const XodrLaneSectionLengthDataGetLargestLaneSection () const
 
const XodrGapBetweenGeometriesGetShortestGap () const
 Get the shortest gap between Geometries. More...
 
const XodrGapBetweenGeometriesGetLargestGap () const
 Get the largest gap between Geometries. More...
 
const XodrGapBetweenFunctionsGetShortestElevationGap () const
 Get the shortest gap between elevations. More...
 
const XodrGapBetweenFunctionsGetLargestElevationGap () const
 Get the largest gap between elevations. More...
 
const XodrGapBetweenFunctionsGetShortestSuperelevationGap () const
 Get the shortest gap between superelevations. More...
 
const XodrGapBetweenFunctionsGetLargestSuperelevationGap () const
 Get the largest gap between superelevations. More...
 

Constructor & Destructor Documentation

◆ DBManager() [1/2]

DBManager ( tinyxml2::XMLDocument *  xodr_doc,
const ParserConfiguration parser_configuration 
)

Creates a database manager from a XMLDocument which contains a XODR description.

Parameters
xodr_docContains the XODR description.
parser_configurationHolds the configuration for the parser.
Exceptions
maliput::common::assertion_errorWhen xodr_doc is nullptr.
maliput::common::assertion_errorWhen parser_configuration.tolerance is negative.

◆ DBManager() [2/2]

DBManager ( )
delete

◆ ~DBManager()

~DBManager ( )
default

Member Function Documentation

◆ GetGeometriesToSimplify()

const std::vector< DBManager::XodrGeometriesToSimplify > GetGeometriesToSimplify ( double  tolerance) const

Analyses all the RoadHeaders' geometries looking for pieces that can be unified or merged together into a simpler description.

Candidate geometries to be merged should meet one of the following conditions:

  • Two or more consecutive lines that share the same heading and are contiguous.
  • Two or more consecutive arcs that share the same curvature and are contiguous.
  • Two or more consecutive geometries are shorter than tolerance.
Parameters
toleranceThreshold that defines when whether two geometries are simplified when their accumulated length is below this value. It must be non negative. When it is zero, two consecutive geometries will not be simplified because of length.
Returns
A dictionary of RoadHeader::Id to a vector of vectors of indices of geometries. Indices that are grouped together are contiguous and given that there might be more than one group per RoadHeader::Id we have a vector of vectors.
Exceptions
maliput::common::assertion::errorWhen tolerance is negative.

◆ GetJunctions()

const std::unordered_map< Junction::Id, Junction > & GetJunctions ( ) const
Returns
A xodr::Junction map which contains all the junction information about the XODR description.

◆ GetLargestElevationGap()

const DBManager::XodrGapBetweenFunctions & GetLargestElevationGap ( ) const

Get the largest gap between elevations.

DBManager extracts this information from the XODR only the first time that either this or GetShortestElevationGap() methods are called. Results are stored to be consulted as many times as needed but without carrying out the analysis more than once in order to avoid performance drop.

Returns
Data from the largest gap between elevations in the entire XODR description. When RoadHeaderId is "none" it means there are no possible gaps to be analyzed: roads only have one or none elevations.

◆ GetLargestGap()

const DBManager::XodrGapBetweenGeometries & GetLargestGap ( ) const

Get the largest gap between Geometries.

DBManager extracts this information from the XODR only the first time that either this or 'GetShortestGap()' methods are called. Results are stored to be consulted as many times as needed but without carrying out the analysis more than once in order to avoid performance drop.

Returns
Data from the largest gap between Geometries in the entire XODR description. When RoadHeaderId is "none" it means there are no possible gaps to be analyzed: Roads only have one Geometry.

◆ GetLargestGeometry()

const DBManager::XodrGeometryLengthData & GetLargestGeometry ( ) const
Returns
Data from the largest Geometry in the entire XODR description.

◆ GetLargestLaneSection()

const DBManager::XodrLaneSectionLengthData & GetLargestLaneSection ( ) const
Returns
Data from the largest LaneSection in the entire XODR description.

◆ GetLargestSuperelevationGap()

const DBManager::XodrGapBetweenFunctions & GetLargestSuperelevationGap ( ) const

Get the largest gap between superelevations.

DBManager extracts this information from the XODR only the first time that either this or GetShortestSuperelevationGap() methods are called. Results are stored to be consulted as many times as needed but without carrying out the analysis more than once in order to avoid performance drop.

Returns
Data from the largest gap between superelevations in the entire XODR description. When RoadHeaderId is "none" it means there are no possible gaps to be analyzed: roads only have one or none superelevations.

◆ GetRoadHeaders()

const std::map< RoadHeader::Id, RoadHeader > & GetRoadHeaders ( ) const
Returns
A xodr::RoadHeader map which contains all the road information about the XODR description.

◆ GetShortestElevationGap()

const DBManager::XodrGapBetweenFunctions & GetShortestElevationGap ( ) const

Get the shortest gap between elevations.

DBManager extracts this information from the XODR only the first time that either this or GetLargestElevationGap() methods are called. Results are stored to be consulted as many times as needed but without carrying out the analysis more than once in order to avoid performance drop.

Returns
Data from the shortest gap between elevations in the entire XODR description. When RoadHeaderId is "none" it means there are no possible gaps to be analyzed: roads only have one or none elevations.

◆ GetShortestGap()

const DBManager::XodrGapBetweenGeometries & GetShortestGap ( ) const

Get the shortest gap between Geometries.

DBManager extracts this information from the XODR only the first time that either this or GetLargestGap() methods are called. Results are stored to be consulted as many times as needed but without carrying out the analysis more than once in order to avoid performance drop.

Returns
Data from the shortest gap between Geometries in the entire XODR description. When RoadHeaderId is "none" it means there are no possible gaps to be analyzed: Roads only have one Geometry.

◆ GetShortestGeometry()

const DBManager::XodrGeometryLengthData & GetShortestGeometry ( ) const

Xodr geometry introspection queries.

Returns
Data from the shortest Geometry in the entire XODR description.

◆ GetShortestLaneSection()

const DBManager::XodrLaneSectionLengthData & GetShortestLaneSection ( ) const
Returns
Data from the shortest LaneSection in the entire XODR description.

◆ GetShortestSuperelevationGap()

const DBManager::XodrGapBetweenFunctions & GetShortestSuperelevationGap ( ) const

Get the shortest gap between superelevations.

DBManager extracts this information from the XODR only the first time that either this or GetLargestSuperelevationGap() methods are called. Results are stored to be consulted as many times as needed but without carrying out the analysis more than once in order to avoid performance drop.

Returns
Data from the shortest gap between superelevations in the entire XODR description. When RoadHeaderId is "none" it means there are no possible gaps to be analyzed: roads only have one or none superelevations.

◆ GetXodrHeader()

const Header & GetXodrHeader ( ) const
Returns
A xodr::Header which contains general information about the XODR description.

◆ MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN ( DBManager  )

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