CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
osm2odr
LaneGraph.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 <optional>
10
#include <string>
11
12
#include "
Frame.h
"
13
#include "
Model.h
"
14
#include "
OsmIngest.h
"
15
16
namespace
twinmodel
{
17
18
struct
LaneGraphOptions
{
19
/// Ways shorter than this are merged into their neighbour rather than
20
/// becoming a road of their own.
21
double
min_road_length
= 1.0;
22
23
/// Radius around a junction node that the incoming roads are trimmed back
24
/// by, so the connecting roads have room to turn.
25
double
junction_radius
= 6.0;
26
27
/// Two intersection nodes join one junction when a chain shorter than this
28
/// links them and they are closer than this; profiles.py's
29
/// JunctionRules.cluster_m, 30 m for the dense European profile.
30
double
cluster_m
= 30.0;
31
32
/// Turns sharper than this are U-turns and get no connection; the
33
/// profile's JunctionRules.uturn_deg.
34
double
uturn_deg
= 150.0;
35
36
/// Clip the network to this box in model metres, as the Python pipeline
37
/// clips to the requested bbox. Empty keeps every way whole.
38
std::optional<geom::Box>
clip
;
39
40
bool
generate_traffic_lights
=
false
;
41
bool
all_junctions_traffic_lights
=
false
;
42
};
43
44
/// OSM ways -> roads, lanes and junctions in model space. The C++ port of
45
/// twinmodel/lanegraph.py's build_lanegraph.
46
TwinModelData
BuildLaneGraph
(
47
const
OsmData
&osm,
48
const
LocalFrame
&frame,
49
const
std::string &name,
50
const
LaneGraphOptions
&options =
LaneGraphOptions
());
51
52
}
// namespace twinmodel
Frame.h
Model.h
OsmIngest.h
twinmodel::LocalFrame
WGS84 <-> local ENU metres, a transverse Mercator centred on the origin.
Definition
Frame.h:15
twinmodel
Definition
Frame.cpp:12
twinmodel::BuildLaneGraph
TwinModelData BuildLaneGraph(const OsmData &osm, const LocalFrame &frame, const std::string &name, const LaneGraphOptions &options)
OSM ways -> roads, lanes and junctions in model space.
Definition
LaneGraph.cpp:339
twinmodel::LaneGraphOptions
Definition
LaneGraph.h:18
twinmodel::LaneGraphOptions::clip
std::optional< geom::Box > clip
Clip the network to this box in model metres, as the Python pipeline clips to the requested bbox.
Definition
LaneGraph.h:38
twinmodel::LaneGraphOptions::all_junctions_traffic_lights
bool all_junctions_traffic_lights
Definition
LaneGraph.h:41
twinmodel::LaneGraphOptions::junction_radius
double junction_radius
Radius around a junction node that the incoming roads are trimmed back by, so the connecting roads ha...
Definition
LaneGraph.h:25
twinmodel::LaneGraphOptions::cluster_m
double cluster_m
Two intersection nodes join one junction when a chain shorter than this links them and they are close...
Definition
LaneGraph.h:30
twinmodel::LaneGraphOptions::min_road_length
double min_road_length
Ways shorter than this are merged into their neighbour rather than becoming a road of their own.
Definition
LaneGraph.h:21
twinmodel::LaneGraphOptions::generate_traffic_lights
bool generate_traffic_lights
Definition
LaneGraph.h:40
twinmodel::LaneGraphOptions::uturn_deg
double uturn_deg
Turns sharper than this are U-turns and get no connection; the profile's JunctionRules....
Definition
LaneGraph.h:34
twinmodel::OsmData
Definition
OsmIngest.h:50
twinmodel::TwinModelData
Everything the OpenDRIVE writer reads.
Definition
Model.h:158
Generated by
1.18.0