CARLA
Loading...
Searching...
No Matches
InMemoryMap Class Reference

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

#include <InMemoryMap.h>

Public Member Functions

NodeList GetDenseTopology () const
 This method returns the full list of discrete samples of the map in the local cache.
const cc::Map & GetMap () const
std::string GetMapName ()
SimpleWaypointPtr GetWaypoint (const cg::Location loc) const
 This method returns the closest waypoint to a given location on the map.
NodeList GetWaypointsInDelta (const cg::Location loc, const uint16_t n_points, const float random_sample) const
 This method returns n waypoints in an delta area with a certain distance from the ego vehicle.
 InMemoryMap (WorldMap world_map)
bool Load (const std::vector< uint8_t > &content)
void SetUp ()
 This method constructs the local map with a resolution of sampling_resolution.
 ~InMemoryMap ()

Static Public Member Functions

static void Cook (WorldMap world_map, const std::string &path)

Private Member Functions

void FindAndLinkLaneChange (SimpleWaypointPtr reference_waypoint)
 This method is used to find and place lane change links.
NodeList GetPredecessors (const SegmentId segment_id, const SegmentTopology &segment_topology, const SegmentMap &segment_map)
SegmentId GetSegmentId (const SimpleWaypointPtr &swp) const
SegmentId GetSegmentId (const WaypointPtr &wp) const
 Computes the segment id of a given waypoint.
NodeList GetSuccessors (const SegmentId segment_id, const SegmentTopology &segment_topology, const SegmentMap &segment_map)
void Save (const std::string &path)
void SetUpDenseTopology ()
void SetUpRoadOption ()
void SetUpSpatialTree ()

Private Attributes

WorldMap _world_map
 Object to hold the world map received by the constructor.
NodeList dense_topology
 Structure to hold all custom waypoint objects after interpolation of sparse topology.
Rtree rtree
 Spatial quadratic R-tree for indexing and querying waypoints.

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 63 of file InMemoryMap.h.

Constructor & Destructor Documentation

◆ InMemoryMap()

Definition at line 21 of file InMemoryMap.cpp.

◆ ~InMemoryMap()

Member Function Documentation

◆ Cook()

void carla::traffic_manager::InMemoryMap::Cook ( WorldMap world_map,
const std::string & path )
static

Definition at line 79 of file InMemoryMap.cpp.

◆ 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 580 of file InMemoryMap.cpp.

◆ GetDenseTopology()

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

Definition at line 576 of file InMemoryMap.cpp.

◆ GetMap()

Definition at line 651 of file InMemoryMap.cpp.

◆ GetMapName()

Definition at line 646 of file InMemoryMap.cpp.

◆ GetPredecessors()

NodeList carla::traffic_manager::InMemoryMap::GetPredecessors ( const SegmentId segment_id,
const SegmentTopology & segment_topology,
const SegmentMap & segment_map )
private

Definition at line 60 of file InMemoryMap.cpp.

◆ GetSegmentId() [1/2]

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

Definition at line 37 of file InMemoryMap.cpp.

◆ GetSegmentId() [2/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 33 of file InMemoryMap.cpp.

◆ GetSuccessors()

NodeList carla::traffic_manager::InMemoryMap::GetSuccessors ( const SegmentId segment_id,
const SegmentTopology & segment_topology,
const SegmentMap & segment_map )
private

Definition at line 41 of file InMemoryMap.cpp.

◆ 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 528 of file InMemoryMap.cpp.

◆ GetWaypointsInDelta()

NodeList carla::traffic_manager::InMemoryMap::GetWaypointsInDelta ( const cg::Location loc,
const uint16_t n_points,
const float random_sample ) const

This method returns n waypoints in an delta area with a certain distance from the ego vehicle.

Definition at line 548 of file InMemoryMap.cpp.

◆ Load()

bool carla::traffic_manager::InMemoryMap::Load ( const std::vector< uint8_t > & content)

Definition at line 120 of file InMemoryMap.cpp.

◆ Save()

void carla::traffic_manager::InMemoryMap::Save ( const std::string & path)
private

Definition at line 85 of file InMemoryMap.cpp.

◆ SetUp()

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

Definition at line 216 of file InMemoryMap.cpp.

◆ SetUpDenseTopology()

◆ SetUpRoadOption()

Definition at line 428 of file InMemoryMap.cpp.

◆ SetUpSpatialTree()

Definition at line 418 of file InMemoryMap.cpp.

Member Data Documentation

◆ _world_map

Object to hold the world map received by the constructor.

Definition at line 68 of file InMemoryMap.h.

◆ dense_topology

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

Definition at line 71 of file InMemoryMap.h.

◆ rtree

Spatial quadratic R-tree for indexing and querying waypoints.

Definition at line 73 of file InMemoryMap.h.


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