|
CARLA
|
A single OpenDRIVE lane, identified by (road id, lane section id, lane id). More...
#include <Lane.h>
Inheritance diagram for carla::client::Lane:Public Member Functions | |
| double | GetDistance () const |
| The s coordinate, along the road, at which this lane's section begins. | |
| road::LaneId | GetId () const |
| SharedPtr< Lane > | GetLeftLane () const |
| The lane to the left, or nullptr. See GetRightLane() on direction. | |
| double | GetLength () const |
| Length of the lane, in metres. | |
| bool | GetLevel () const |
| std::vector< SharedPtr< Lane > > | GetNextLanes () const |
| Lanes this one leads into. Empty where the lane ends. | |
| std::vector< SharedPtr< Lane > > | GetPreviousLanes () const |
| Lanes leading into this one. | |
| SharedPtr< Lane > | GetRightLane () const |
| The lane to the right, or nullptr at the edge of the road. | |
| SharedPtr< Road > | GetRoad () const |
| road::RoadId | GetRoadId () const |
| SharedPtr< LaneSection > | GetSection () const |
| road::SectionId | GetSectionId () const |
| geom::Transform | GetTransform (double s) const |
| road::Lane::LaneType | GetType () const |
| uint64_t | GetUniqueId () const |
| Unique id of this lane within its map, for use as a dictionary key. | |
| SharedPtr< Waypoint > | GetWaypoint (double s) const |
| The waypoint on this lane at road coordinate s, or nullptr when s falls outside the lane. | |
| std::vector< SharedPtr< Waypoint > > | GetWaypoints (double distance) const |
| Waypoints along this lane, every distance metres. | |
| double | GetWidth (double s) const |
| Lane width at the given s, in metres. | |
| bool | IsPositiveDirection () const |
| Whether the lane runs along increasing s (a right-hand lane, id < 0). | |
| bool | IsStraight () const |
| bool | operator!= (const Lane &rhs) const |
| bool | operator== (const Lane &rhs) const |
Private Member Functions | |
| const road::Lane & | GetLane () const |
| The underlying OpenDRIVE lane. Valid only while _parent is alive. | |
| Lane (SharedPtr< const Map > parent, road::RoadId road_id, road::SectionId section_id, road::LaneId lane_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 | |
| road::LaneId | _lane_id |
| SharedPtr< const Map > | _parent |
| road::RoadId | _road_id |
| road::SectionId | _section_id |
Friends | |
| class | Junction |
| class | LaneSection |
| class | Map |
| class | Road |
| class | Waypoint |
A single OpenDRIVE lane, identified by (road id, lane section id, lane id).
A lane lives inside exactly one lane section, which is why its identity carries the section: the same lane id on the same road is a different lane in a different section. Following GetNextLanes() can therefore cross into another section, or return nothing where the lane simply ends.
Like carla::client::Junction, this holds the parent map alive and resolves its ids on each call rather than caching a road::Lane pointer, which would dangle once the map is released.
Definition at line 35 of file client/Lane.h.
|
inlineprivate |
Definition at line 119 of file client/Lane.h.
| double carla::client::Lane::GetDistance | ( | ) | const |
The s coordinate, along the road, at which this lane's section begins.
Definition at line 66 of file client/Lane.cpp.
References carla::road::Lane::GetDistance(), and GetLane().
Referenced by carla::client::JunctionSideDistance().
|
inline |
Definition at line 40 of file client/Lane.h.
References _lane_id.
|
private |
The underlying OpenDRIVE lane. Valid only while _parent is alive.
Definition at line 38 of file client/Lane.cpp.
References _lane_id, _parent, _road_id, _section_id, carla::road::Road::GetLaneById(), and carla::road::Lane::GetRoad().
Referenced by GetDistance(), GetLeftLane(), GetLength(), GetLevel(), GetNextLanes(), GetPreviousLanes(), GetRightLane(), GetTransform(), GetType(), GetWaypoint(), GetWaypoints(), GetWidth(), IsPositiveDirection(), and IsStraight().
The lane to the left, or nullptr. See GetRightLane() on direction.
Definition at line 99 of file client/Lane.cpp.
References _lane_id, _parent, _road_id, _section_id, GetLane(), carla::road::Lane::GetRoad(), carla::road::Road::IsRHT(), carla::client::StepInward(), and carla::client::StepOutward().
| double carla::client::Lane::GetLength | ( | ) | const |
Length of the lane, in metres.
Definition at line 62 of file client/Lane.cpp.
References GetLane(), and carla::road::Lane::GetLength().
Referenced by carla::client::JunctionSideDistance().
| bool carla::client::Lane::GetLevel | ( | ) | const |
Definition at line 70 of file client/Lane.cpp.
References GetLane(), and carla::road::Lane::GetLevel().
Lanes this one leads into. Empty where the lane ends.
Definition at line 108 of file client/Lane.cpp.
References _parent, GetLane(), and carla::road::Lane::GetNextLanes().
Lanes leading into this one.
Definition at line 120 of file client/Lane.cpp.
References _parent, GetLane(), and carla::road::Lane::GetPreviousLanes().
The lane to the right, or nullptr at the edge of the road.
Crossing the centre line flips the sign of the lane id, so the neighbour returned may run in the opposite direction; this matches Waypoint::GetRight().
Definition at line 90 of file client/Lane.cpp.
References _lane_id, _parent, _road_id, _section_id, GetLane(), carla::road::Lane::GetRoad(), carla::road::Road::IsRHT(), carla::client::StepInward(), and carla::client::StepOutward().
Definition at line 54 of file client/Lane.cpp.
|
inline |
Definition at line 44 of file client/Lane.h.
References _road_id.
| SharedPtr< LaneSection > carla::client::Lane::GetSection | ( | ) | const |
Definition at line 58 of file client/Lane.cpp.
References _parent, _road_id, and _section_id.
|
inline |
Definition at line 48 of file client/Lane.h.
References _section_id.
| geom::Transform carla::client::Lane::GetTransform | ( | double | s | ) | const |
Definition at line 86 of file client/Lane.cpp.
References carla::road::Lane::ComputeTransform(), and GetLane().
| road::Lane::LaneType carla::client::Lane::GetType | ( | ) | const |
Definition at line 50 of file client/Lane.cpp.
References GetLane(), and carla::road::Lane::GetType().
| uint64_t carla::client::Lane::GetUniqueId | ( | ) | const |
Unique id of this lane within its map, for use as a dictionary key.
Definition at line 42 of file client/Lane.cpp.
References _lane_id, _road_id, and _section_id.
The waypoint on this lane at road coordinate s, or nullptr when s falls outside the lane.
Definition at line 132 of file client/Lane.cpp.
References _lane_id, _parent, _road_id, _section_id, carla::road::Lane::GetDistance(), GetLane(), and carla::road::Lane::GetLength().
Waypoints along this lane, every distance metres.
Definition at line 143 of file client/Lane.cpp.
References _parent, distance, carla::road::Lane::GetDistance(), GetLane(), and carla::road::Lane::GetLength().
| double carla::client::Lane::GetWidth | ( | double | s | ) | const |
Lane width at the given s, in metres.
s is a road coordinate, not an offset from the start of the lane.
Definition at line 82 of file client/Lane.cpp.
References GetLane(), and carla::road::Lane::GetWidth().
| bool carla::client::Lane::IsPositiveDirection | ( | ) | const |
Whether the lane runs along increasing s (a right-hand lane, id < 0).
Definition at line 78 of file client/Lane.cpp.
References GetLane(), and carla::road::Lane::IsPositiveDirection().
Referenced by carla::client::JunctionSideDistance().
| bool carla::client::Lane::IsStraight | ( | ) | const |
Definition at line 74 of file client/Lane.cpp.
References GetLane(), and carla::road::Lane::IsStraight().
|
inline |
Definition at line 107 of file client/Lane.h.
|
inline |
Definition at line 101 of file client/Lane.h.
References _lane_id, _road_id, and _section_id.
|
friend |
Definition at line 116 of file client/Lane.h.
|
friend |
Definition at line 115 of file client/Lane.h.
|
friend |
Definition at line 113 of file client/Lane.h.
|
friend |
Definition at line 114 of file client/Lane.h.
|
friend |
Definition at line 117 of file client/Lane.h.
|
private |
Definition at line 138 of file client/Lane.h.
Referenced by GetId(), GetLane(), GetLeftLane(), GetRightLane(), GetUniqueId(), GetWaypoint(), and operator==().
Definition at line 132 of file client/Lane.h.
Referenced by GetLane(), GetLeftLane(), GetNextLanes(), GetPreviousLanes(), GetRightLane(), GetRoad(), GetSection(), GetWaypoint(), and GetWaypoints().
|
private |
Definition at line 134 of file client/Lane.h.
Referenced by GetLane(), GetLeftLane(), GetRightLane(), GetRoad(), GetRoadId(), GetSection(), GetUniqueId(), GetWaypoint(), and operator==().
|
private |
Definition at line 136 of file client/Lane.h.
Referenced by GetLane(), GetLeftLane(), GetRightLane(), GetSection(), GetSectionId(), GetUniqueId(), GetWaypoint(), and operator==().