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

A stretch of road over which the lane layout does not change. More...

#include <LaneSection.h>

+ Inheritance diagram for carla::client::LaneSection:

Public Member Functions

bool ContainsLane (road::LaneId lane_id) const
 
double GetDistance () const
 The s coordinate, along the road, at which this section begins.
 
road::SectionId GetId () const
 
SharedPtr< Lane > GetLane (road::LaneId lane_id) const
 The lane with this id, or nullptr when the section has no such lane.
 
std::vector< SharedPtr< Lane > > GetLanes (road::Lane::LaneType type=road::Lane::LaneType::Driving) const
 Every lane in this section of the given type.
 
double GetLength () const
 Length of the section, in metres.
 
SharedPtr< LaneSection > GetNextSection () const
 The next section along the road, or nullptr at the end.
 
SharedPtr< LaneSection > GetPreviousSection () const
 The previous section along the road, or nullptr at the start.
 
SharedPtr< Road > GetRoad () const
 
road::RoadId GetRoadId () const
 
uint64_t GetUniqueId () const
 Unique id of this section within its map, for use as a dictionary key.
 
bool operator!= (const LaneSection &rhs) const
 
bool operator== (const LaneSection &rhs) const
 

Private Member Functions

 LaneSection (SharedPtr< const Map > parent, road::RoadId road_id, road::SectionId section_id)
 
- 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
 

Private Attributes

SharedPtr< const Map > _parent
 
road::RoadId _road_id
 
road::SectionId _section_id
 

Friends

class Lane
 
class Map
 
class Road
 

Detailed Description

A stretch of road over which the lane layout does not change.

An OpenDRIVE road is divided along s into lane sections; lanes are added or dropped only at a section boundary. This is why a lane's identity carries a section id, and why Lane::GetNextLanes() can step into a different section.

Definition at line 29 of file client/LaneSection.h.

Constructor & Destructor Documentation

◆ LaneSection()

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

Definition at line 83 of file client/LaneSection.h.

Member Function Documentation

◆ ContainsLane()

bool carla::client::LaneSection::ContainsLane ( road::LaneId  lane_id) const

◆ GetDistance()

double carla::client::LaneSection::GetDistance ( ) const

The s coordinate, along the road, at which this section begins.

Definition at line 43 of file client/LaneSection.cpp.

References _parent, _road_id, and _section_id.

◆ GetId()

road::SectionId carla::client::LaneSection::GetId ( ) const
inline

Definition at line 34 of file client/LaneSection.h.

References _section_id.

Referenced by GetNextSection(), and GetPreviousSection().

◆ GetLane()

SharedPtr< Lane > carla::client::LaneSection::GetLane ( road::LaneId  lane_id) const

The lane with this id, or nullptr when the section has no such lane.

Definition at line 71 of file client/LaneSection.cpp.

References _parent, _road_id, and _section_id.

◆ GetLanes()

std::vector< SharedPtr< Lane > > carla::client::LaneSection::GetLanes ( road::Lane::LaneType  type = road::Lane::LaneType::Driving) const

Every lane in this section of the given type.

The centre lane (id 0) carries no width and is never returned.

Definition at line 53 of file client/LaneSection.cpp.

References _parent, _road_id, _section_id, carla::road::Lane::GetId(), carla::road::LaneSection::GetLanes(), carla::road::Road::GetLaneSectionById(), carla::road::LaneSection::GetRoad(), and carla::road::Lane::GetType().

◆ GetLength()

double carla::client::LaneSection::GetLength ( ) const

Length of the section, in metres.

Definition at line 48 of file client/LaneSection.cpp.

References _parent, _road_id, and _section_id.

◆ GetNextSection()

SharedPtr< LaneSection > carla::client::LaneSection::GetNextSection ( ) const

The next section along the road, or nullptr at the end.

Definition at line 80 of file client/LaneSection.cpp.

References _parent, _road_id, _section_id, GetId(), road, and carla::client::SectionsByDistance().

◆ GetPreviousSection()

SharedPtr< LaneSection > carla::client::LaneSection::GetPreviousSection ( ) const

The previous section along the road, or nullptr at the start.

Definition at line 94 of file client/LaneSection.cpp.

References _parent, _road_id, _section_id, GetId(), road, and carla::client::SectionsByDistance().

◆ GetRoad()

SharedPtr< Road > carla::client::LaneSection::GetRoad ( ) const

Definition at line 39 of file client/LaneSection.cpp.

References _parent, and _road_id.

◆ GetRoadId()

road::RoadId carla::client::LaneSection::GetRoadId ( ) const
inline

Definition at line 38 of file client/LaneSection.h.

References _road_id.

◆ GetUniqueId()

uint64_t carla::client::LaneSection::GetUniqueId ( ) const

Unique id of this section within its map, for use as a dictionary key.

Definition at line 35 of file client/LaneSection.cpp.

References _road_id, and _section_id.

◆ operator!=()

bool carla::client::LaneSection::operator!= ( const LaneSection &  rhs) const
inline

Definition at line 73 of file client/LaneSection.h.

◆ operator==()

bool carla::client::LaneSection::operator== ( const LaneSection &  rhs) const
inline

Definition at line 69 of file client/LaneSection.h.

References _road_id, and _section_id.

Friends And Related Symbol Documentation

◆ Lane

friend class Lane
friend

Definition at line 81 of file client/LaneSection.h.

◆ Map

friend class Map
friend

Definition at line 79 of file client/LaneSection.h.

◆ Road

friend class Road
friend

Definition at line 80 of file client/LaneSection.h.

Member Data Documentation

◆ _parent

SharedPtr<const Map> carla::client::LaneSection::_parent
private

◆ _road_id

road::RoadId carla::client::LaneSection::_road_id
private

◆ _section_id

road::SectionId carla::client::LaneSection::_section_id
private

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