CARLA
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
carla::client::Map Class Reference

#include <Map.h>

+ Inheritance diagram for carla::client::Map:

Public Types

using TopologyList = std::vector< std::pair< SharedPtr< Waypoint >, SharedPtr< Waypoint > > >
 

Public Member Functions

std::vector< road::element::LaneMarking > CalculateCrossedLanes (const geom::Location &origin, const geom::Location &destination) const
 
void CookInMemoryMap (const std::string &path) const
 Cooks InMemoryMap used by the traffic manager.
 
std::vector< SharedPtr< Waypoint > > GenerateWaypoints (double distance) const
 
std::vector< geom::Location > GetAllCrosswalkZones () const
 
std::vector< SharedPtr< Landmark > > GetAllLandmarks () const
 Returns all the larndmarks in the map.
 
std::vector< SharedPtr< Landmark > > GetAllLandmarksOfType (std::string type) const
 Returns all the landmarks in the map of a specific type.
 
const geom::GeoProjection & GetGeoProjection () const
 
const geom::GeoLocation & GetGeoReference () const
 
SharedPtr< Junction > GetJunction (const Waypoint &waypoint) const
 
SharedPtr< Junction > GetJunctionById (road::JuncId id) const
 Returns the junction with this id, or nullptr when the map has none.
 
std::vector< SharedPtr< Junction > > GetJunctions () const
 Returns every junction in the map.
 
std::vector< std::pair< SharedPtr< Waypoint >, SharedPtr< Waypoint > > > GetJunctionWaypoints (road::JuncId id, road::Lane::LaneType type) const
 Returns a pair of waypoints (start and end) for each lane in the junction.
 
std::vector< SharedPtr< Landmark > > GetLandmarkGroup (const Landmark &landmark) const
 Returns all the landmarks in the same group including this one.
 
std::vector< SharedPtr< Landmark > > GetLandmarksFromId (std::string id) const
 Returns all the larndmarks in the map with a specific OpenDRIVE id.
 
SharedPtr< Lane > GetLane (road::RoadId road_id, road::SectionId section_id, road::LaneId lane_id) const
 Returns the lane, or nullptr when road, section or lane is unknown.
 
SharedPtr< LaneSection > GetLaneSection (road::RoadId road_id, road::SectionId section_id) const
 Returns the lane section, or nullptr when road or section is unknown.
 
const road::Map & GetMap () const
 
const std::string & GetName () const
 
const std::string & GetOpenDrive () const
 
const std::vector< geom::Transform > & GetRecommendedSpawnPoints () const
 
SharedPtr< Road > GetRoad (road::RoadId road_id) const
 Returns the road with this id, or nullptr when the map has none.
 
std::vector< SharedPtr< Road > > GetRoads () const
 Returns every road in the map.
 
TopologyList GetTopology () const
 
SharedPtr< Waypoint > GetWaypoint (const geom::Location &location, bool project_to_road=true, int32_t lane_type=static_cast< uint32_t >(road::Lane::LaneType::Driving)) const
 
SharedPtr< Waypoint > GetWaypointXODR (carla::road::RoadId road_id, carla::road::LaneId lane_id, float s) const
 
SharedPtr< Waypoint > MakeWaypoint (road::element::Waypoint waypoint) const
 
 Map (rpc::MapInfo description, std::string xodr_content)
 
 Map (std::string name, std::string xodr_content)
 
 ~Map ()
 

Private Attributes

const rpc::MapInfo _description
 
const road::Map _map
 
std::string open_drive_file
 

Additional Inherited Members

- Private Member Functions inherited from carla::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=delete
 
NonCopyable & operator= (const NonCopyable &)=delete
 
NonCopyable & operator= (NonCopyable &&)=delete
 

Detailed Description

Definition at line 30 of file client/Map.h.

Member Typedef Documentation

◆ TopologyList

Definition at line 67 of file client/Map.h.

Constructor & Destructor Documentation

◆ Map() [1/2]

carla::client::Map::Map ( rpc::MapInfo  description,
std::string  xodr_content 
)
explicit

Definition at line 36 of file client/Map.cpp.

References open_drive_file.

◆ Map() [2/2]

carla::client::Map::Map ( std::string  name,
std::string  xodr_content 
)
explicit

Definition at line 41 of file client/Map.cpp.

◆ ~Map()

carla::client::Map::~Map ( )
default

Member Function Documentation

◆ CalculateCrossedLanes()

std::vector< road::element::LaneMarking > carla::client::Map::CalculateCrossedLanes ( const geom::Location &  origin,
const geom::Location &  destination 
) const

Definition at line 111 of file client/Map.cpp.

◆ CookInMemoryMap()

void carla::client::Map::CookInMemoryMap ( const std::string &  path) const

Cooks InMemoryMap used by the traffic manager.

Definition at line 268 of file client/Map.cpp.

References carla::traffic_manager::InMemoryMap::Cook().

◆ GenerateWaypoints()

std::vector< SharedPtr< Waypoint > > carla::client::Map::GenerateWaypoints ( double  distance) const

Definition at line 101 of file client/Map.cpp.

References distance.

◆ GetAllCrosswalkZones()

std::vector< geom::Location > carla::client::Map::GetAllCrosswalkZones ( ) const

Definition at line 125 of file client/Map.cpp.

◆ GetAllLandmarks()

std::vector< SharedPtr< Landmark > > carla::client::Map::GetAllLandmarks ( ) const

Returns all the larndmarks in the map.

Definition at line 219 of file client/Map.cpp.

◆ GetAllLandmarksOfType()

