#include <Road.h>
Public Member Functions | |
element::DirectedPoint | GetDirectedPointIn (const double s) const |
Returns a directed point on the center of the road (lane 0), with the corresponding laneOffset and elevation records applied, on distance "s". More... | |
element::DirectedPoint | GetDirectedPointInNoLaneOffset (const double s) const |
Returns a directed point on the center of the road (lane 0), with the corresponding laneOffset and elevation records applied, on distance "s". More... | |
const geom::CubicPolynomial & | GetElevationOn (const double s) const |
LaneSection * | GetEndSection (LaneId id) |
Get the end section (from road coordinates s) given a lane id. More... | |
RoadId | GetId () const |
template<typename T > | |
const T * | GetInfo (const double s) const |
template<typename T > | |
std::vector< const T * > | GetInfos () const |
template<typename T > | |
std::vector< const T * > | GetInfosInRange (const double min_s, const double max_s) const |
JuncId | GetJunctionId () const |
Lane & | GetLaneByDistance (double s, LaneId lane_id) |
const Lane & | GetLaneByDistance (double s, LaneId lane_id) const |
Lane & | GetLaneById (SectionId section_id, LaneId lane_id) |
const Lane & | GetLaneById (SectionId section_id, LaneId lane_id) const |
std::map< LaneId, const Lane * > | GetLanesAt (const double s) const |
Get all lanes at a given s. More... | |
std::vector< Lane * > | GetLanesByDistance (double s) |
Get all lanes from all lane sections in a specific s. More... | |
std::vector< const Lane * > | GetLanesByDistance (double s) const |
LaneSection & | GetLaneSectionById (SectionId id) |
const LaneSection & | GetLaneSectionById (SectionId id) const |
auto | GetLaneSections () const |
auto | GetLaneSectionsAt (const double s) |
auto | GetLaneSectionsAt (const double s) const |
double | GetLength () const |
const MapData * | GetMap () const |
std::string | GetName () const |
const std::pair< const Lane *, double > | GetNearestLane (const double s, const geom::Location &loc, uint32_t type=static_cast< uint32_t >(Lane::LaneType::Any)) const |
Returns a pointer to the nearest lane, given s relative to Road and a location. More... | |
const std::pair< double, double > | GetNearestPoint (const geom::Location &loc) const |
Returns a pair containing: More... | |
Lane * | GetNextLane (const double s, const LaneId lane_id) |
std::vector< Road * > | GetNexts () const |
RoadId | GetPredecessor () const |
Lane * | GetPrevLane (const double s, const LaneId lane_id) |
std::vector< Road * > | GetPrevs () const |
LaneSection * | GetStartSection (LaneId id) |
Get the start section (from road coordinates s) given a lane id. More... | |
RoadId | GetSuccessor () const |
bool | IsJunction () const |
Road ()=default | |
double | UpperBound (double s) const |
Return the upper bound "s", i.e., the end distance of the lane section at s (clamped at road's length). More... | |
Static Private Member Functions | |
template<typename MultiMapT > | |
static auto | GetLessEqualRange (MultiMapT &map, double s) |
Private Attributes | |
RoadId | _id { 0 } |
InformationSet | _info |
bool | _is_junction { false } |
JuncId | _junction_id { -1 } |
LaneSectionMap | _lane_sections |
double | _length { 0.0 } |
MapData * | _map_data { nullptr } |
std::string | _name |
std::vector< Road * > | _nexts |
RoadId | _predecessor { 0 } |
std::vector< Road * > | _prevs |
RoadId | _successor { 0 } |
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 |
|
default |
element::DirectedPoint carla::road::Road::GetDirectedPointIn | ( | const double | s | ) | const |
Returns a directed point on the center of the road (lane 0), with the corresponding laneOffset and elevation records applied, on distance "s".
Definition at line 180 of file Road.cpp.
References _info, _length, carla::road::element::DirectedPoint::ApplyLateralOffset(), carla::geom::Math::Clamp(), GetElevationOn(), carla::road::InformationSet::GetInfo(), carla::road::element::DirectedPoint::location, carla::road::element::DirectedPoint::pitch, and carla::geom::Vector3D::z.
Referenced by carla::road::Lane::ComputeTransform(), carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::road::Lane::GetCornerPositions(), and GetNearestLane().
element::DirectedPoint carla::road::Road::GetDirectedPointInNoLaneOffset | ( | const double | s | ) | const |
Returns a directed point on the center of the road (lane 0), with the corresponding laneOffset and elevation records applied, on distance "s".
Definition at line 202 of file Road.cpp.
References _info, _length, carla::geom::Math::Clamp(), GetElevationOn(), and carla::road::InformationSet::GetInfo().
Referenced by carla::road::MapBuilder::ComputeSignalTransform().
const geom::CubicPolynomial & carla::road::Road::GetElevationOn | ( | const double | s | ) | const |
Definition at line 66 of file Road.cpp.
References carla::throw_exception().
Referenced by GetDirectedPointIn(), and GetDirectedPointInNoLaneOffset().
LaneSection * carla::road::Road::GetEndSection | ( | LaneId | id | ) |
Get the end section (from road coordinates s) given a lane id.
Definition at line 167 of file Road.cpp.
References _lane_sections.
Referenced by carla::road::MapBuilder::GetEdgeLanePointer().
RoadId carla::road::Road::GetId | ( | ) | const |
Definition at line 30 of file Road.cpp.
References _id.
Referenced by carla::road::MapBuilder::AddSignal(), carla::road::MapBuilder::AddSignalReference(), carla::road::ForEachDrivableLane(), carla::road::ForEachDrivableLaneAt(), and carla::road::ForEachLane().
|
inline |
Definition at line 113 of file Road.h.
References _info, and carla::road::InformationSet::GetInfo().
Referenced by carla::road::Lane::ComputeTransform(), and carla::road::Lane::IsStraight().
|
inline |
Definition at line 118 of file Road.h.
References _info, and carla::road::InformationSet::GetInfos().
Referenced by carla::road::Lane::IsStraight().
|
inline |
Definition at line 123 of file Road.h.
References _info, and carla::road::InformationSet::GetInfos().
JuncId carla::road::Road::GetJunctionId | ( | ) | const |
Definition at line 46 of file Road.cpp.
References _junction_id.
Definition at line 74 of file Road.cpp.
References GetLaneSectionsAt(), and carla::throw_exception().
Referenced by carla::road::MapBuilder::GetLane(), and GetLaneByDistance().
Definition at line 84 of file Road.cpp.
References GetLaneByDistance().
Definition at line 110 of file Road.cpp.
References carla::road::LaneSection::GetLanes(), and GetLaneSectionById().
Referenced by carla::road::Map::GetLane(), GetLaneById(), and carla::road::MapData::GetLaneInfo().
Definition at line 114 of file Road.cpp.
References GetLaneById().
Get all lanes at a given s.
Definition at line 307 of file Road.cpp.
References GetLaneSectionsAt().
Referenced by GetNearestLane(), and UpperBound().
std::vector< Lane * > carla::road::Road::GetLanesByDistance | ( | double | s | ) |
Get all lanes from all lane sections in a specific s.
Definition at line 88 of file Road.cpp.
References GetLaneSectionsAt().
Referenced by carla::road::MapBuilder::GenerateDefaultValiditiesForSignalReferences().
std::vector< const Lane * > carla::road::Road::GetLanesByDistance | ( | double | s | ) | const |
Definition at line 99 of file Road.cpp.
References GetLaneSectionsAt().
|
inline |
Definition at line 163 of file Road.h.
References _lane_sections, and carla::road::LaneSectionMap::GetById().
Referenced by GetLaneById(), and carla::road::IsLanePresent().
|
inline |
Definition at line 167 of file Road.h.
References _lane_sections, and carla::road::LaneSectionMap::GetById().
|
inline |
Definition at line 127 of file Road.h.
References _lane_sections, carla::iterator::make_map_values_const_iterator(), and carla::MakeListView().
Referenced by carla::road::ForEachDrivableLane(), carla::road::ForEachLane(), carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLaneMarkForRoad(), carla::geom::MeshFactory::GenerateOrderedWithMaxLen(), carla::geom::MeshFactory::GenerateWallsWithMaxLen(), and carla::geom::MeshFactory::GenerateWithMaxLen().
|
inline |
Definition at line 149 of file Road.h.
References _lane_sections, GetLessEqualRange(), carla::iterator::make_map_values_iterator(), and carla::MakeListView().
Referenced by carla::road::ForEachDrivableLaneAt(), GetLaneByDistance(), GetLanesAt(), GetLanesByDistance(), and carla::road::Map::GetWaypoint().
|
inline |
Definition at line 156 of file Road.h.
References _lane_sections, GetLessEqualRange(), carla::iterator::make_map_values_const_iterator(), and carla::MakeListView().
double carla::road::Road::GetLength | ( | ) | const |
Definition at line 38 of file Road.cpp.
References _length.
Referenced by carla::road::MapBuilder::AddSignalReference(), and carla::road::Map::GetWaypoint().
|
inlinestaticprivate |
Definition at line 136 of file Road.h.
Referenced by GetLaneSectionsAt().
const MapData * carla::road::Road::GetMap | ( | ) | const |
std::string carla::road::Road::GetName | ( | ) | const |
const std::pair< const Lane *, double > carla::road::Road::GetNearestLane | ( | const double | s, |
const geom::Location & | loc, | ||
uint32_t | type = static_cast<uint32_t>(Lane::LaneType::Any) |
||
) | const |
Returns a pointer to the nearest lane, given s relative to Road and a location.
dist | distance from the begining of the road to the point you want to calculate the distance |
loc | point to calculate the distance |
Definition at line 241 of file Road.cpp.
References carla::road::element::DirectedPoint::ApplyLateralOffset(), carla::geom::Math::Distance(), GetDirectedPointIn(), GetLanesAt(), carla::road::element::DirectedPoint::location, and carla::MakeListView().
const std::pair< double, double > carla::road::Road::GetNearestPoint | ( | const geom::Location & | loc | ) | const |
Returns a pair containing:
loc | point to calculate the distance |
Definition at line 216 of file Road.cpp.
References _info, DEBUG_ASSERT, and carla::road::InformationSet::GetInfos().
Definition at line 119 of file Road.cpp.
References _lane_sections.
Referenced by carla::road::MapBuilder::GetLaneNext().
std::vector< Road * > carla::road::Road::GetNexts | ( | ) | const |
RoadId carla::road::Road::GetPredecessor | ( | ) | const |
Definition at line 54 of file Road.cpp.
References _predecessor.
Referenced by carla::road::MapBuilder::GetLaneNext().
Definition at line 136 of file Road.cpp.
References _lane_sections.
Referenced by carla::road::MapBuilder::GetLaneNext().
std::vector< Road * > carla::road::Road::GetPrevs | ( | ) | const |
LaneSection * carla::road::Road::GetStartSection | ( | LaneId | id | ) |
Get the start section (from road coordinates s) given a lane id.
Definition at line 154 of file Road.cpp.
References _lane_sections.
Referenced by carla::road::MapBuilder::GetEdgeLanePointer().
RoadId carla::road::Road::GetSuccessor | ( | ) | const |
Definition at line 50 of file Road.cpp.
References _successor.
Referenced by carla::road::MapBuilder::GetLaneNext().
bool carla::road::Road::IsJunction | ( | ) | const |
Definition at line 42 of file Road.cpp.
References _is_junction.
Referenced by carla::geom::MeshFactory::GenerateAllWithMaxLen(), and carla::road::Lane::GetCornerPositions().
|
inline |
Return the upper bound "s", i.e., the end distance of the lane section at s (clamped at road's length).
Definition at line 173 of file Road.h.
References _lane_sections, _length, and GetLanesAt().
|
private |
|
private |
Definition at line 203 of file Road.h.
Referenced by GetDirectedPointIn(), GetDirectedPointInNoLaneOffset(), GetInfo(), GetInfos(), GetInfosInRange(), and GetNearestPoint().
|
private |
Definition at line 193 of file Road.h.
Referenced by IsJunction().
|
private |
Definition at line 195 of file Road.h.
Referenced by GetJunctionId().
|
private |
Definition at line 197 of file Road.h.
Referenced by carla::road::MapBuilder::AddRoadSection(), GetEndSection(), carla::road::MapBuilder::GetLaneNext(), GetLaneSectionById(), GetLaneSections(), GetLaneSectionsAt(), GetNextLane(), GetPrevLane(), GetStartSection(), and UpperBound().
|
private |
Definition at line 191 of file Road.h.
Referenced by GetDirectedPointIn(), GetDirectedPointInNoLaneOffset(), GetLength(), and UpperBound().
|
private |
Definition at line 185 of file Road.h.
Referenced by carla::road::MapBuilder::AddRoad(), and GetMap().
|
private |
|
private |
Definition at line 205 of file Road.h.
Referenced by GetNexts().
|
private |
Definition at line 201 of file Road.h.
Referenced by GetPredecessor().
|
private |
Definition at line 207 of file Road.h.
Referenced by GetPrevs().
|
private |
Definition at line 199 of file Road.h.
Referenced by GetSuccessor().