CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
client
client/Junction.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "
carla/Memory.h
"
10
#include "
carla/NonCopyable.h
"
11
#include "
carla/road/Junction.h
"
12
#include "
carla/road/RoadTypes.h
"
13
#include "
carla/geom/BoundingBox.h
"
14
#include "
carla/client/Waypoint.h
"
15
16
#include <vector>
17
18
namespace
carla
{
19
namespace
client
{
20
21
class
Map
;
22
class
Road
;
23
class
Lane
;
24
25
class
Junction
26
:
public
EnableSharedFromThis
<Junction>,
27
private
NonCopyable
28
{
29
public
:
30
31
carla::road::JuncId
GetId
()
const
{
32
return
_id
;
33
}
34
35
std::vector<std::pair<SharedPtr<Waypoint>,
SharedPtr<Waypoint>
>>
GetWaypoints
(
36
road::Lane::LaneType
type =
road::Lane::LaneType::Driving
)
const
;
37
38
geom::BoundingBox
GetBoundingBox
()
const
;
39
40
/// The roads *inside* the junction, carrying traffic through it. This is
41
/// OpenDRIVE's "connecting road"; the name is kept so the API agrees with
42
/// the .xodr.
43
std::vector<SharedPtr<Road>>
GetConnectingRoads
()
const
;
44
45
/// The roads *outside* the junction that meet it. OpenDRIVE calls these
46
/// "incoming", but a road has no inherent direction -- the same road is an
47
/// exit for traffic going the other way -- so they are adjacent here.
48
std::vector<SharedPtr<Road>>
GetAdjacentRoads
()
const
;
49
50
/// Lanes on the adjacent roads that feed into the junction.
51
std::vector<SharedPtr<Lane>>
GetEntryLanes
(
52
road::Lane::LaneType
type =
road::Lane::LaneType::Driving
)
const
;
53
54
/// Lanes on the adjacent roads that the junction feeds into.
55
std::vector<SharedPtr<Lane>>
GetExitLanes
(
56
road::Lane::LaneType
type =
road::Lane::LaneType::Driving
)
const
;
57
58
/// One waypoint per entry lane, on the adjacent road where it meets the
59
/// junction. Outside the junction, like GetEntryLanes(); for the waypoints
60
/// on the connecting roads inside it, use GetWaypoints().
61
std::vector<SharedPtr<Waypoint>>
GetEntryWaypoints
(
62
road::Lane::LaneType
type =
road::Lane::LaneType::Driving
)
const
;
63
64
/// One waypoint per exit lane, on the adjacent road where it leaves the
65
/// junction.
66
std::vector<SharedPtr<Waypoint>>
GetExitWaypoints
(
67
road::Lane::LaneType
type =
road::Lane::LaneType::Driving
)
const
;
68
69
private
:
70
71
friend
class
Map
;
72
73
/// Shared implementation of GetEntryLanes / GetExitLanes.
74
std::vector<SharedPtr<Lane>>
GetNeighbourLanes
(
75
road::Lane::LaneType
type,
76
bool
entering)
const
;
77
78
/// Shared implementation of GetEntryWaypoints / GetExitWaypoints.
79
std::vector<SharedPtr<Waypoint>>
GetNeighbourWaypoints
(
80
road::Lane::LaneType
type,
81
bool
entering)
const
;
82
83
Junction
(
SharedPtr<const Map>
parent,
const
road::Junction
*junction);
84
85
SharedPtr<const Map>
_parent
;
86
87
geom::BoundingBox
_bounding_box
;
88
89
road::JuncId
_id
;
90
};
91
92
}
// namespace client
93
}
// namespace carla
NonCopyable.h
BoundingBox.h
Memory.h
RoadTypes.h
carla::NonCopyable::NonCopyable
NonCopyable()=default
carla::client::Junction::GetEntryLanes
std::vector< SharedPtr< Lane > > GetEntryLanes(road::Lane::LaneType type=road::Lane::LaneType::Driving) const
Lanes on the adjacent roads that feed into the junction.
Definition
Junction.cpp:111
carla::client::Junction::GetExitWaypoints
std::vector< SharedPtr< Waypoint > > GetExitWaypoints(road::Lane::LaneType type=road::Lane::LaneType::Driving) const
One waypoint per exit lane, on the adjacent road where it leaves the junction.
Definition
Junction.cpp:154
carla::client::Junction::GetNeighbourLanes
std::vector< SharedPtr< Lane > > GetNeighbourLanes(road::Lane::LaneType type, bool entering) const
Shared implementation of GetEntryLanes / GetExitLanes.
Definition
Junction.cpp:78
carla::client::Junction::GetEntryWaypoints
std::vector< SharedPtr< Waypoint > > GetEntryWaypoints(road::Lane::LaneType type=road::Lane::LaneType::Driving) const
One waypoint per entry lane, on the adjacent road where it meets the junction.
Definition
Junction.cpp:150
carla::client::Junction::Junction
Junction(SharedPtr< const Map > parent, const road::Junction *junction)
Definition
Junction.cpp:19
carla::client::Junction::GetWaypoints
std::vector< std::pair< SharedPtr< Waypoint >, SharedPtr< Waypoint > > > GetWaypoints(road::Lane::LaneType type=road::Lane::LaneType::Driving) const
Definition
Junction.cpp:24
carla::client::Junction::GetNeighbourWaypoints
std::vector< SharedPtr< Waypoint > > GetNeighbourWaypoints(road::Lane::LaneType type, bool entering) const
Shared implementation of GetEntryWaypoints / GetExitWaypoints.
Definition
Junction.cpp:137
carla::client::Junction::GetBoundingBox
geom::BoundingBox GetBoundingBox() const
Definition
Junction.cpp:29
carla::client::Junction::GetExitLanes
std::vector< SharedPtr< Lane > > GetExitLanes(road::Lane::LaneType type=road::Lane::LaneType::Driving) const
Lanes on the adjacent roads that the junction feeds into.
Definition
Junction.cpp:115
carla::client::Junction::GetAdjacentRoads
std::vector< SharedPtr< Road > > GetAdjacentRoads() const
The roads outside the junction that meet it.
Definition
Junction.cpp:53
carla::client::Junction::GetId
carla::road::JuncId GetId() const
Definition
client/Junction.h:31
carla::client::Junction::_bounding_box
geom::BoundingBox _bounding_box
Definition
client/Junction.h:87
carla::client::Junction::Map
friend class Map
Definition
client/Junction.h:71
carla::client::Junction::_parent
SharedPtr< const Map > _parent
Definition
client/Junction.h:85
carla::client::Junction::GetConnectingRoads
std::vector< SharedPtr< Road > > GetConnectingRoads() const
The roads inside the junction, carrying traffic through it.
Definition
Junction.cpp:33
carla::client::Junction::_id
road::JuncId _id
Definition
client/Junction.h:89
carla::client::Lane
A single OpenDRIVE lane, identified by (road id, lane section id, lane id).
Definition
client/Lane.h:37
carla::client::Map
Definition
client/Map.h:32
carla::client::Road
An OpenDRIVE road: a run of carriageway divided along s into lane sections, each holding the lanes.
Definition
client/Road.h:36
carla::geom::BoundingBox
Definition
LibCarla/source/carla/geom/BoundingBox.h:26
carla::road::Junction
Definition
road/Junction.h:23
carla::road::Lane::LaneType
LaneType
Can be used as flags.
Definition
road/Lane.h:29
carla::road::Lane::LaneType::Driving
@ Driving
Definition
road/Lane.h:31
Waypoint.h
carla::client
Definition
BasicAgent.h:24
carla::road::JuncId
int32_t JuncId
Definition
RoadTypes.h:17
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::EnableSharedFromThis
std::enable_shared_from_this< T > EnableSharedFromThis
Definition
Memory.h:21
carla::SharedPtr
std::shared_ptr< T > SharedPtr
Definition
Memory.h:15
Junction.h
Generated by
1.18.0