Skip to content

MarcelBruckner-TUMProjects/OpenDRIVE

Repository files navigation

OpenDRIVE


Overview

This serves as an OpenDRIVE parser for my Guided Research at the Providentia++ project. The parser extracts the world positions of landmarks from the OpenDRIVE HD maps that are used within the project.


Setup

Before running any code, you have to download an OpenDRIVE standard. We then generate C++ data bindings for the XSD files.

For instructions and convenience scripts see:

  • OpenDRIVE 1.4: extern/opendrive_1_4/bootstrap.sh
  • OpenDRIVE 1.6: extern/opendrive_1_6/bootstrap.sh

Get Help

I try to be as close as possible to the naming of the classes and attributes specified in the OpenDRIVE 1.6 standard .
If there are any inconsistencies in the comments or unclear code, please refer to the OpenDRIVE 1.6 standard .
The corresponding parts of the OpenDRIVE 1.6 standard to the implemented class is always linked at the top of the class definition.


Running in Standalone Mode

See below for the necessary dependencies.

Compiling

mkdir build && cd build
cmake ..
cmake --build . -j8

CMake Configure Options

# Default is OFF for all options

-DWITH_TESTS=ON/OFF     # Build with tests.

-DOPENDRIVE_1_4=ON/OFF  # Build with support for the OpenDRIVE 1.4 standard.

-DOPENDRIVE_1_6=ON/OFF  # Build with support for the OpenDRIVE 1.6 standard.

Running

./app/Converter -h  # Prints the help message.
                    # See it for the required input data and further usage.

Testing

ctest --verbose

Dependencies

Dependency Usage Installation Required
Xerces-context++ C++ XML Parser sudo apt install libxerces-c-dev Yes
Code Synthesis XML Data Binding for C++ sudo apt install xsdcxx Yes
PROJ Coordinate transformations and projections sudo apt-get install proj-bin Yes

Internal Dependencies

These dependencies are pulled by CMake when the project is built. You do not have to install them manually.

Dependency Usage Required
YAML-CPP YAML parser Yes
TinyXML-2 XML parser Yes
GoogleTest Google unit testing framework -DWITH_TESTS=ON

Known Issues


XMLNS Attribute

OpenDRIVE 1.4: The parser may fail if the xmlns attribute is set.
OpenDRIVE 1.6: The parser may fail if the xmlns attribute is not exactly set.

Workaround

OpenDRIVE 1.4: Change <OpenDRIVE xmlns="http://www.opendrive.org"> to <OpenDRIVE>.
OpenDRIVE 1.6: The xmlns attribute must be xmlns="http://code.asam.net/simulation/standard/opendrive_schema".


OpenDRIVE 1.6:

Problem

terminate called after throwing an instance of 'xsd::cxx::tree::unexpected_enumerator<char>'
  what():  unexpected enumerator encountered

Solution:

Sometimes there are invalid objects that have the type set to portal. This type is not valid in the standard.
Change all type="portal" to type="none".