Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
lanelet::routing::RoutingGraph Class Reference

Main class of the routing module that holds routing information and can be queried. The RoutingGraph class is the central object of this module and is initialized with a LaneletMap, TrafficRules and RoutingCost. A routing graph with all interesting relations will be created for the traffic participant featured in the provided TrafficRules module. Routing costs will be calculated for each provided module. The routing graph can answer queries like "left", "following", "conflicting" lanelets, but also provide a shortest route or a Route. More...

#include <RoutingGraph.h>

Public Types

using Configuration = std::map< std::string, Attribute >
 
using Errors = std::vector< std::string >
 For the checkValidity function. More...
 

Public Member Functions

Optional< ConstLaneletadjacentLeft (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get adjacent left (non-routable) lanelet of a given lanelet if it exists. More...
 
ConstLanelets adjacentLefts (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get all adjacent left (non-routable) lanelets of a given lanelet if they exist. More...
 
Optional< ConstLaneletadjacentRight (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get adjacent right (non-routable) lanelet of a given lanelet if it exists. More...
 
ConstLanelets adjacentRights (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get all adjacent right (non-routable) lanelets of a given lanelet if they exist. More...
 
ConstLanelets besides (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Retrieve all reachable left and right lanelets. More...
 
Errors checkValidity (bool throwOnError=true) const
 Performs some basic sanity checks. It is recommended to call this function after the routing graph has been generated since it can point out some mapping errors. More...
 
ConstLaneletOrAreas conflicting (const ConstLaneletOrArea &laneletOrArea) const
 Retrieve all lanelets that are conflicting with the given lanelet. More...
 
void exportGraphML (const std::string &filename, const RelationType &edgeTypesToExclude=RelationType::None, RoutingCostId routingCostId={}) const
 Export the internal graph to graphML (xml-based) file format. More...
 
void exportGraphViz (const std::string &filename, const RelationType &edgeTypesToExclude=RelationType::None, RoutingCostId routingCostId={}) const
 Export the internal graph to graphViz (DOT) file format. This format includes coloring of the edges in the graph and bears little more information than graphML export. More...
 
ConstLanelets following (const ConstLanelet &lanelet, bool withLaneChanges=false) const
 Returns the lanelets that can be reached from this lanelet. More...
 
LaneletRelations followingRelations (const ConstLanelet &lanelet, bool withLaneChanges=false) const
 Returns the lanelets that can be reached from this lanelet and the relation. More...
 
void forEachPredecessor (const ConstLanelet &lanelet, const LaneletVisitFunction &f, bool allowLaneChanges=true, RoutingCostId routingCostId={}) const
 
void forEachPredecessorIncludingAreas (const ConstLaneletOrArea &lanelet, const LaneletOrAreaVisitFunction &f, bool allowLaneChanges=true, RoutingCostId routingCostId={}) const
 Similar to RoutingGraph::forEachPredecessor but also includes areas into the search. More...
 
void forEachSuccessor (const ConstLanelet &lanelet, const LaneletVisitFunction &f, bool allowLaneChanges=true, RoutingCostId routingCostId={}) const
 Calls a function on every successor of lanelet, optionally including lane changes. More...
 
void forEachSuccessorIncludingAreas (const ConstLaneletOrArea &lanelet, const LaneletOrAreaVisitFunction &f, bool allowLaneChanges=true, RoutingCostId routingCostId={}) const
 Similar to RoutingGraph::forEachSuccessor but also includes areas into the search. More...
 
LaneletMapPtr getDebugLaneletMap (RoutingCostId routingCostId={}, bool includeAdjacent=false, bool includeConflicting=false) const
 An abstract lanelet map holding the information of the routing graph. A good way to view the routing graph since it can be exported using the lanelet2_io module and there can be viewed in tools like JOSM. Each lanelet is represented by a point at the center of gravity of the lanelet. Relations are linestrings between points representing lanelets. More...
 
Optional< RoutegetRoute (const ConstLanelet &from, const ConstLanelet &to, RoutingCostId routingCostId={}, bool withLaneChanges=true) const
 Get a driving route from 'start' to 'end' lanelet. More...
 
Optional< RoutegetRouteVia (const ConstLanelet &from, const ConstLanelets &via, const ConstLanelet &to, RoutingCostId routingCostId={}, bool withLaneChanges=true) const
 Get a driving route from 'start' to 'end' lanelets while going via other lanelets. More...
 
Optional< ConstLaneletleft (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get left (routable) lanelet of a given lanelet if it exists. More...
 
LaneletRelations leftRelations (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Retrieve all lanelets and relations left of a given lanelet. More...
 
ConstLanelets lefts (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get all left (routable) lanelets of a given lanelet if they exist. More...
 
RoutingGraphoperator= (const RoutingGraph &)=delete
 
RoutingGraphoperator= (RoutingGraph &&) noexcept
 
LaneletMapConstPtr passableMap () const noexcept
 LaneletSubmap that includes all passable lanelets and areas. This map contains all passable lanelets and areas with all primitives (linestrings, points), including regulatory elements and lanelets referenced by them. It can be used to perform spacial queries e.g. for localization. When selecting a lanelet from this map please be aware that the routing graph may also contain the inverted lanelet. More...
 
LaneletSubmapConstPtr passableSubmap () const noexcept
 Returns a submap that contains all lanelets and areas within this routing graph, and nothing else. You can obtain a full map of the routing graph by calling passabelSubmap()->laneletMap(), which ist a potentially costly operation. More...
 
LaneletPaths possiblePaths (const ConstLanelet &startPoint, const PossiblePathsParams &params) const
 Determines possible routes from a given start lanelet that satisfy the configuration in PossiblePathsParams. More...
 
LaneletPaths possiblePaths (const ConstLanelet &startPoint, double minRoutingCost, RoutingCostId routingCostId={}, bool allowLaneChanges=false) const
 Determines possible routes from a given start lanelet that are "minRoutingCost"-long. More...
 
LaneletPaths possiblePaths (const ConstLanelet &startPoint, uint32_t minLanelets, bool allowLaneChanges=false, RoutingCostId routingCostId={}) const
 Determines possible paths from a given start lanelet that are "minLanelets"-long. More...
 
LaneletOrAreaPaths possiblePathsIncludingAreas (const ConstLaneletOrArea &startPoint, const PossiblePathsParams &params) const
 Similar to RoutingGraph::possiblePaths, but also considers areas. More...
 
LaneletOrAreaPaths possiblePathsIncludingAreas (const ConstLaneletOrArea &startPoint, double minRoutingCost, RoutingCostId routingCostId={}, bool allowLaneChanges=false) const
 Similar to RoutingGraph::possiblePaths, but also considers areas. More...
 
LaneletOrAreaPaths possiblePathsIncludingAreas (const ConstLaneletOrArea &startPoint, uint32_t minElements, bool allowLaneChanges=false, RoutingCostId routingCostId={}) const
 Similar to RoutingGraph::possiblePaths, but also considers areas. More...
 
LaneletPaths possiblePathsTowards (const ConstLanelet &targetLanelet, const PossiblePathsParams &params) const
 Determines possible routes to reach the given lanelet which satisfy the configuration in PossiblePathsParams. More...
 
LaneletPaths possiblePathsTowards (const ConstLanelet &targetLanelet, double minRoutingCost, RoutingCostId routingCostId={}, bool allowLaneChanges=false) const
 Determines possible routes that reach the given lanelet and are "minRoutingCost" long. More...
 
LaneletPaths possiblePathsTowards (const ConstLanelet &targetLanelet, uint32_t minLanelets, bool allowLaneChanges=false, RoutingCostId routingCostId={}) const
 Determines possible paths towards a destination lanelet that are "minLanelets"-long. More...
 
ConstLanelets previous (const ConstLanelet &lanelet, bool withLaneChanges=false) const
 Returns the possible previous lanelets of this lanelet. More...
 
LaneletRelations previousRelations (const ConstLanelet &lanelet, bool withLaneChanges=false) const
 Returns the possible previous lanelets of this lanelet and the relation. More...
 
ConstLanelets reachableSet (const ConstLanelet &lanelet, double maxRoutingCost, RoutingCostId routingCostId={}, bool allowLaneChanges=true) const
 Retrieve a set of lanelets that can be reached from a given lanelet. More...
 
ConstLaneletOrAreas reachableSetIncludingAreas (const ConstLaneletOrArea &llOrAr, double maxRoutingCost, RoutingCostId routingCostId={}) const
 Retrieve set of lanelet or areas that are reachable without exceeding routing cost. More...
 
ConstLanelets reachableSetTowards (const ConstLanelet &lanelet, double maxRoutingCost, RoutingCostId routingCostId={}, bool allowLaneChanges=true) const
 Retrieve a set of lanelets that can reach a given lanelet. More...
 
Optional< ConstLaneletright (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get right (routable) lanelet of a given lanelet if it exists. More...
 
LaneletRelations rightRelations (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Retrieve all lanelets and relations right of a given lanelet. More...
 
ConstLanelets rights (const ConstLanelet &lanelet, RoutingCostId routingCostId={}) const
 Get all right (routable) lanelets of a given lanelet if they exist. More...
 
 RoutingGraph ()=delete
 The graph can not be copied, only moved. More...
 
 RoutingGraph (const RoutingGraph &)=delete
 
 RoutingGraph (RoutingGraph &&) noexcept
 
 RoutingGraph (std::unique_ptr< internal::RoutingGraphGraph > &&graph, lanelet::LaneletSubmapConstPtr &&passableMap)
 
Optional< RelationTyperoutingRelation (const ConstLanelet &from, const ConstLanelet &to, bool includeConflicting=false) const
 Determines the relation between two lanelets. More...
 
Optional< LaneletPathshortestPath (const ConstLanelet &from, const ConstLanelet &to, RoutingCostId routingCostId={}, bool withLaneChanges=true) const
 Retrieve a shortest path between 'start' and 'end'. More...
 
Optional< LaneletOrAreaPathshortestPathIncludingAreas (const ConstLaneletOrArea &from, const ConstLaneletOrArea &to, RoutingCostId routingCostId={}, bool withLaneChanges=true) const
 Retrieve a shortest path between 'start' and 'end' that may contain Areas. More...
 
Optional< LaneletOrAreaPathshortestPathIncludingAreasVia (const ConstLaneletOrArea &start, const ConstLaneletOrAreas &via, const ConstLaneletOrArea &end, RoutingCostId routingCostId={}, bool withLaneChanges=true) const
 Retrieve a shortest path between 'start' and 'end' using intermediate points. Will find a shortest path using Djikstra's shortest path algorithm and the routing cost calculated by the routing cost module with the respective ID. Be aware that the shortest path may contain lane changes, i.e. lanelets that are parallel and not only adjacent. More...
 
Optional< LaneletPathshortestPathVia (const ConstLanelet &start, const ConstLanelets &via, const ConstLanelet &end, RoutingCostId routingCostId={}, bool withLaneChanges=true) const
 Retrieve a shortest path between 'start' and 'end' using intermediate points. Will find a shortest path using Djikstra's shortest path algorithm and the routing cost calculated by the routing cost module with the respective ID. Be aware that the shortest path may contain lane changes, i.e. lanelets that are parallel and not only adjacent. More...
 
 ~RoutingGraph ()
 

Static Public Member Functions

static RoutingGraphUPtr build (const LaneletMap &laneletMap, const traffic_rules::TrafficRules &trafficRules, const RoutingCostPtrs &routingCosts=defaultRoutingCosts(), const Configuration &config=Configuration())
 Main constructor with optional configuration. More...
 
static RoutingGraphUPtr build (const LaneletSubmap &laneletSubmap, const traffic_rules::TrafficRules &trafficRules, const RoutingCostPtrs &routingCosts=defaultRoutingCosts(), const Configuration &config=Configuration())
 Similar to the above but for a LaneletSubmap. More...
 

Static Public Attributes

static constexpr const char ParticipantHeight [] = "participant_height"
 Defined configuration attributes. More...
 

Private Attributes

std::unique_ptr< internal::RoutingGraphGraphgraph_
 Documentation to be found in the cpp file. More...
 
LaneletSubmapConstPtr passableLaneletSubmap_
 Lanelet map of all passable lanelets. More...
 

Detailed Description

Main class of the routing module that holds routing information and can be queried. The RoutingGraph class is the central object of this module and is initialized with a LaneletMap, TrafficRules and RoutingCost. A routing graph with all interesting relations will be created for the traffic participant featured in the provided TrafficRules module. Routing costs will be calculated for each provided module. The routing graph can answer queries like "left", "following", "conflicting" lanelets, but also provide a shortest route or a Route.

Note
The direction of lanelets matters! 'lanelet' and 'lanelet.invert()' are differentiated since this matters when lanelets are passable in both directions.
'adjacent_left' and 'adjacent_right' means that there is a passable lanelet left/right of another passable lanelet, but a lane change is not allowed.

Definition at line 69 of file RoutingGraph.h.

Member Typedef Documentation

◆ Configuration

Used to provide a configuration

Definition at line 72 of file RoutingGraph.h.

◆ Errors

using lanelet::routing::RoutingGraph::Errors = std::vector<std::string>

For the checkValidity function.

Definition at line 71 of file RoutingGraph.h.

Constructor & Destructor Documentation

◆ RoutingGraph() [1/4]

lanelet::routing::RoutingGraph::RoutingGraph ( )
delete

The graph can not be copied, only moved.

◆ RoutingGraph() [2/4]

lanelet::routing::RoutingGraph::RoutingGraph ( const RoutingGraph )
delete

◆ RoutingGraph() [3/4]

lanelet::routing::RoutingGraph::RoutingGraph ( RoutingGraph &&  )
defaultnoexcept

◆ ~RoutingGraph()

lanelet::routing::RoutingGraph::~RoutingGraph ( )
default

◆ RoutingGraph() [4/4]

lanelet::routing::RoutingGraph::RoutingGraph ( std::unique_ptr< internal::RoutingGraphGraph > &&  graph,
lanelet::LaneletSubmapConstPtr &&  passableMap 
)

Constructs the routing graph. Don't call this directly, use RoutingGraph::build instead.

Member Function Documentation

◆ adjacentLeft()

Optional< ConstLanelet > lanelet::routing::RoutingGraph::adjacentLeft ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get adjacent left (non-routable) lanelet of a given lanelet if it exists.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Adjacent left lanelet if it exists. Nothing if it doesn't.
See also
left, lefts, adjacentLefts

Definition at line 497 of file RoutingGraph.cpp.

◆ adjacentLefts()

ConstLanelets lanelet::routing::RoutingGraph::adjacentLefts ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get all adjacent left (non-routable) lanelets of a given lanelet if they exist.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Adjacent left lanelets if they exists. Empty if they don't.
See also
adjacentLeft, left, lefts

Definition at line 518 of file RoutingGraph.cpp.

◆ adjacentRight()

Optional< ConstLanelet > lanelet::routing::RoutingGraph::adjacentRight ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get adjacent right (non-routable) lanelet of a given lanelet if it exists.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Adjacent right lanelet if it exists. Nothing if it doesn't.
See also
right, rights, adjacentRights

Definition at line 508 of file RoutingGraph.cpp.

◆ adjacentRights()

ConstLanelets lanelet::routing::RoutingGraph::adjacentRights ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get all adjacent right (non-routable) lanelets of a given lanelet if they exist.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Adjacent right lanelets if they exists. Empty if they don't.
See also
adjacentRight, right, rights

Definition at line 546 of file RoutingGraph.cpp.

◆ besides()

ConstLanelets lanelet::routing::RoutingGraph::besides ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Retrieve all reachable left and right lanelets.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
All left and right lanelets that can be reached, including lanelet, ordered left to right.

Definition at line 480 of file RoutingGraph.cpp.

◆ build() [1/2]

RoutingGraphUPtr lanelet::routing::RoutingGraph::build ( const LaneletMap laneletMap,
const traffic_rules::TrafficRules trafficRules,
const RoutingCostPtrs routingCosts = defaultRoutingCosts(),
const Configuration config = Configuration() 
)
static

Main constructor with optional configuration.

Parameters
laneletMapMap that should be used to build the graph
trafficRulesTraffic rules that apply to find passable lanelets
routingCostsOne or more ways to calculate routing costs
configOptional configuration

Definition at line 375 of file RoutingGraph.cpp.

◆ build() [2/2]

RoutingGraphUPtr lanelet::routing::RoutingGraph::build ( const LaneletSubmap laneletSubmap,
const traffic_rules::TrafficRules trafficRules,
const RoutingCostPtrs routingCosts = defaultRoutingCosts(),
const Configuration config = Configuration() 
)
static

Similar to the above but for a LaneletSubmap.

Definition at line 380 of file RoutingGraph.cpp.

◆ checkValidity()

RoutingGraph::Errors lanelet::routing::RoutingGraph::checkValidity ( bool  throwOnError = true) const

Performs some basic sanity checks. It is recommended to call this function after the routing graph has been generated since it can point out some mapping errors.

Exceptions
RoutingGraphErrorif an error is found an 'throwOnError' is true
Parameters
throwOnErrorDecide wheter to throw an exception or just return the errors
Returns
Possible errors if 'throwOnError' is false.

Definition at line 855 of file RoutingGraph.cpp.

◆ conflicting()

ConstLaneletOrAreas lanelet::routing::RoutingGraph::conflicting ( const ConstLaneletOrArea laneletOrArea) const

Retrieve all lanelets that are conflicting with the given lanelet.

Conflicting means that their bounding boxes overlap and the height clearance is smaller than the specified "participant_height".

Parameters
laneletOrAreaLanelet/Area to get conflicting lanelets for.
Returns
All conflicting lanelets.

Definition at line 570 of file RoutingGraph.cpp.

◆ exportGraphML()

void lanelet::routing::RoutingGraph::exportGraphML ( const std::string &  filename,
const RelationType edgeTypesToExclude = RelationType::None,
RoutingCostId  routingCostId = {} 
) const

Export the internal graph to graphML (xml-based) file format.

Parameters
filenameFully qualified file name - ideally with extension (.graphml)
edgeTypesToExcludeExclude the specified relations. E.g. conflicting. Combine them with "|".
routingCostIdID of the routing cost module
See also
exportGraphViz

Definition at line 736 of file RoutingGraph.cpp.

◆ exportGraphViz()

void lanelet::routing::RoutingGraph::exportGraphViz ( const std::string &  filename,
const RelationType edgeTypesToExclude = RelationType::None,
RoutingCostId  routingCostId = {} 
) const

Export the internal graph to graphViz (DOT) file format. This format includes coloring of the edges in the graph and bears little more information than graphML export.

Parameters
filenameFully qualified file name - ideally with extension (.gv)
edgeTypesToExcludeExclude the specified relations. E.g. conflicting. Combine them with "|".
routingCostIdID of the routing cost module

Definition at line 748 of file RoutingGraph.cpp.

◆ following()

ConstLanelets lanelet::routing::RoutingGraph::following ( const ConstLanelet lanelet,
bool  withLaneChanges = false 
) const

Returns the lanelets that can be reached from this lanelet.

Parameters
laneletStart lanelet
withLaneChangesInclude left and right lanes or not
Returns
Lanelets that can be directly reached
See also
followingRelations

Definition at line 446 of file RoutingGraph.cpp.

◆ followingRelations()

LaneletRelations lanelet::routing::RoutingGraph::followingRelations ( const ConstLanelet lanelet,
bool  withLaneChanges = false 
) const

Returns the lanelets that can be reached from this lanelet and the relation.

Parameters
laneletStart lanelet
withLaneChangesInclude left and right lanes or not
Returns
Lanelets can be directly reached
See also
following

Definition at line 451 of file RoutingGraph.cpp.

◆ forEachPredecessor()

void lanelet::routing::RoutingGraph::forEachPredecessor ( const ConstLanelet lanelet,
const LaneletVisitFunction f,
bool  allowLaneChanges = true,
RoutingCostId  routingCostId = {} 
) const

Similar to RoutingGraph::forEachSuccessor but goes backwards in the routing graph instead of forward. The LaneletVisitInformation::cost will still be positive, despite going backwards.

Definition at line 702 of file RoutingGraph.cpp.

◆ forEachPredecessorIncludingAreas()

void lanelet::routing::RoutingGraph::forEachPredecessorIncludingAreas ( const ConstLaneletOrArea lanelet,
const LaneletOrAreaVisitFunction f,
bool  allowLaneChanges = true,
RoutingCostId  routingCostId = {} 
) const

Similar to RoutingGraph::forEachPredecessor but also includes areas into the search.

Definition at line 718 of file RoutingGraph.cpp.

◆ forEachSuccessor()

void lanelet::routing::RoutingGraph::forEachSuccessor ( const ConstLanelet lanelet,
const LaneletVisitFunction f,
bool  allowLaneChanges = true,
RoutingCostId  routingCostId = {} 
) const

Calls a function on every successor of lanelet, optionally including lane changes.

This function can be used to query the routing graph on a more direct level. The function will be called on lanelets with monotonically increasing cost from the start lanelet, including the start lanelet itself. If the function returns "false" on an input, its followers will not be visited through this lanelet, as if it did not exist.

The search internally uses the dijkstra algorithm in order to discover the shortest path to the successors of this lanelet and calls the provided function once it is known.

In order to abort the query early, an exception can be thrown. If the lanelet is not part of the graph, nothing will be called.

Parameters
laneletthe lanelet where the search starts
fthe function to be called on lanelet and its successors
allowLaneChangesalso consider lane changes
routingCostIdid for the routing cost module that is used to calculate the shortest path

Definition at line 671 of file RoutingGraph.cpp.

◆ forEachSuccessorIncludingAreas()

void lanelet::routing::RoutingGraph::forEachSuccessorIncludingAreas ( const ConstLaneletOrArea lanelet,
const LaneletOrAreaVisitFunction f,
bool  allowLaneChanges = true,
RoutingCostId  routingCostId = {} 
) const

Similar to RoutingGraph::forEachSuccessor but also includes areas into the search.

Definition at line 685 of file RoutingGraph.cpp.

◆ getDebugLaneletMap()

LaneletMapPtr lanelet::routing::RoutingGraph::getDebugLaneletMap ( RoutingCostId  routingCostId = {},
bool  includeAdjacent = false,
bool  includeConflicting = false 
) const

An abstract lanelet map holding the information of the routing graph. A good way to view the routing graph since it can be exported using the lanelet2_io module and there can be viewed in tools like JOSM. Each lanelet is represented by a point at the center of gravity of the lanelet. Relations are linestrings between points representing lanelets.

Parameters
routingCostIdID of the routing cost module used for the cost assignment
includeAdjacentAlso include adjacent (non-routable) relations
includeConflictingAlso include conflicting relations
Returns
LaneletMap with the requested information

Definition at line 844 of file RoutingGraph.cpp.

◆ getRoute()

Optional< Route > lanelet::routing::RoutingGraph::getRoute ( const ConstLanelet from,
const ConstLanelet to,
RoutingCostId  routingCostId = {},
bool  withLaneChanges = true 
) const

Get a driving route from 'start' to 'end' lanelet.

Parameters
fromStart lanelet to find a shortest path
toEnd lanelet to find a shortest path
routingCostIdID of RoutingCost module to determine shortest route
withLaneChangesif false, the shortest path will not contain lane changes and the route will only contain lanelets that are reachable without lane changes
Returns
A route of all adjacent lanelets of the shortest route that lead to 'end'. Nothing if there's no route.
See also
Route

Definition at line 386 of file RoutingGraph.cpp.

◆ getRouteVia()

Optional< Route > lanelet::routing::RoutingGraph::getRouteVia ( const ConstLanelet from,
const ConstLanelets via,
const ConstLanelet to,
RoutingCostId  routingCostId = {},
bool  withLaneChanges = true 
) const

Get a driving route from 'start' to 'end' lanelets while going via other lanelets.

Parameters
fromStart lanelet to find a shortest path
viaOther lanelets to visit (in this order)
toEnd lanelet to find a shortest path
routingCostIdID of RoutingCost module to determine shortest route
withLaneChangesif false, the shortest path will not contain lane changes and the route will only contain lanelets that are reachable without lane changes
Returns
A route of all adjacent lanelets of the shortest route that lead to 'end'. Nothing if there's not route.

If from and to are the same lanelet, the resulting route will form a loop.

See also
Route

Definition at line 395 of file RoutingGraph.cpp.

◆ left()

Optional< ConstLanelet > lanelet::routing::RoutingGraph::left ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get left (routable) lanelet of a given lanelet if it exists.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Left lanelet if it exists. Nothing if it doesn't.
See also
adjacentLeft, lefts, adjacentLefts

Definition at line 492 of file RoutingGraph.cpp.

◆ leftRelations()

LaneletRelations lanelet::routing::RoutingGraph::leftRelations ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Retrieve all lanelets and relations left of a given lanelet.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
All lanelets and relations left of a given lanelet.
See also
lefts, adjacentLefts

Definition at line 522 of file RoutingGraph.cpp.

◆ lefts()

ConstLanelets lanelet::routing::RoutingGraph::lefts ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get all left (routable) lanelets of a given lanelet if they exist.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Left lanelets if they exists. Empty if they don't.
See also
adjacentLeft, left, adjacentLefts

Definition at line 514 of file RoutingGraph.cpp.

◆ operator=() [1/2]

RoutingGraph& lanelet::routing::RoutingGraph::operator= ( const RoutingGraph )
delete

◆ operator=() [2/2]

RoutingGraph & lanelet::routing::RoutingGraph::operator= ( RoutingGraph &&  )
defaultnoexcept

◆ passableMap()

LaneletMapConstPtr lanelet::routing::RoutingGraph::passableMap ( ) const
inlinenoexcept

LaneletSubmap that includes all passable lanelets and areas. This map contains all passable lanelets and areas with all primitives (linestrings, points), including regulatory elements and lanelets referenced by them. It can be used to perform spacial queries e.g. for localization. When selecting a lanelet from this map please be aware that the routing graph may also contain the inverted lanelet.

Returns
LaneletMap with all passable lanelets and areas

This function is deprecated because it was misleading that the map also contained lanelets referenced by regulatory elements and not only the lanelets from the routing graph.

Definition at line 476 of file RoutingGraph.h.

◆ passableSubmap()

LaneletSubmapConstPtr lanelet::routing::RoutingGraph::passableSubmap ( ) const
inlinenoexcept

Returns a submap that contains all lanelets and areas within this routing graph, and nothing else. You can obtain a full map of the routing graph by calling passabelSubmap()->laneletMap(), which ist a potentially costly operation.

Definition at line 463 of file RoutingGraph.h.

◆ possiblePaths() [1/3]

LaneletPaths lanelet::routing::RoutingGraph::possiblePaths ( const ConstLanelet startPoint,
const PossiblePathsParams params 
) const

Determines possible routes from a given start lanelet that satisfy the configuration in PossiblePathsParams.

Parameters
startPointStart lanelet
paramsParameters that configure the behaviour of the algorithm; see doc on PossiblePathsParams for details.
Returns
all valid possible paths. If a lanelet can be reached using different paths, only the one is included that requires the least number of lane changes and has minimum routing costs. "startPoint" itself is always included if it is in the routing graph.
Exceptions
InvalidInputErrorif neither elementLimit nor costLimit is valid in params

Definition at line 604 of file RoutingGraph.cpp.

◆ possiblePaths() [2/3]

LaneletPaths lanelet::routing::RoutingGraph::possiblePaths ( const ConstLanelet startPoint,
double  minRoutingCost,
RoutingCostId  routingCostId = {},
bool  allowLaneChanges = false 
) const

Determines possible routes from a given start lanelet that are "minRoutingCost"-long.

This behaves exactly as the PossiblePathsParams version with params.costLimit=minRoutingCost, params.includeLaneChanges=allowLaneChanges and params.routingCostId=routingCostId (and the rest as default).

Definition at line 614 of file RoutingGraph.cpp.

◆ possiblePaths() [3/3]

LaneletPaths lanelet::routing::RoutingGraph::possiblePaths ( const ConstLanelet startPoint,
uint32_t  minLanelets,
bool  allowLaneChanges = false,
RoutingCostId  routingCostId = {} 
) const

Determines possible paths from a given start lanelet that are "minLanelets"-long.

This behaves exactly as the PossiblePathsParams version with params.elementLimit=minLanelets, params.includeLaneChanges=allowLaneChanges and params.routingCostId=routingCostId (and the rest as default).

Definition at line 619 of file RoutingGraph.cpp.

◆ possiblePathsIncludingAreas() [1/3]

LaneletOrAreaPaths lanelet::routing::RoutingGraph::possiblePathsIncludingAreas ( const ConstLaneletOrArea startPoint,
const PossiblePathsParams params 
) const

Similar to RoutingGraph::possiblePaths, but also considers areas.

Definition at line 647 of file RoutingGraph.cpp.

◆ possiblePathsIncludingAreas() [2/3]

LaneletOrAreaPaths lanelet::routing::RoutingGraph::possiblePathsIncludingAreas ( const ConstLaneletOrArea startPoint,
double  minRoutingCost,
RoutingCostId  routingCostId = {},
bool  allowLaneChanges = false 
) const

Similar to RoutingGraph::possiblePaths, but also considers areas.

Definition at line 658 of file RoutingGraph.cpp.

◆ possiblePathsIncludingAreas() [3/3]

LaneletOrAreaPaths lanelet::routing::RoutingGraph::possiblePathsIncludingAreas ( const ConstLaneletOrArea startPoint,
uint32_t  minElements,
bool  allowLaneChanges = false,
RoutingCostId  routingCostId = {} 
) const

Similar to RoutingGraph::possiblePaths, but also considers areas.

Definition at line 665 of file RoutingGraph.cpp.

◆ possiblePathsTowards() [1/3]

LaneletPaths lanelet::routing::RoutingGraph::possiblePathsTowards ( const ConstLanelet targetLanelet,
const PossiblePathsParams params 
) const

Determines possible routes to reach the given lanelet which satisfy the configuration in PossiblePathsParams.

Returns
possible paths that are at least as long as specified in 'minRoutingCost'. "targetLanelet" itself is always included if it is in the routing graph.
Parameters
targetLaneletDestination lanelet
paramsParameters that configure the behaviour of the algorithm; see doc on PossiblePathsParams for details.
Exceptions
InvalidInputErrorif neither elementLimit nor costLimit is valid in params

Definition at line 624 of file RoutingGraph.cpp.

◆ possiblePathsTowards() [2/3]

LaneletPaths lanelet::routing::RoutingGraph::possiblePathsTowards ( const ConstLanelet targetLanelet,
double  minRoutingCost,
RoutingCostId  routingCostId = {},
bool  allowLaneChanges = false 
) const

Determines possible routes that reach the given lanelet and are "minRoutingCost" long.

This behaves exactly as the PossiblePathsParams version with params.costLimit=minRoutingCost, params.includeLaneChanges=allowLaneChanges and params.routingCostId=routingCostId (and the rest as default).

Definition at line 635 of file RoutingGraph.cpp.

◆ possiblePathsTowards() [3/3]

LaneletPaths lanelet::routing::RoutingGraph::possiblePathsTowards ( const ConstLanelet targetLanelet,
uint32_t  minLanelets,
bool  allowLaneChanges = false,
RoutingCostId  routingCostId = {} 
) const

Determines possible paths towards a destination lanelet that are "minLanelets"-long.

This behaves exactly as the PossiblePathsParams version with params.elementLimit=minLanelets, params.includeLaneChanges=allowLaneChanges and params.routingCostId=routingCostId (and the rest as default).

Definition at line 641 of file RoutingGraph.cpp.

◆ previous()

ConstLanelets lanelet::routing::RoutingGraph::previous ( const ConstLanelet lanelet,
bool  withLaneChanges = false 
) const

Returns the possible previous lanelets of this lanelet.

Parameters
laneletStart lanelet
withLaneChangesInclude left and right lanes or not
Returns
All previous lanelets
See also
previousRelations

Definition at line 460 of file RoutingGraph.cpp.

◆ previousRelations()

LaneletRelations lanelet::routing::RoutingGraph::previousRelations ( const ConstLanelet lanelet,
bool  withLaneChanges = false 
) const

Returns the possible previous lanelets of this lanelet and the relation.

Parameters
laneletStart lanelet
withLaneChangesInclude left and right lanes or not
Returns
Lanelets that could be used to reach this lanelet
See also
previous

Definition at line 465 of file RoutingGraph.cpp.

◆ reachableSet()

ConstLanelets lanelet::routing::RoutingGraph::reachableSet ( const ConstLanelet lanelet,
double  maxRoutingCost,
RoutingCostId  routingCostId = {},
bool  allowLaneChanges = true 
) const

Retrieve a set of lanelets that can be reached from a given lanelet.

Determines which lanelets can be reached from a give start lanelets within a given amount of routing cost.

Parameters
laneletStart lanelet
maxRoutingCostMaximum amount of routing cost allowed to reach other lanelets
routingCostIdID of the routing cost module used for routing cost.
allowLaneChangesAllow or forbid lane changes
Returns
all lanelets that are reachable in no particular orders. "lanelet" itself is always included.

Definition at line 574 of file RoutingGraph.cpp.

◆ reachableSetIncludingAreas()

ConstLaneletOrAreas lanelet::routing::RoutingGraph::reachableSetIncludingAreas ( const ConstLaneletOrArea llOrAr,
double  maxRoutingCost,
RoutingCostId  routingCostId = {} 
) const

Retrieve set of lanelet or areas that are reachable without exceeding routing cost.

Definition at line 584 of file RoutingGraph.cpp.

◆ reachableSetTowards()

ConstLanelets lanelet::routing::RoutingGraph::reachableSetTowards ( const ConstLanelet lanelet,
double  maxRoutingCost,
RoutingCostId  routingCostId = {},
bool  allowLaneChanges = true 
) const

Retrieve a set of lanelets that can reach a given lanelet.

Determines which reach the given lanelet with a given amount of routing cost.

Parameters
laneletdestination lanelet
maxRoutingCostMaximum amount of routing cost allowed to reach other lanelets
routingCostIdID of the routing cost module used for routing cost.
allowLaneChangesAllow or forbid lane changes
Returns
all lanelets in range in no particular order. "lanelet" itself is always included.

Definition at line 594 of file RoutingGraph.cpp.

◆ right()

Optional< ConstLanelet > lanelet::routing::RoutingGraph::right ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get right (routable) lanelet of a given lanelet if it exists.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Right lanelet if it exists. Nothing if it doesn't.
See also
adjacentRight, rights, adjacentRights

Definition at line 503 of file RoutingGraph.cpp.

◆ rightRelations()

LaneletRelations lanelet::routing::RoutingGraph::rightRelations ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Retrieve all lanelets and relations right of a given lanelet.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
All lanelets and relations right of a given lanelet.
See also
rights, adjacentRights

Definition at line 550 of file RoutingGraph.cpp.

◆ rights()

ConstLanelets lanelet::routing::RoutingGraph::rights ( const ConstLanelet lanelet,
RoutingCostId  routingCostId = {} 
) const

Get all right (routable) lanelets of a given lanelet if they exist.

Parameters
laneletStart lanelet
routingCostIdthe routing cost module to be used. Can make a difference if one allows a lane change but the other one doesn't.
Returns
Right lanelets if they exists. Empty if they don't.
See also
adjacentRight, right, adjacentRights

Definition at line 542 of file RoutingGraph.cpp.

◆ routingRelation()

Optional< RelationType > lanelet::routing::RoutingGraph::routingRelation ( const ConstLanelet from,
const ConstLanelet to,
bool  includeConflicting = false 
) const

Determines the relation between two lanelets.

Parameters
fromStart lanelet
toGoal lanelet
includeConflictingif false, conflicting lanelets are not considered as relations
Returns
Relation between the lanelets or nothing if no relation exists. Nothing if at least one of the lanelets is not passable.

Definition at line 436 of file RoutingGraph.cpp.

◆ shortestPath()

Optional< LaneletPath > lanelet::routing::RoutingGraph::shortestPath ( const ConstLanelet from,
const ConstLanelet to,
RoutingCostId  routingCostId = {},
bool  withLaneChanges = true 
) const

Retrieve a shortest path between 'start' and 'end'.

Will find a shortest path using Djikstra's shortest path algorithm and the routing cost calculated by the routing cost module with the respective ID. Be aware that the shortest path may contain lane changes, i.e. lanelets that are parallel and not only adjacent.

Parameters
fromStart lanelet to find a shortest path
toEnd lanelet to find a shortest path
routingCostIdID of RoutingCost module to determine shortest path
withLaneChangesif false, the shortest path will not contain lane changes

Definition at line 404 of file RoutingGraph.cpp.

◆ shortestPathIncludingAreas()

Optional< LaneletOrAreaPath > lanelet::routing::RoutingGraph::shortestPathIncludingAreas ( const ConstLaneletOrArea from,
const ConstLaneletOrArea to,
RoutingCostId  routingCostId = {},
bool  withLaneChanges = true 
) const

Retrieve a shortest path between 'start' and 'end' that may contain Areas.

Will find a shortest path using Djikstra's shortest path algorithm and the routing cost calculated by the routing cost module with the respective ID. Be aware that the shortest path may contain lane changes, i.e. lanelets that are parallel and not only adjacent.

Parameters
fromStart lanelet or area to find a shortest path
toEnd lanelet or area to find a shortest path to
routingCostIdID of RoutingCost module to determine shortest path
withLaneChangesif false, the shortest path will not contain lane changes

Definition at line 409 of file RoutingGraph.cpp.

◆ shortestPathIncludingAreasVia()

Optional< LaneletOrAreaPath > lanelet::routing::RoutingGraph::shortestPathIncludingAreasVia ( const ConstLaneletOrArea start,
const ConstLaneletOrAreas via,
const ConstLaneletOrArea end,
RoutingCostId  routingCostId = {},
bool  withLaneChanges = true 
) const

Retrieve a shortest path between 'start' and 'end' using intermediate points. Will find a shortest path using Djikstra's shortest path algorithm and the routing cost calculated by the routing cost module with the respective ID. Be aware that the shortest path may contain lane changes, i.e. lanelets that are parallel and not only adjacent.

Parameters
startStart lanelet or area to find a shortest path
viaIntermediate lanelets or areas that have to be passed
endEnd lanelet or area to find a shortest path
routingCostIdID of RoutingCost module to determine shortest path
withLaneChangesif false, the shortest path will not contain lane changes
See also
shortestPath

Definition at line 425 of file RoutingGraph.cpp.

◆ shortestPathVia()

Optional< LaneletPath > lanelet::routing::RoutingGraph::shortestPathVia ( const ConstLanelet start,
const ConstLanelets via,
const ConstLanelet end,
RoutingCostId  routingCostId = {},
bool  withLaneChanges = true 
) const

Retrieve a shortest path between 'start' and 'end' using intermediate points. Will find a shortest path using Djikstra's shortest path algorithm and the routing cost calculated by the routing cost module with the respective ID. Be aware that the shortest path may contain lane changes, i.e. lanelets that are parallel and not only adjacent.

Parameters
startStart lanelet to find a shortest path
viaIntermediate lanelets that have to be passed
endEnd lanelet to find a shortest path
routingCostIdID of RoutingCost module to determine shortest path
withLaneChangesif false, the shortest path will not contain lane changes
See also
shortestPath

Definition at line 417 of file RoutingGraph.cpp.

Member Data Documentation

◆ graph_

std::unique_ptr<internal::RoutingGraphGraph> lanelet::routing::RoutingGraph::graph_
private

Documentation to be found in the cpp file.

Wrapper of the routing graph

Definition at line 495 of file RoutingGraph.h.

◆ ParticipantHeight

constexpr const char lanelet::routing::RoutingGraph::ParticipantHeight = "participant_height"
staticconstexpr

Defined configuration attributes.

Definition at line 74 of file RoutingGraph.h.

◆ passableLaneletSubmap_

LaneletSubmapConstPtr lanelet::routing::RoutingGraph::passableLaneletSubmap_
private

Lanelet map of all passable lanelets.

Definition at line 496 of file RoutingGraph.h.


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


lanelet2_routing
Author(s): Matthias Mayr
autogenerated on Sun Oct 27 2024 02:27:49