CARLA
Public Types | Public Member Functions | Private Attributes | List of all members
carla::road::Lane Class Reference

#include <Lane.h>

+ Inheritance diagram for carla::road::Lane:
+ Collaboration diagram for carla::road::Lane:

Public Types

enum  LaneType : int32_t {
  LaneType::None = 0x1, LaneType::Driving = 0x1 << 1, LaneType::Stop = 0x1 << 2, LaneType::Shoulder = 0x1 << 3,
  LaneType::Biking = 0x1 << 4, LaneType::Sidewalk = 0x1 << 5, LaneType::Border = 0x1 << 6, LaneType::Restricted = 0x1 << 7,
  LaneType::Parking = 0x1 << 8, LaneType::Bidirectional = 0x1 << 9, LaneType::Median = 0x1 << 10, LaneType::Special1 = 0x1 << 11,
  LaneType::Special2 = 0x1 << 12, LaneType::Special3 = 0x1 << 13, LaneType::RoadWorks = 0x1 << 14, LaneType::Tram = 0x1 << 15,
  LaneType::Rail = 0x1 << 16, LaneType::Entry = 0x1 << 17, LaneType::Exit = 0x1 << 18, LaneType::OffRamp = 0x1 << 19,
  LaneType::OnRamp = 0x1 << 20, LaneType::Any = -2
}
 Can be used as flags. More...
 

Public Member Functions

geom::Transform ComputeTransform (const double s) const
 
std::pair< geom::Vector3D, geom::Vector3DGetCornerPositions (const double s, const float extra_width=0.f) const
 Computes the location of the edges given a s. More...
 
double GetDistance () const
 
LaneId GetId () const
 
template<typename T >
const T * GetInfo (const double s) const
 
template<typename T >
std::vector< const T * > GetInfos () const
 
const LaneSectionGetLaneSection () const
 
double GetLength () const
 
bool GetLevel () const
 
const std::vector< Lane * > & GetNextLanes () const
 
LaneId GetPredecessor () const
 
const std::vector< Lane * > & GetPreviousLanes () const
 
RoadGetRoad () const
 
LaneId GetSuccessor () const
 
LaneType GetType () const
 
double GetWidth (const double s) const
 Returns the total lane width given a s. More...
 
bool IsStraight () const
 Checks whether the geometry is straight or not. More...
 
 Lane ()=default
 
 Lane (LaneSection *lane_section, LaneId id, std::vector< std::unique_ptr< element::RoadInfo >> &&info)
 

Private Attributes

LaneId _id = 0
 
InformationSet _info
 
LaneSection_lane_section = nullptr
 
bool _level = false
 
std::vector< Lane * > _next_lanes
 
LaneId _predecessor = 0
 
std::vector< Lane * > _prev_lanes
 
LaneId _successor = 0
 
LaneType _type = LaneType::None
 
friend MapBuilder
 

Additional Inherited Members

- Private Member Functions inherited from carla::MovableNonCopyable
 MovableNonCopyable ()=default
 
 MovableNonCopyable (const MovableNonCopyable &)=delete
 
 MovableNonCopyable (MovableNonCopyable &&)=default
 
MovableNonCopyableoperator= (const MovableNonCopyable &)=delete
 
MovableNonCopyableoperator= (MovableNonCopyable &&)=default
 

Detailed Description

Definition at line 25 of file Lane.h.

Member Enumeration Documentation

◆ LaneType

enum carla::road::Lane::LaneType : int32_t
strong

Can be used as flags.

Enumerator
None 
Driving 
Stop 
Shoulder 
Biking 
Sidewalk 
Border 
Restricted 
Parking 
Bidirectional 
Median 
Special1 
Special2 
Special3 
RoadWorks 
Tram 
Rail 
Entry 
Exit 
OffRamp 
OnRamp 
Any 

Definition at line 29 of file Lane.h.

Constructor & Destructor Documentation

◆ Lane() [1/2]

carla::road::Lane::Lane ( )
default

◆ Lane() [2/2]

carla::road::Lane::Lane ( LaneSection lane_section,
LaneId  id,
std::vector< std::unique_ptr< element::RoadInfo >> &&  info 
)
inline

Definition at line 58 of file Lane.h.

References DEBUG_ASSERT, GetId(), GetLaneSection(), GetLevel(), GetRoad(), and GetType().

+ Here is the call graph for this function:

Member Function Documentation

◆ ComputeTransform()

geom::Transform carla::road::Lane::ComputeTransform ( const double  s) const

◆ GetCornerPositions()

std::pair< geom::Vector3D, geom::Vector3D > carla::road::Lane::GetCornerPositions ( const double  s,
const float  extra_width = 0.f 
) const

◆ GetDistance()

double carla::road::Lane::GetDistance ( ) const

Definition at line 46 of file Lane.cpp.

References _lane_section, DEBUG_ASSERT, and carla::road::LaneSection::GetDistance().

Referenced by carla::road::Map::FilterRoadsByPosition(), carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated(), get_total_road_marks(), carla::road::GetDistanceAtEndOfLane(), carla::road::GetDistanceAtStartOfLane(), GetLength(), GetPredecessor(), carla::road::GetRemainingLength(), carla::road::Map::GetTreesTransform(), and IsStraight().

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

◆ GetId()

LaneId carla::road::Lane::GetId ( ) const

◆ GetInfo()

template<typename T >
const T* carla::road::Lane::GetInfo ( const double  s) const
inline

Definition at line 79 of file Lane.h.

References _info, _lane_section, DEBUG_ASSERT, and carla::road::InformationSet::GetInfo().