std::vector< SharedPtr< Landmark > > carla::client::Map::GetAllLandmarksOfType ( std::string  type) const

Returns all the landmarks in the map of a specific type.

Definition at line 241 of file client/Map.cpp.

◆ GetGeoProjection()

const geom::GeoProjection & carla::client::Map::GetGeoProjection ( ) const

Definition at line 121 of file client/Map.cpp.

◆ GetGeoReference()

const geom::GeoLocation & carla::client::Map::GetGeoReference ( ) const

Definition at line 117 of file client/Map.cpp.

◆ GetJunction()

SharedPtr< Junction > carla::client::Map::GetJunction ( const Waypoint &  waypoint) const

Definition at line 129 of file client/Map.cpp.

References carla::client::Waypoint::GetJunctionId(), and junction.

◆ GetJunctionById()

SharedPtr< Junction > carla::client::Map::GetJunctionById ( road::JuncId  id) const

Returns the junction with this id, or nullptr when the map has none.

Definition at line 148 of file client/Map.cpp.

References junction.

◆ GetJunctions()

std::vector< SharedPtr< Junction > > carla::client::Map::GetJunctions ( ) const

Returns every junction in the map.

Definition at line 156 of file client/Map.cpp.

◆ GetJunctionWaypoints()

std::vector< std::pair< SharedPtr< Waypoint >, SharedPtr< Waypoint > > > carla::client::Map::GetJunctionWaypoints ( road::JuncId  id,
road::Lane::LaneType  type 
) const

Returns a pair of waypoints (start and end) for each lane in the junction.

Definition at line 135 of file client/Map.cpp.

◆ GetLandmarkGroup()

std::vector< SharedPtr< Landmark > > carla::client::Map::GetLandmarkGroup ( const Landmark &  landmark) const

Returns all the landmarks in the same group including this one.

Definition at line 254 of file client/Map.cpp.

References carla::client::Landmark::_signal, carla::road::Signal::GetControllers(), and carla::road::element::RoadInfoSignal::GetSignal().

◆ GetLandmarksFromId()

std::vector< SharedPtr< Landmark > > carla::client::Map::GetLandmarksFromId ( std::string  id) const

Returns all the larndmarks in the map with a specific OpenDRIVE id.

Definition at line 229 of file client/Map.cpp.

◆ GetLane()

SharedPtr< Lane > carla::client::Map::GetLane ( road::RoadId  road_id,
road::SectionId  section_id,
road::LaneId  lane_id 
) const

Returns the lane, or nullptr when road, section or lane is unknown.

Definition at line 196 of file client/Map.cpp.

References road, and road_id.

◆ GetLaneSection()

SharedPtr< LaneSection > carla::client::Map::GetLaneSection ( road::RoadId  road_id,
road::SectionId  section_id 
) const

Returns the lane section, or nullptr when road or section is unknown.

Definition at line 181 of file client/Map.cpp.

References road, and road_id.

◆ GetMap()

const road::Map & carla::client::Map::GetMap ( ) const
inline

Definition at line 45 of file client/Map.h.

References _map.

◆ GetName()

const std::string & carla::client::Map::GetName ( ) const
inline

Definition at line 41 of file client/Map.h.

References _description, and carla::rpc::MapInfo::name.

◆ GetOpenDrive()

const std::string & carla::client::Map::GetOpenDrive ( ) const
inline

Definition at line 49 of file client/Map.h.

References open_drive_file.

◆ GetRecommendedSpawnPoints()

const std::vector< geom::Transform > & carla::client::Map::GetRecommendedSpawnPoints ( ) const
inline

Definition at line 53 of file client/Map.h.

References _description, and carla::rpc::MapInfo::recommended_spawn_points.

◆ GetRoad()

SharedPtr< Road > carla::client::Map::GetRoad ( road::RoadId  road_id) const

Returns the road with this id, or nullptr when the map has none.

Definition at line 174 of file client/Map.cpp.

References road_id.

◆ GetRoads()

std::vector< SharedPtr< Road > > carla::client::Map::GetRoads ( ) const

Returns every road in the map.

Definition at line 164 of file client/Map.cpp.

◆ GetTopology()

Map::TopologyList carla::client::Map::GetTopology ( ) const

Definition at line 76 of file client/Map.cpp.

◆ GetWaypoint()

SharedPtr< Waypoint > carla::client::Map::GetWaypoint ( const geom::Location &  location,
bool  project_to_road = true,
int32_t  lane_type = static_cast<uint32_t>(road::Lane::LaneType::Driving) 
) const

Definition at line 50 of file client/Map.cpp.

References GetWaypoint().

Referenced by GetWaypoint().

◆ GetWaypointXODR()

SharedPtr< Waypoint > carla::client::Map::GetWaypointXODR ( carla::road::RoadId  road_id,
carla::road::LaneId  lane_id,
float  s 
) const

Definition at line 65 of file client/Map.cpp.

References road_id.

◆ MakeWaypoint()

SharedPtr< Waypoint > carla::client::Map::MakeWaypoint ( road::element::Waypoint  waypoint) const

Definition at line 215 of file client/Map.cpp.

Member Data Documentation

◆ _description

const rpc::MapInfo carla::client::Map::_description
private

Definition at line 136 of file client/Map.h.

Referenced by GetName(), and GetRecommendedSpawnPoints().

◆ _map

const road::Map carla::client::Map::_map
private

Definition at line 138 of file client/Map.h.

Referenced by GetMap().

◆ open_drive_file

std::string carla::client::Map::open_drive_file
private

Definition at line 134 of file client/Map.h.

Referenced by GetOpenDrive(), and Map().


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