|
CARLA
|
An OpenDRIVE road: a run of carriageway divided along s into lane sections, each holding the lanes. More...
#include <Road.h>
Inheritance diagram for carla::client::Road:Public Member Functions | |
| road::RoadId | GetId () const |
| SharedPtr< Junction > | GetJunction () const |
| The junction this road belongs to, or nullptr when it is not part of one. | |
| road::JuncId | GetJunctionId () const |
| Id of the junction this road belongs to, or -1 when it is not part of one. | |
| SharedPtr< Lane > | GetLane (road::SectionId section_id, road::LaneId lane_id) const |
| SharedPtr< Lane > | GetLaneAt (double s, road::LaneId lane_id) const |
| The lane with this id in whichever section covers s. | |
| std::vector< SharedPtr< Lane > > | GetLanes (double s, road::Lane::LaneType type=road::Lane::LaneType::Driving) const |
| Every lane of the given type present at road coordinate s, across every lane section covering it. | |
| double | GetLength () const |
| Length of the road, in metres. | |
| std::string | GetName () const |
| std::vector< SharedPtr< Road > > | GetNextRoads () const |
| Roads reachable by continuing forward. | |
| road::RoadId | GetPredecessorId () const |
| Id of the road that precedes this one, as recorded in OpenDRIVE. | |
| std::vector< SharedPtr< Road > > | GetPreviousRoads () const |
| Roads that lead into this one. | |
| SharedPtr< LaneSection > | GetSection (road::SectionId section_id) const |
| SharedPtr< LaneSection > | GetSectionAt (double s) const |
| The lane section covering road coordinate s, or nullptr. | |
| std::vector< SharedPtr< LaneSection > > | GetSections () const |
| road::RoadId | GetSuccessorId () const |
| Id of the road that follows this one, as recorded in OpenDRIVE. | |
| geom::Transform | GetTransformAt (double s) const |
| Transform at the centre of the road at road coordinate s. | |
| std::vector< SharedPtr< Waypoint > > | GetWaypoints (double distance, road::Lane::LaneType type=road::Lane::LaneType::Driving) const |
| Waypoints sampled along the road every distance metres, on every lane of the given type. | |
| std::vector< SharedPtr< Waypoint > > | GetWaypointsAt (double s, road::Lane::LaneType type=road::Lane::LaneType::Driving) const |
| A cross-section: one waypoint per lane of the given type at s. | |
| bool | IsJunction () const |
| bool | IsRHT () const |
| Whether traffic on this road drives on the right. | |
| bool | operator!= (const Road &rhs) const |
| bool | operator== (const Road &rhs) const |
Private Member Functions | |
| Road (SharedPtr< const Map > parent, road::RoadId road_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 |
Friends | |
| class | Junction |
| class | Lane |
| class | LaneSection |
| class | Map |
| class | Waypoint |
An OpenDRIVE road: a run of carriageway divided along s into lane sections, each holding the lanes.
Roads connect end to end through GetNextRoads() / GetPreviousRoads(), or through a junction. There is deliberately no left/right here: OpenDRIVE gives roads no lateral relation, since a road already contains the lanes on both sides of its centre line. Lateral neighbours live on Lane.
Definition at line 34 of file client/Road.h.
|
inlineprivate |
Definition at line 122 of file client/Road.h.
|
inline |
Definition at line 39 of file client/Road.h.
References _road_id.
The junction this road belongs to, or nullptr when it is not part of one.
Definition at line 135 of file client/Road.cpp.
References _parent, GetJunctionId(), and IsJunction().
| road::JuncId carla::client::Road::GetJunctionId | ( | ) | const |
Id of the junction this road belongs to, or -1 when it is not part of one.
Definition at line 41 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetJunctionId(), and carla::client::GetRoadData().
Referenced by GetJunction().
| SharedPtr< Lane > carla::client::Road::GetLane | ( | road::SectionId | section_id, |
| road::LaneId | lane_id | ||
| ) | const |
Definition at line 97 of file client/Road.cpp.
| SharedPtr< Lane > carla::client::Road::GetLaneAt | ( | double | s, |
| road::LaneId | lane_id | ||
| ) | const |
The lane with this id in whichever section covers s.
Definition at line 101 of file client/Road.cpp.
References _parent, _road_id, and GetSectionAt().
| std::vector< SharedPtr< Lane > > carla::client::Road::GetLanes | ( | double | s, |
| road::Lane::LaneType | type = road::Lane::LaneType::Driving |
||
| ) | const |
Every lane of the given type present at road coordinate s, across every lane section covering it.
Definition at line 81 of file client/Road.cpp.
References _parent, _road_id, carla::client::GetRoadData(), and road.
Referenced by GetWaypointsAt().
| double carla::client::Road::GetLength | ( | ) | const |
Length of the road, in metres.
Definition at line 33 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetLength(), and carla::client::GetRoadData().
Referenced by GetWaypoints().
| std::string carla::client::Road::GetName | ( | ) | const |
Definition at line 29 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetName(), and carla::client::GetRoadData().
Roads reachable by continuing forward.
Definition at line 57 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetNexts(), carla::client::GetRoadData(), and road.
| road::RoadId carla::client::Road::GetPredecessorId | ( | ) | const |
Id of the road that precedes this one, as recorded in OpenDRIVE.
Definition at line 53 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetPredecessor(), and carla::client::GetRoadData().
Roads that lead into this one.
Definition at line 69 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetPrevs(), carla::client::GetRoadData(), and road.
| SharedPtr< LaneSection > carla::client::Road::GetSection | ( | road::SectionId | section_id | ) | const |
Definition at line 117 of file client/Road.cpp.
| SharedPtr< LaneSection > carla::client::Road::GetSectionAt | ( | double | s | ) | const |
The lane section covering road coordinate s, or nullptr.
Definition at line 121 of file client/Road.cpp.
References _parent, _road_id, carla::road::LaneSection::GetId(), carla::client::GetRoadData(), and road.
Referenced by GetLaneAt().
| std::vector< SharedPtr< LaneSection > > carla::client::Road::GetSections | ( | ) | const |
Definition at line 109 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetLaneSections(), and carla::client::GetRoadData().
| road::RoadId carla::client::Road::GetSuccessorId | ( | ) | const |
Id of the road that follows this one, as recorded in OpenDRIVE.
Definition at line 49 of file client/Road.cpp.
References _parent, _road_id, carla::client::GetRoadData(), and carla::road::Road::GetSuccessor().
| geom::Transform carla::client::Road::GetTransformAt | ( | double | s | ) | const |
Transform at the centre of the road at road coordinate s.
Definition at line 142 of file client/Road.cpp.
References _parent, _road_id, carla::road::Road::GetDirectedPointIn(), carla::client::GetRoadData(), carla::road::element::DirectedPoint::location, carla::geom::Math::ToDegrees(), and carla::geom::Vector3D::y.
| std::vector< SharedPtr< Waypoint > > carla::client::Road::GetWaypoints | ( | double | distance, |
| road::Lane::LaneType | type = road::Lane::LaneType::Driving |
||
| ) | const |
Waypoints sampled along the road every distance metres, on every lane of the given type.
Not to be confused with GetWaypointsAt(), which cuts across the road at a single s.
Definition at line 170 of file client/Road.cpp.
References distance, GetLength(), and GetWaypointsAt().
| std::vector< SharedPtr< Waypoint > > carla::client::Road::GetWaypointsAt | ( | double | s, |
| road::Lane::LaneType | type = road::Lane::LaneType::Driving |
||
| ) | const |
A cross-section: one waypoint per lane of the given type at s.
Definition at line 157 of file client/Road.cpp.
References GetLanes().
Referenced by GetWaypoints().
| bool carla::client::Road::IsJunction | ( | ) | const |
Definition at line 37 of file client/Road.cpp.
References _parent, _road_id, carla::client::GetRoadData(), and carla::road::Road::IsJunction().
Referenced by GetJunction().
| bool carla::client::Road::IsRHT | ( | ) | const |
Whether traffic on this road drives on the right.
Definition at line 45 of file client/Road.cpp.
References _parent, _road_id, carla::client::GetRoadData(), and carla::road::Road::IsRHT().
|
inline |
Definition at line 110 of file client/Road.h.
|
inline |
Definition at line 106 of file client/Road.h.
References _road_id.
|
friend |
Definition at line 119 of file client/Road.h.
|
friend |
Definition at line 117 of file client/Road.h.
|
friend |
Definition at line 118 of file client/Road.h.
|
friend |
Definition at line 116 of file client/Road.h.
|
friend |
Definition at line 120 of file client/Road.h.
Definition at line 126 of file client/Road.h.
Referenced by GetJunction(), GetJunctionId(), GetLane(), GetLaneAt(), GetLanes(), GetLength(), GetName(), GetNextRoads(), GetPredecessorId(), GetPreviousRoads(), GetSection(), GetSectionAt(), GetSections(), GetSuccessorId(), GetTransformAt(), IsJunction(), and IsRHT().
|
private |
Definition at line 128 of file client/Road.h.
Referenced by GetId(), GetJunctionId(), GetLane(), GetLaneAt(), GetLanes(), GetLength(), GetName(), GetNextRoads(), GetPredecessorId(), GetPreviousRoads(), GetSection(), GetSectionAt(), GetSections(), GetSuccessorId(), GetTransformAt(), IsJunction(), IsRHT(), and operator==().