Referenced by carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine(), get_total_road_marks(), and carla::road::Map::GetTreesTransform().

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

◆ GetInfos()

template<typename T >
std::vector<const T*> carla::road::Lane::GetInfos ( ) const
inline

Definition at line 85 of file Lane.h.

References _info, _lane_section, DEBUG_ASSERT, and carla::road::InformationSet::GetInfos().

+ Here is the call graph for this function:

◆ GetLaneSection()

const LaneSection * carla::road::Lane::GetLaneSection ( ) const

Definition at line 25 of file Lane.cpp.

References _lane_section.

Referenced by ComputeTransform(), GetCornerPositions(), and Lane().

+ Here is the caller graph for this function:

◆ GetLength()

double carla::road::Lane::GetLength ( ) const

Definition at line 51 of file Lane.cpp.

References DEBUG_ASSERT, GetDistance(), and GetRoad().

Referenced by ComputeTransform(), carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated(), carla::road::GetDistanceAtEndOfLane(), carla::road::GetDistanceAtStartOfLane(), GetPredecessor(), carla::road::GetRemainingLength(), GetWidth(), and IsStraight().

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

◆ GetLevel()

bool carla::road::Lane::GetLevel ( ) const

Definition at line 42 of file Lane.cpp.

References _level.

Referenced by Lane().

+ Here is the caller graph for this function:

◆ GetNextLanes()

const std::vector<Lane *>& carla::road::Lane::GetNextLanes ( ) const
inline

Definition at line 90 of file Lane.h.

References _next_lanes.

◆ GetPredecessor()

LaneId carla::road::Lane::GetPredecessor ( ) const
inline

Definition at line 102 of file Lane.h.

References _predecessor, ComputeTransform(), GetCornerPositions(), GetDistance(), GetLength(), GetWidth(), and IsStraight().

Referenced by carla::road::MapBuilder::GetLaneNext().

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

◆ GetPreviousLanes()

const std::vector<Lane *>& carla::road::Lane::GetPreviousLanes ( ) const
inline

Definition at line 94 of file Lane.h.

References _prev_lanes.

◆ GetRoad()

Road * carla::road::Lane::GetRoad ( ) const

Definition at line 29 of file Lane.cpp.

References _lane_section, DEBUG_ASSERT, and carla::road::LaneSection::GetRoad().

Referenced by ComputeTransform(), GetCornerPositions(), carla::road::Map::GetLane(), carla::road::MapBuilder::GetLane(), GetLength(), GetWidth(), IsStraight(), Lane(), and carla::opendrive::parser::ParseLanes().

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

◆ GetSuccessor()

LaneId carla::road::Lane::GetSuccessor ( ) const
inline

Definition at line 98 of file Lane.h.

References _successor.

Referenced by carla::road::MapBuilder::GetLaneNext().

+ Here is the caller graph for this function:

◆ GetType()

Lane::LaneType carla::road::Lane::GetType ( ) const

Definition at line 38 of file Lane.cpp.

References _type.

Referenced by carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated(), GetCornerPositions(), and Lane().

+ Here is the caller graph for this function:

◆ GetWidth()

double carla::road::Lane::GetWidth ( const double  s) const

Returns the total lane width given a s.

Definition at line 58 of file Lane.cpp.

References GetLength(), GetRoad(), and RELEASE_ASSERT.

Referenced by GetCornerPositions(), GetPredecessor(), and carla::road::Map::GetTreesTransform().

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

◆ IsStraight()

bool carla::road::Lane::IsStraight ( ) const

Checks whether the geometry is straight or not.

Definition at line 67 of file Lane.cpp.

References DEBUG_ASSERT, GetDistance(), carla::road::Road::GetInfo(), carla::road::Road::GetInfos(), GetLength(), GetRoad(), carla::road::element::LINE, and RELEASE_ASSERT.

Referenced by carla::road::Map::CreateRtree(), carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), and GetPredecessor().

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

Member Data Documentation

◆ _id

LaneId carla::road::Lane::_id = 0
private

Definition at line 128 of file Lane.h.

Referenced by GetId().

◆ _info

InformationSet carla::road::Lane::_info
private

Definition at line 130 of file Lane.h.

Referenced by GetInfo(), and GetInfos().

◆ _lane_section

LaneSection* carla::road::Lane::_lane_section = nullptr
private

Definition at line 126 of file Lane.h.

Referenced by GetDistance(), GetInfo(), GetInfos(), GetLaneSection(), and GetRoad().

◆ _level

bool carla::road::Lane::_level = false
private

Definition at line 134 of file Lane.h.

Referenced by GetLevel().

◆ _next_lanes

std::vector<Lane *> carla::road::Lane::_next_lanes
private

Definition at line 140 of file Lane.h.

Referenced by GetNextLanes().

◆ _predecessor

LaneId carla::road::Lane::_predecessor = 0
private

Definition at line 138 of file Lane.h.

Referenced by GetPredecessor().

◆ _prev_lanes

std::vector<Lane *> carla::road::Lane::_prev_lanes
private

Definition at line 142 of file Lane.h.

Referenced by GetPreviousLanes().

◆ _successor

LaneId carla::road::Lane::_successor = 0
private

Definition at line 136 of file Lane.h.

Referenced by GetSuccessor().

◆ _type

LaneType carla::road::Lane::_type = LaneType::None
private

Definition at line 132 of file Lane.h.

Referenced by GetType().

◆ MapBuilder

friend carla::road::Lane::MapBuilder
private

Definition at line 124 of file Lane.h.


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