CARLA
Loading...
Searching...
No Matches
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
16namespace twinmodel {
17
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
42 };
43
44 /// OSM ways -> roads, lanes and junctions in model space. The C++ port of
45 /// twinmodel/lanegraph.py's build_lanegraph.
47 const OsmData &osm,
48 const LocalFrame &frame,
49 const std::string &name,
50 const LaneGraphOptions &options = LaneGraphOptions());
51
52} // namespace twinmodel
WGS84 <-> local ENU metres, a transverse Mercator centred on the origin.
Definition Frame.h:15
TwinModelData BuildLaneGraph(const OsmData &osm, const LocalFrame &frame, const std::string &name, const LaneGraphOptions &options)
OSM ways -> roads, lanes and junctions in model space.
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
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
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
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
double uturn_deg
Turns sharper than this are U-turns and get no connection; the profile's JunctionRules....
Definition LaneGraph.h:34
Everything the OpenDRIVE writer reads.
Definition Model.h:158