CARLA
Public Member Functions | Private Member Functions | Private Attributes | List of all members
carla::traffic_manager::InMemoryMap Class Reference

This class builds a discretized local map-cache. More...

#include <InMemoryMap.h>

+ Collaboration diagram for carla::traffic_manager::InMemoryMap:

Public Member Functions

NodeList GetDenseTopology () const
 This method returns the full list of discrete samples of the map in the local cache. More...
 
std::string GetMapName ()
 
SimpleWaypointPtr GetWaypoint (const cg::Location loc) const
 This method returns the closest waypoint to a given location on the map. More...
 
 InMemoryMap (WorldMap world_map)
 
void SetUp ()
 This method constructs the local map with a resolution of sampling_resolution. More...
 
 ~InMemoryMap ()
 

Private Member Functions

void FindAndLinkLaneChange (SimpleWaypointPtr reference_waypoint)
 This method is used to find and place lane change links. More...
 
std::vector< SimpleWaypointPtrGetPredecessors (const SegmentId segment_id, const SegmentTopology &segment_topology, const SegmentMap &segment_map)
 
SegmentId GetSegmentId (const WaypointPtr &wp) const
 Computes the segment id of a given waypoint. More...
 
SegmentId GetSegmentId (const SimpleWaypointPtr &swp) const
 
std::vector< SimpleWaypointPtrGetSuccessors (const SegmentId segment_id, const SegmentTopology &segment_topology, const SegmentMap &segment_map)
 

Private Attributes

WorldMap _world_map
 Object to hold the world map received by the constructor. More...
 
NodeList dense_topology
 Structure to hold all custom waypoint objects after interpolation of sparse topology. More...
 
std::unordered_map< GeoGridId, cg::Locationgeodesic_grid_center
 Geodesic grid topology. More...
 
bgi::rtree< SpatialTreeEntry, bgi::quadratic< 32 > > rtree
 Spatial quadratic R-tree for indexing and querying waypoints. More...
 

Detailed Description

This class builds a discretized local map-cache.

Instantiate the class with the world and run SetUp() to construct the local map.

Definition at line 51 of file InMemoryMap.h.

Constructor & Destructor Documentation

◆ InMemoryMap()

carla::traffic_manager::InMemoryMap::InMemoryMap ( WorldMap  world_map)

Definition at line 20 of file InMemoryMap.cpp.

◆ ~InMemoryMap()

carla::traffic_manager::InMemoryMap::~InMemoryMap ( )

Definition at line 21 of file InMemoryMap.cpp.

Member Function Documentation

◆ FindAndLinkLaneChange()

void carla::traffic_manager::InMemoryMap::FindAndLinkLaneChange ( SimpleWaypointPtr  reference_waypoint)
private

This method is used to find and place lane change links.

Cheack for transits

Left transit way point present only

Right transit way point present only

Both left and right transit present

Right transit way point

Left transit way point

For no transit waypoint (left or right)

Definition at line 250 of file InMemoryMap.cpp.

References carla::road::Both, and GetWaypoint().

Referenced by SetUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDenseTopology()

std::vector< SimpleWaypointPtr > carla::traffic_manager::InMemoryMap::GetDenseTopology ( ) const

This method returns the full list of discrete samples of the map in the local cache.

Definition at line 246 of file InMemoryMap.cpp.

References dense_topology.

◆ GetMapName()

std::string carla::traffic_manager::InMemoryMap::GetMapName ( )

Definition at line 316 of file InMemoryMap.cpp.

References _world_map.

◆ GetPredecessors()

std::vector< SimpleWaypointPtr > carla::traffic_manager::InMemoryMap::GetPredecessors ( const SegmentId  segment_id,
const SegmentTopology segment_topology,
const SegmentMap segment_map 
)
private

Definition at line 49 of file InMemoryMap.cpp.

Referenced by SetUp().

+ Here is the caller graph for this function:

◆ GetSegmentId() [1/2]

SegmentId carla::traffic_manager::InMemoryMap::GetSegmentId ( const WaypointPtr wp) const
private

Computes the segment id of a given waypoint.

The Id takes into account OpenDrive's road Id, lane Id and Section Id.

Definition at line 23 of file InMemoryMap.cpp.

Referenced by GetSegmentId(), and SetUp().

+ Here is the caller graph for this function:

◆ GetSegmentId() [2/2]

SegmentId carla::traffic_manager::InMemoryMap::GetSegmentId ( const SimpleWaypointPtr swp) const
private

Definition at line 27 of file InMemoryMap.cpp.

References GetSegmentId().

+ Here is the call graph for this function:

◆ GetSuccessors()

std::vector< SimpleWaypointPtr > carla::traffic_manager::InMemoryMap::GetSuccessors ( const SegmentId  segment_id,
const SegmentTopology segment_topology,
const SegmentMap segment_map 
)
private

Definition at line 31 of file InMemoryMap.cpp.

Referenced by SetUp().

+ Here is the caller graph for this function:

◆ GetWaypoint()

SimpleWaypointPtr carla::traffic_manager::InMemoryMap::GetWaypoint ( const cg::Location  loc) const

This method returns the closest waypoint to a given location on the map.

Definition at line 234 of file InMemoryMap.cpp.

References rtree, carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.

Referenced by FindAndLinkLaneChange().

+ Here is the caller graph for this function:

◆ SetUp()

void carla::traffic_manager::InMemoryMap::SetUp ( )

This method constructs the local map with a resolution of sampling_resolution.

Definition at line 67 of file InMemoryMap.cpp.

References _world_map, dense_topology, carla::geom::Math::DistanceSquared(), FindAndLinkLaneChange(), GetPredecessors(), GetSegmentId(), GetSuccessors(), carla::traffic_manager::constants::Map::MAP_RESOLUTION, carla::traffic_manager::constants::Map::MAX_GEODESIC_GRID_LENGTH, reverse(), rtree, sort(), carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.

+ Here is the call graph for this function:

Member Data Documentation

◆ _world_map

WorldMap carla::traffic_manager::InMemoryMap::_world_map
private

Object to hold the world map received by the constructor.

Definition at line 56 of file InMemoryMap.h.

Referenced by GetMapName(), and SetUp().

◆ dense_topology

NodeList carla::traffic_manager::InMemoryMap::dense_topology
private

Structure to hold all custom waypoint objects after interpolation of sparse topology.

Definition at line 59 of file InMemoryMap.h.

Referenced by GetDenseTopology(), and SetUp().

◆ geodesic_grid_center

std::unordered_map<GeoGridId, cg::Location> carla::traffic_manager::InMemoryMap::geodesic_grid_center
private

Geodesic grid topology.

Definition at line 64 of file InMemoryMap.h.

◆ rtree

bgi::rtree<SpatialTreeEntry, bgi::quadratic<32> > carla::traffic_manager::InMemoryMap::rtree
private

Spatial quadratic R-tree for indexing and querying waypoints.

Definition at line 61 of file InMemoryMap.h.

Referenced by GetWaypoint(), and SetUp().


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