20#include <unordered_set>
58 std::vector<SharedPtr<Road>> result;
59 std::unordered_set<road::RoadId> seen;
61 if (
road ==
nullptr || !seen.insert(
road->GetId()).second) {
64 result.emplace_back(
_parent->GetRoad(
road->GetId()));
70 std::vector<SharedPtr<Road>> result;
71 std::unordered_set<road::RoadId> seen;
73 if (
road ==
nullptr || !seen.insert(
road->GetId()).second) {
76 result.emplace_back(
_parent->GetRoad(
road->GetId()));
82 std::vector<SharedPtr<Lane>> result;
85 if (lane ==
nullptr || lane->GetId() == 0 || lane->GetLaneSection() ==
nullptr) {
88 if ((
static_cast<int32_t
>(lane->GetType()) &
static_cast<int32_t
>(type)) == 0) {
91 result.emplace_back(
_parent->GetLane(
92 _road_id, lane->GetLaneSection()->GetId(), lane->GetId()));
103 if (section ==
nullptr) {
110 std::vector<SharedPtr<LaneSection>> result;
112 result.emplace_back(
_parent->GetLaneSection(
_road_id, section.GetId()));
129 if (covering ==
nullptr) {
148 directed_point.tangent *= -1.0;
150 directed_point.location,
160 std::vector<SharedPtr<Waypoint>> result;
163 if (waypoint !=
nullptr) {
164 result.emplace_back(std::move(waypoint));
173 std::vector<SharedPtr<Waypoint>> result;
178 for (
double s = 0.0; s < length; s +=
distance) {
180 result.emplace_back(std::move(waypoint));
std::map< std::string, unsigned int > road
std::vector< SharedPtr< LaneSection > > GetSections() const
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.
road::JuncId GetJunctionId() const
Id of the junction this road belongs to, or -1 when it is not part of one.
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.
SharedPtr< const Map > _parent
SharedPtr< Junction > GetJunction() const
The junction this road belongs to, or nullptr when it is not part of one.
geom::Transform GetTransformAt(double s) const
Transform at the centre of the road at road coordinate 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.
bool IsRHT() const
Whether traffic on this road drives on the right.
std::vector< SharedPtr< Road > > GetPreviousRoads() const
Roads that lead into this one.
road::RoadId GetSuccessorId() const
Id of the road that follows this one, as recorded in OpenDRIVE.
SharedPtr< LaneSection > GetSectionAt(double s) const
The lane section covering road coordinate s, or nullptr.
SharedPtr< Lane > GetLane(road::SectionId section_id, road::LaneId lane_id) const
double GetLength() const
Length of the road, in metres.
SharedPtr< LaneSection > GetSection(road::SectionId section_id) const
SharedPtr< Lane > GetLaneAt(double s, road::LaneId lane_id) const
The lane with this id in whichever section covers s.
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.
static constexpr T ToDegrees(T rad)
Euler angles of a rotation in CARLA's / Unreal's left-handed frame: x forward, y right,...
LaneType
Can be used as flags.
Road & GetRoad(const RoadId id)
RoadId GetPredecessor() const
std::vector< Road * > GetPrevs() const
RoadId GetSuccessor() const
std::vector< Road * > GetNexts() const
auto GetLaneSections() const
element::DirectedPoint GetDirectedPointIn(const double s) const
Returns a directed point on the center of the road (lane 0), with the corresponding laneOffset and el...
JuncId GetJunctionId() const
std::string GetName() const
const MapData * GetMap() const
const road::Road & GetRoadData(const SharedPtr< const Map > &parent, road::RoadId road_id)
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr