ad_map_access
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ad::map::intersection::CoreIntersection Class Reference

#include <ad/map/intersection/CoreIntersection.hpp>

Inheritance diagram for ad::map::intersection::CoreIntersection:
Inheritance graph
[legend]
Collaboration diagram for ad::map::intersection::CoreIntersection:
Collaboration graph
[legend]

Public Member Functions

bool objectRouteCrossesIntersection (route::FullRoute const &objectRoute) const
 
physics::Distance objectDistanceToIntersection (match::Object const &object) const
 calculate and return the physics::Distance of the object to the intersection
 
bool objectWithinIntersection (match::MapMatchedObjectBoundingBox const &object) const
 
const lane::LaneIdSet & internalLanes () const
 
const lane::LaneIdSet & entryLanes () const
 
const point::ParaPointListentryParaPoints () const
 
const lane::LaneIdSet & exitLanes () const
 
const point::ParaPointListexitParaPoints () const
 
const point::BoundingSpheregetBoundingSphere () const
 

Static Public Member Functions

static bool isLanePartOfAnIntersection (lane::LaneId const laneId)
 check if a lane is part of any intersection
 
static bool isRoutePartOfAnIntersection (route::FullRoute const &route)
 check if any lane in the route is part of any intersection More...
 
static bool isIntersectionOnRoute (route::FullRoute const &route)
 check if there is an intersection for the given route More...
 
static bool isRoadSegmentEnteringIntersection (route::RouteIterator const &routeIterator, route::RoadSegmentList::const_iterator &routePreviousSegmentIter)
 check if the road segment enters an intersection More...
 
static CoreIntersectionPtr getCoreIntersectionFor (lane::LaneId const &laneId)
 retrieve the core intersection for the given laneId More...
 
static std::vector< CoreIntersectionPtrgetCoreIntersectionsFor (lane::LaneIdSet const &laneIds)
 retrieve all CoreIntersection objects for the given lane Ids More...
 
static std::vector< CoreIntersectionPtrgetCoreIntersectionsFor (lane::LaneIdList const &laneIds)
 retrieve all CoreIntersection objects for the given lane Ids More...
 
static std::vector< CoreIntersectionPtrgetCoreIntersectionsForMap ()
 retrieve all CoreIntersection objects of the map More...
 
static CoreIntersectionPtr getCoreIntersectionFor (match::MapMatchedPosition const &mapMatchedPosition)
 retrieve the core intersection for the given mapMatchedPosition More...
 
static std::vector< CoreIntersectionPtrgetCoreIntersectionsForInLaneMatches (point::ENUPoint const &position)
 retrieve the core intersection for the given ENU position More...
 
static std::vector< CoreIntersectionPtrgetCoreIntersectionsForInLaneMatches (match::MapMatchedPositionConfidenceList const &mapMatchedPositionConfidenceList)
 retrieve the core intersection for the given mapMatchedPositionConfidenceList More...
 
static std::vector< CoreIntersectionPtrgetCoreIntersectionsForInLaneMatches (match::MapMatchedObjectBoundingBox const &object)
 retrieve the core intersection for the given object More...
 

Protected Types

enum  SuccessorMode { OwnIntersection, AnyIntersection }
 

Protected Member Functions

bool isLanePartOfCoreIntersection (lane::LaneId const laneId) const
 check if given lane is inside the intersection
 
void extractLanesOfCoreIntersection (lane::LaneId const laneId)
 
bool isLanePartOfIntersection (lane::LaneId const laneId, SuccessorMode const successorMode) const
 
std::pair< lane::LaneIdSet, lane::LaneIdSet > getDirectSuccessorsInLaneDirection (lane::LaneId const laneId, SuccessorMode const successorMode) const
 Provide the direct successor lane segments in lane direction within and outside of the intersection. More...
 
lane::LaneIdSet getDirectSuccessorsInLaneDirectionWithinIntersection (lane::LaneId const laneId, SuccessorMode const successorMode) const
 Provide the direct successor lane segments in lane direction within the intersection. More...
 
lane::LaneIdSet getAllSuccessorsInLaneDirectionWithinIntersection (lane::LaneId const laneId, SuccessorMode const successorMode) const
 Provide the successor lane segments in lane direction within the intersection recursively until the intersection is left. More...
 
lane::LaneIdSet getLaneAndAllSuccessorsInLaneDirectionWithinIntersection (lane::LaneId const laneId, SuccessorMode const successorMode) const
 Provide the successor lane segments in lane direction within the intersection recursively until the intersection is left including the input laneId if part of the inner lanes. More...
 
lane::LaneIdSet getAllReachableOutgoingLanes (lane::LaneId const laneId, SuccessorMode const successorMode) const
 Provide the outgoing lane segments that are reachable in lane direction. More...
 
std::pair< lane::LaneIdSet, lane::LaneIdSet > getAllReachableInternalAndOutgoingLanes (lane::LaneId const laneId, SuccessorMode const successorMode) const
 Provide the outgoing lane segments that are reachable in lane direction as well as the intersection internal lanes. More...
 
point::ParaPoint getEntryParaPointOfExternalLane (lane::LaneId const &laneId) const
 
point::ParaPoint getExitParaPointOfExternalLane (lane::LaneId const &laneId) const
 
point::ParaPoint getEntryParaPointOfInternalLane (lane::LaneId const &laneId) const
 
point::ParaPoint getExitParaPointOfInternalLane (lane::LaneId const &laneId) const
 

Protected Attributes

lane::LaneIdSet mInternalLanes {}
 all lanes inside the intersection
 
lane::LaneIdSet mEntryLanes {}
 lanes going into the intersection
 
point::ParaPointList mEntryParaPoints {}
 lanes going into the intersection represented as ParaPoint
 
lane::LaneIdSet mExitLanes {}
 lanes going out of the intersection
 
point::ParaPointList mExitParaPoints {}
 lanes going out of the intersection represented as ParaPoint
 
std::map< lane::LaneId, lane::LaneIdSet > mOverlapping
 
std::map< lane::LaneId, lane::LaneIdSet > mSuccessor
 
std::map< lane::LaneId, lane::LaneIdSet > mPredecessor
 
point::BoundingSphere mInternalLanesBoundingSphere
 

Detailed Description

Class to provide basic intersection information.

The CoreIntersection class provides:

Member Function Documentation

◆ entryLanes()

const lane::LaneIdSet& ad::map::intersection::CoreIntersection::entryLanes ( ) const
Returns
all lanes that lead into the intersection (not part of the intersection themselves)

◆ entryParaPoints()

const point::ParaPointList& ad::map::intersection::CoreIntersection::entryParaPoints ( ) const
Returns
the border points of all lanes that lead into the intersection as ParaPoint's

◆ exitLanes()

const lane::LaneIdSet& ad::map::intersection::CoreIntersection::exitLanes ( ) const
Returns
all lanes that lead out of the intersection (not part of the intersection themselves)

◆ exitParaPoints()

const point::ParaPointList& ad::map::intersection::CoreIntersection::exitParaPoints ( ) const
Returns
the border points of all lanes that lead out of the intersection as ParaPoint's

◆ getAllReachableInternalAndOutgoingLanes()

std::pair<lane::LaneIdSet, lane::LaneIdSet> ad::map::intersection::CoreIntersection::getAllReachableInternalAndOutgoingLanes ( lane::LaneId const  laneId,
SuccessorMode const  successorMode 
) const
protected

Provide the outgoing lane segments that are reachable in lane direction as well as the intersection internal lanes.

Parameters
laneIdLaneId
Returns
a pair with <the laneID segments within the intersection, the laneID segments outside the intersection>

◆ getAllReachableOutgoingLanes()

lane::LaneIdSet ad::map::intersection::CoreIntersection::getAllReachableOutgoingLanes ( lane::LaneId const  laneId,
SuccessorMode const  successorMode 
) const
protected

Provide the outgoing lane segments that are reachable in lane direction.

Parameters
laneIdLaneId
Returns
the outgoing laneID segments outside the intersection.

◆ getAllSuccessorsInLaneDirectionWithinIntersection()

lane::LaneIdSet ad::map::intersection::CoreIntersection::getAllSuccessorsInLaneDirectionWithinIntersection ( lane::LaneId const  laneId,
SuccessorMode const  successorMode 
) const
protected

Provide the successor lane segments in lane direction within the intersection recursively until the intersection is left.

Parameters
laneIdLaneId
Returns
the laneID segments within the intersection.

◆ getBoundingSphere()

const point::BoundingSphere& ad::map::intersection::CoreIntersection::getBoundingSphere ( ) const
inline
Returns
the bounding sphere of all the inner lanes of the intersection

◆ getCoreIntersectionFor() [1/2]

static CoreIntersectionPtr ad::map::intersection::CoreIntersection::getCoreIntersectionFor ( lane::LaneId const &  laneId)
static

retrieve the core intersection for the given laneId

Parameters
[in]laneIdthe laneId to use for creation of the CoreIntersection
Returns
if the provided laneId is part of an intersection a CoreIntersection object is created and returned.

◆ getCoreIntersectionFor() [2/2]

static CoreIntersectionPtr ad::map::intersection::CoreIntersection::getCoreIntersectionFor ( match::MapMatchedPosition const &  mapMatchedPosition)
static

retrieve the core intersection for the given mapMatchedPosition

Returns
getCoreIntersectionFor(mapMatchedPosition.lanePoint.paraPoint.laneId)

◆ getCoreIntersectionsFor() [1/2]

static std::vector<CoreIntersectionPtr> ad::map::intersection::CoreIntersection::getCoreIntersectionsFor ( lane::LaneIdList const &  laneIds)
static

retrieve all CoreIntersection objects for the given lane Ids

Parameters
[in]laneIdsthe vector of laneIds to use for creation of the CoreIntersection
Returns
if one of the provided lane Ids is part of an intersection a CoreIntersection object is created and returned. if multiple lane Ids are part of the same CoreIntersection only one single CoreIntersection is returned. if lane Ids are part of different CoreIntersections, multiple CoreIntersections are returned. In summary: the CoreIntersections of all lanedIds are returned, so that every laneId of the provided laneIds set that belongs to an intersection is present in one of the returned CoreIntersection::internalLanes() set.

◆ getCoreIntersectionsFor() [2/2]

static std::vector<CoreIntersectionPtr> ad::map::intersection::CoreIntersection::getCoreIntersectionsFor ( lane::LaneIdSet const &  laneIds)
static

retrieve all CoreIntersection objects for the given lane Ids

Parameters
[in]laneIdsthe set of laneIds to use for creation of the CoreIntersection
Returns
if one of the provided lane Ids is part of an intersection a CoreIntersection object is created and returned. if multiple lane Ids are part of the same CoreIntersection only one single CoreIntersection is returned. if lane Ids are part of different CoreIntersections, multiple CoreIntersections are returned. In summary: the CoreIntersections of all lanedIds are returned, so that every laneId of the provided laneIds set that belongs to an intersection is present in one of the returned CoreIntersection::internalLanes() set.

◆ getCoreIntersectionsForInLaneMatches() [1/3]

static std::vector<CoreIntersectionPtr> ad::map::intersection::CoreIntersection::getCoreIntersectionsForInLaneMatches ( match::MapMatchedObjectBoundingBox const &  object)
static

retrieve the core intersection for the given object

Returns
Collects all in lane matches part of the MapMatchedObjectBoundingBox in a LaneIdSet and returns the vector of CoreIntersection returned by getCoreIntersectionsFor(laneIdSet). Usually the result vector size is zero or one. In cases where multiple intersections are on top of each other and the map matching distance exceeded the altitude difference of the intersections, multiple CoreIntersection results are possible.

◆ getCoreIntersectionsForInLaneMatches() [2/3]

static std::vector<CoreIntersectionPtr> ad::map::intersection::CoreIntersection::getCoreIntersectionsForInLaneMatches ( match::MapMatchedPositionConfidenceList const &  mapMatchedPositionConfidenceList)
static

retrieve the core intersection for the given mapMatchedPositionConfidenceList

Collects all in lane matches part of the mapMatchedPositionConfidenceList in a LaneIdSet and returns the vector of CoreIntersection returned by getCoreIntersectionsFor(laneIdSet). Usually the result vector size is zero or one. In cases where multiple intersections are on top of each other and the map matching distance exceeded the altitude difference of the intersections, multiple CoreIntersection results are possible.

◆ getCoreIntersectionsForInLaneMatches() [3/3]

