#include <Lane.h>
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::Vector3D > | GetCornerPositions (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 LaneSection * | GetLaneSection () const |
double | GetLength () const |
bool | GetLevel () const |
const std::vector< Lane * > & | GetNextLanes () const |
LaneId | GetPredecessor () const |
const std::vector< Lane * > & | GetPreviousLanes () const |
Road * | GetRoad () 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 | |
MovableNonCopyable & | operator= (const MovableNonCopyable &)=delete |
MovableNonCopyable & | operator= (MovableNonCopyable &&)=default |
|
strong |
|
default |
|
inline |
Definition at line 58 of file Lane.h.
References DEBUG_ASSERT, GetId(), GetLaneSection(), GetLevel(), GetRoad(), and GetType().
geom::Transform carla::road::Lane::ComputeTransform | ( | const double | s | ) | const |
Definition at line 131 of file Lane.cpp.
References carla::road::element::DirectedPoint::ApplyLateralOffset(), carla::road::ComputeTotalLaneWidth(), DEBUG_ASSERT, carla::road::Road::GetDirectedPointIn(), GetId(), carla::road::Road::GetInfo(), GetLaneSection(), GetLength(), GetRoad(), carla::road::element::DirectedPoint::location, carla::MakeListView(), carla::geom::Rotation::pitch, carla::road::element::DirectedPoint::pitch, RELEASE_ASSERT, carla::road::element::DirectedPoint::tangent, carla::geom::Math::ToDegrees(), carla::geom::Vector3D::y, and carla::geom::Rotation::yaw.
Referenced by carla::road::Map::FilterRoadsByPosition(), GetPredecessor(), and carla::road::Map::GetTreesTransform().
std::pair< geom::Vector3D, geom::Vector3D > carla::road::Lane::GetCornerPositions | ( | const double | s, |
const float | extra_width = 0.f |
||
) | const |
Computes the location of the edges given a s.
: use the OpenDRIVE 5.3.7.2.1.1.9 Lane Height Record
Definition at line 206 of file Lane.cpp.
References carla::road::element::DirectedPoint::ApplyLateralOffset(), carla::road::ComputeTotalLaneWidth(), DEBUG_ASSERT, Driving, carla::road::Road::GetDirectedPointIn(), GetId(), GetLaneSection(), GetRoad(), GetType(), GetWidth(), carla::road::Road::IsJunction(), carla::road::element::DirectedPoint::location, carla::MakeListView(), RELEASE_ASSERT, Sidewalk, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated(), GetPredecessor(), and carla::road::Map::GetTreesTransform().
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().
LaneId carla::road::Lane::GetId | ( | ) | const |
Definition at line 34 of file Lane.cpp.
References _id.
Referenced by ComputeTransform(), carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated(), GetCornerPositions(), carla::road::GetDistanceAtEndOfLane(), carla::road::GetDistanceAtStartOfLane(), carla::road::GetRemainingLength(), Lane(), and carla::opendrive::parser::ParseLanes().
|
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().
|
inline |
Definition at line 85 of file Lane.h.
References _info, _lane_section, DEBUG_ASSERT, and carla::road::InformationSet::GetInfos().
const LaneSection * carla::road::Lane::GetLaneSection | ( | ) | const |
Definition at line 25 of file Lane.cpp.
References _lane_section.
Referenced by ComputeTransform(), GetCornerPositions(), and Lane().
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().
bool carla::road::Lane::GetLevel | ( | ) | const |
|
inline |
Definition at line 90 of file Lane.h.
References _next_lanes.
|
inline |
Definition at line 102 of file Lane.h.
References _predecessor, ComputeTransform(), GetCornerPositions(), GetDistance(), GetLength(), GetWidth(), and IsStraight().
Referenced by carla::road::MapBuilder::GetLaneNext().
|
inline |
Definition at line 94 of file Lane.h.
References _prev_lanes.
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().
|
inline |
Definition at line 98 of file Lane.h.
References _successor.
Referenced by carla::road::MapBuilder::GetLaneNext().
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().
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().
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().
|
private |
|
private |
Definition at line 130 of file Lane.h.
Referenced by GetInfo(), and GetInfos().
|
private |
Definition at line 126 of file Lane.h.
Referenced by GetDistance(), GetInfo(), GetInfos(), GetLaneSection(), and GetRoad().
|
private |
Definition at line 134 of file Lane.h.
Referenced by GetLevel().
|
private |
Definition at line 140 of file Lane.h.
Referenced by GetNextLanes().
|
private |
Definition at line 138 of file Lane.h.
Referenced by GetPredecessor().
|
private |
Definition at line 142 of file Lane.h.
Referenced by GetPreviousLanes().
|
private |
Definition at line 136 of file Lane.h.
Referenced by GetSuccessor().
|
private |