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. More... | |
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. More... | |
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. More... | |
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. More... | |
~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. More... | |
NodeList | GetPredecessors (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 |
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. More... | |
NodeList | dense_topology |
Structure to hold all custom waypoint objects after interpolation of sparse topology. More... | |
Rtree | rtree |
Spatial quadratic R-tree for indexing and querying waypoints. More... | |
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.
carla::traffic_manager::InMemoryMap::InMemoryMap | ( | WorldMap | world_map | ) |
Definition at line 22 of file InMemoryMap.cpp.
carla::traffic_manager::InMemoryMap::~InMemoryMap | ( | ) |
Definition at line 23 of file InMemoryMap.cpp.
|
static |
Definition at line 71 of file InMemoryMap.cpp.
References Save(), and SetUp().
Referenced by carla::client::Map::CookInMemoryMap().
|
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 512 of file InMemoryMap.cpp.
References carla::road::Both, and GetWaypoint().
Referenced by SetUp().
NodeList 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 508 of file InMemoryMap.cpp.
References dense_topology.
const cc::Map & carla::traffic_manager::InMemoryMap::GetMap | ( | ) | const |
Definition at line 583 of file InMemoryMap.cpp.
References _world_map.
std::string carla::traffic_manager::InMemoryMap::GetMapName | ( | ) |
Definition at line 578 of file InMemoryMap.cpp.
References _world_map.
Referenced by Save().
|
private |
Definition at line 52 of file InMemoryMap.cpp.
Referenced by SetUp().
|
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 25 of file InMemoryMap.cpp.
Referenced by GetSegmentId(), and SetUp().
|
private |
Definition at line 29 of file InMemoryMap.cpp.
References GetSegmentId().
|
private |
Definition at line 33 of file InMemoryMap.cpp.
Referenced by SetUp().
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 467 of file InMemoryMap.cpp.
References rtree, carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by FindAndLinkLaneChange().
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 480 of file InMemoryMap.cpp.
References carla::traffic_manager::constants::Map::DELTA, rtree, carla::geom::Vector3D::x, carla::geom::Vector3D::y, carla::geom::Vector3D::z, and carla::traffic_manager::constants::Map::Z_DELTA.
bool carla::traffic_manager::InMemoryMap::Load | ( | const std::vector< uint8_t > & | content | ) |
Definition at line 112 of file InMemoryMap.cpp.
References _world_map, dense_topology, carla::traffic_manager::CachedSimpleWaypoint::geodesic_grid_id, carla::traffic_manager::CachedSimpleWaypoint::is_junction, carla::traffic_manager::CachedSimpleWaypoint::lane_id, carla::traffic_manager::CachedSimpleWaypoint::Read(), carla::traffic_manager::CachedSimpleWaypoint::road_id, carla::traffic_manager::CachedSimpleWaypoint::road_option, carla::traffic_manager::CachedSimpleWaypoint::s, SetUpSpatialTree(), and carla::traffic_manager::CachedSimpleWaypoint::waypoint_id.
|
private |
Definition at line 77 of file InMemoryMap.cpp.
References dense_topology, GetMapName(), carla::log_error(), and carla::traffic_manager::CachedSimpleWaypoint::Write().
Referenced by Cook().
void carla::traffic_manager::InMemoryMap::SetUp | ( | ) |
This method constructs the local map with a resolution of sampling_resolution.
Definition at line 166 of file InMemoryMap.cpp.
References _world_map, dense_topology, carla::geom::Math::DistanceSquared(), FindAndLinkLaneChange(), GetPredecessors(), GetSegmentId(), GetSuccessors(), carla::geom::Math::GetVectorAngle(), carla::traffic_manager::constants::Map::MAP_RESOLUTION, carla::traffic_manager::constants::Map::MAX_GEODESIC_GRID_LENGTH, carla::traffic_manager::constants::LaneChange::MAX_WPT_DISTANCE, carla::traffic_manager::constants::Map::MAX_WPT_RADIANS, carla::traffic_manager::constants::Map::MIN_LANE_WIDTH, reverse(), SetUpRoadOption(), SetUpSpatialTree(), and sort().
Referenced by Cook().
|
private |
|
private |
Definition at line 378 of file InMemoryMap.cpp.
References dense_topology, carla::traffic_manager::LaneFollow, carla::traffic_manager::Left, carla::traffic_manager::Right, carla::traffic_manager::RoadEnd, carla::traffic_manager::Straight, carla::traffic_manager::constants::Map::STRAIGHT_DEG, and carla::traffic_manager::Void.
Referenced by SetUp().
|
private |
Definition at line 368 of file InMemoryMap.cpp.
References dense_topology, rtree, carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by Load(), and SetUp().
|
private |
Object to hold the world map received by the constructor.
Definition at line 68 of file InMemoryMap.h.
Referenced by GetMap(), GetMapName(), Load(), and SetUp().
|
private |
Structure to hold all custom waypoint objects after interpolation of sparse topology.
Definition at line 71 of file InMemoryMap.h.
Referenced by GetDenseTopology(), Load(), Save(), SetUp(), SetUpRoadOption(), and SetUpSpatialTree().
|
private |
Spatial quadratic R-tree for indexing and querying waypoints.
Definition at line 73 of file InMemoryMap.h.
Referenced by GetWaypoint(), GetWaypointsInDelta(), and SetUpSpatialTree().