static std::vector<CoreIntersectionPtr> ad::map::intersection::CoreIntersection::getCoreIntersectionsForInLaneMatches ( point::ENUPoint const &  position)
static

retrieve the core intersection for the given ENU position

Performs map matching of the given position and returns getCoreIntersectionsForInLaneMatches(MapMatchedPositionConfidenceList) of the matching result.

◆ getCoreIntersectionsForMap()

static std::vector<CoreIntersectionPtr> ad::map::intersection::CoreIntersection::getCoreIntersectionsForMap ( )
static

retrieve all CoreIntersection objects of the map

Returns
getCoreIntersectionsFor(lane::getLanes())

◆ getDirectSuccessorsInLaneDirection()

std::pair<lane::LaneIdSet, lane::LaneIdSet> ad::map::intersection::CoreIntersection::getDirectSuccessorsInLaneDirection ( lane::LaneId const  laneId,
SuccessorMode const  successorMode 
) const
protected

Provide the direct successor lane segments in lane direction within and outside of the intersection.

Parameters
laneIdLaneId
Returns
a pair with <the laneID segments within the intersection, the laneID segments outside the intersection>

◆ getDirectSuccessorsInLaneDirectionWithinIntersection()

lane::LaneIdSet ad::map::intersection::CoreIntersection::getDirectSuccessorsInLaneDirectionWithinIntersection ( lane::LaneId const  laneId,
SuccessorMode const  successorMode 
) const
protected

Provide the direct successor lane segments in lane direction within the intersection.

Parameters
laneIdLaneId
Returns
the laneID segments within the intersection.

◆ getLaneAndAllSuccessorsInLaneDirectionWithinIntersection()

lane::LaneIdSet ad::map::intersection::CoreIntersection::getLaneAndAllSuccessorsInLaneDirectionWithinIntersection ( lane::LaneId const  laneId,
SuccessorMode const  successorMode 
) const
protected

Provide the successor lane segments in lane direction within the intersection recursively until the intersection is left including the input laneId if part of the inner lanes.

Parameters
laneIdLaneId
Returns
the laneID segments within the intersection.

◆ internalLanes()

const lane::LaneIdSet& ad::map::intersection::CoreIntersection::internalLanes ( ) const
Returns
all lanes that are inside the intersection (independent of route)

◆ isIntersectionOnRoute()

static bool ad::map::intersection::CoreIntersection::isIntersectionOnRoute ( route::FullRoute const &  route)
static

check if there is an intersection for the given route

Parameters
[in]routeplanned route
Returns
If there is an intersection within the route, true is returned.

◆ isRoadSegmentEnteringIntersection()

static bool ad::map::intersection::CoreIntersection::isRoadSegmentEnteringIntersection ( route::RouteIterator const &  routeIterator,
route::RoadSegmentList::const_iterator &  routePreviousSegmentIter 
)
static

check if the road segment enters an intersection

Parameters
[in]routeIteratorthe route iterator of the road segment
[out]routePreviousSegmentIterif an intersectin is entered, this holds the previous route segment that is part of the transition
Returns
true if given routeIterator enters an intersection

◆ isRoutePartOfAnIntersection()

static bool ad::map::intersection::CoreIntersection::isRoutePartOfAnIntersection ( route::FullRoute const &  route)
static

check if any lane in the route is part of any intersection

Parameters
[in]routeplanned route
Returns
If there is an intersection within the route, true is returned.

◆ objectRouteCrossesIntersection()

bool ad::map::intersection::CoreIntersection::objectRouteCrossesIntersection ( route::FullRoute const &  objectRoute) const
Returns
true if the provided objectRoute contains an internal lane

This is the case if one of the internalLanes() is part of the objectRoute.

◆ objectWithinIntersection()

bool ad::map::intersection::CoreIntersection::objectWithinIntersection ( match::MapMatchedObjectBoundingBox const &  object) const
Returns
true if the object is within the intersection (touches one of the internalLanes)

Member Data Documentation

◆ mOverlapping

std::map<lane::LaneId, lane::LaneIdSet> ad::map::intersection::CoreIntersection::mOverlapping
protected

Managing relations between lanes through separate maps with sets. Reading: key: id of lane value: set of lanes that relate with this one (e.g. overlap)


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