CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
opendrive
OpenDriveParser.cpp
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
#include "
carla/opendrive/OpenDriveParser.h
"
8
9
#include "
carla/Logging.h
"
10
#include "
carla/opendrive/parser/ControllerParser.h
"
11
#include "
carla/opendrive/parser/GeoReferenceParser.h
"
12
#include "
carla/opendrive/parser/GeometryParser.h
"
13
#include "
carla/opendrive/parser/JunctionParser.h
"
14
#include "
carla/opendrive/parser/LaneParser.h
"
15
#include "
carla/opendrive/parser/ObjectParser.h
"
16
#include "
carla/opendrive/parser/ProfilesParser.h
"
17
#include "
carla/opendrive/parser/RoadParser.h
"
18
#include "
carla/opendrive/parser/SignalParser.h
"
19
#include "
carla/opendrive/parser/TrafficGroupParser.h
"
20
#include "
carla/road/MapBuilder.h
"
21
22
#include <
third-party/pugixml/pugixml.hpp
>
23
24
namespace
carla
{
25
namespace
opendrive
{
26
27
std::optional<road::Map>
OpenDriveParser::Load
(
const
std::string &
opendrive
) {
28
pugi::xml_document
xml;
29
pugi::xml_parse_result
parse_result = xml.
load_string
(
opendrive
.c_str());
30
31
if
(parse_result ==
false
) {
32
log_error(
"unable to parse the OpenDRIVE XML string"
);
33
return
{};
34
}
35
36
carla::road::MapBuilder
map_builder;
37
38
parser::GeoReferenceParser::Parse
(xml, map_builder);
39
parser::RoadParser::Parse
(xml, map_builder);
40
parser::JunctionParser::Parse
(xml, map_builder);
41
parser::GeometryParser::Parse
(xml, map_builder);
42
parser::LaneParser::Parse
(xml, map_builder);
43
parser::ProfilesParser::Parse
(xml, map_builder);
44
parser::TrafficGroupParser::Parse
(xml, map_builder);
45
parser::SignalParser::Parse
(xml, map_builder);
46
parser::ObjectParser::Parse
(xml, map_builder);
47
parser::ControllerParser::Parse
(xml, map_builder);
48
49
return
map_builder.
Build
();
50
}
51
52
}
// namespace opendrive
53
}
// namespace carla
ControllerParser.h
GeoReferenceParser.h
GeometryParser.h
JunctionParser.h
LaneParser.h
Logging.h
MapBuilder.h
ObjectParser.h
OpenDriveParser.h
ProfilesParser.h
RoadParser.h
SignalParser.h
TrafficGroupParser.h
carla::opendrive::OpenDriveParser::Load
static std::optional< road::Map > Load(const std::string &opendrive)
Definition
OpenDriveParser.cpp:27
carla::opendrive::parser::ControllerParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
ControllerParser.cpp:17
carla::opendrive::parser::GeoReferenceParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
GeoReferenceParser.cpp:328
carla::opendrive::parser::GeometryParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
GeometryParser.cpp:61
carla::opendrive::parser::JunctionParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
JunctionParser.cpp:17
carla::opendrive::parser::LaneParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
LaneParser.cpp:191
carla::opendrive::parser::ObjectParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
ObjectParser.cpp:19
carla::opendrive::parser::ProfilesParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
ProfilesParser.cpp:46
carla::opendrive::parser::RoadParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
RoadParser.cpp:114
carla::opendrive::parser::SignalParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
SignalParser.cpp:31
carla::opendrive::parser::TrafficGroupParser::Parse
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
Definition
TrafficGroupParser.cpp:27
carla::road::MapBuilder
Definition
MapBuilder.h:22
carla::road::MapBuilder::Build
std::optional< Map > Build()
Definition
MapBuilder.cpp:40
pugi::xml_document
Definition
pugixml.hpp:997
pugi::xml_document::load_string
xml_parse_result load_string(const char_t *contents, unsigned int options=parse_default)
Definition
pugixml.cpp:7091
carla::opendrive
Definition
OpenDriveParser.cpp:25
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
pugixml.hpp
pugi::xml_parse_result
Definition
pugixml.hpp:975
Generated by
1.18.0