24 return lane_id > 0 ? lane_id + 1 : lane_id - 1;
32 if (std::abs(lane_id) == 1) {
35 return lane_id > 0 ? lane_id - 1 : lane_id + 1;
45 return (
static_cast<uint64_t
>(
_road_id) << 32) ^
47 static_cast<uint64_t
>(
static_cast<uint16_t
>(
_lane_id));
109 std::vector<SharedPtr<Lane>> result;
111 if (lane ==
nullptr || lane->GetLaneSection() ==
nullptr || lane->GetRoad() ==
nullptr) {
114 result.emplace_back(
_parent->GetLane(
115 lane->GetRoad()->GetId(), lane->GetLaneSection()->GetId(), lane->GetId()));
121 std::vector<SharedPtr<Lane>> result;
123 if (lane ==
nullptr || lane->GetLaneSection() ==
nullptr || lane->GetRoad() ==
nullptr) {
126 result.emplace_back(
_parent->GetLane(
127 lane->GetRoad()->GetId(), lane->GetLaneSection()->GetId(), lane->GetId()));
135 const double end = start + lane.
GetLength();
136 if (s < start || s > end) {
144 std::vector<SharedPtr<Waypoint>> result;
150 const double end = start + lane.
GetLength();
151 for (
double s = start; s < end; s +=
distance) {
152 result.emplace_back(
_parent->MakeWaypoint(
SharedPtr< Lane > GetRightLane() const
The lane to the right, or nullptr at the edge of the road.
road::Lane::LaneType GetType() const
double GetDistance() const
The s coordinate, along the road, at which this lane's section begins.
std::vector< SharedPtr< Waypoint > > GetWaypoints(double distance) const
Waypoints along this lane, every distance metres.
SharedPtr< const Map > _parent
road::SectionId _section_id
double GetLength() const
Length of the lane, in metres.
SharedPtr< Road > GetRoad() const
SharedPtr< LaneSection > GetSection() const
std::vector< SharedPtr< Lane > > GetPreviousLanes() const
Lanes leading into this one.
SharedPtr< Lane > GetLeftLane() const
The lane to the left, or nullptr. See GetRightLane() on direction.
std::vector< SharedPtr< Lane > > GetNextLanes() const
Lanes this one leads into. Empty where the lane ends.
double GetWidth(double s) const
Lane width at the given s, in metres.
uint64_t GetUniqueId() const
Unique id of this lane within its map, for use as a dictionary key.
bool IsPositiveDirection() const
Whether the lane runs along increasing s (a right-hand lane, id < 0).
SharedPtr< Waypoint > GetWaypoint(double s) const
The waypoint on this lane at road coordinate s, or nullptr when s falls outside the lane.
geom::Transform GetTransform(double s) const
const road::Lane & GetLane() const
The underlying OpenDRIVE lane. Valid only while _parent is alive.
bool IsStraight() const
Checks whether the geometry is straight or not.
const std::vector< Lane * > & GetNextLanes() const
double GetWidth(const double s) const
Returns the total lane width given a s.
geom::Transform ComputeTransform(const double s) const
LaneType
Can be used as flags.
double GetDistance() const
const std::vector< Lane * > & GetPreviousLanes() const
bool IsPositiveDirection() const
Lane & GetLaneById(SectionId section_id, LaneId lane_id)
static road::LaneId StepInward(road::LaneId lane_id)
static road::LaneId StepOutward(road::LaneId lane_id)
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr