Package: commonroad-reach
CommonRoad-Reach: A Toolbox for Reachability Analysis of Automated VehiclesReachability analysis has gained increasing popularity in motion planning and safeguarding of automated vehicles (AVs).
While existing tools for reachability analysis mainly focus on general-purpose algorithms for formal verification
of dynamical systems, a toolbox tailored to AV-specific applications is not yet available.
The CommonRoad-Reach toolboxintegrates different methods for computing reachable sets using polytopic set propagation and graph-based propagation;provides Python and C++ implementations of the algorithms, thus offering convenient prototyping and real-time computation for the users; andextracts driving corridors which can be used as planning constraints for motion planners.System RequirementsThe software is written in Python 3.7 and C++17, and was tested on Ubuntu 18.04. It should be compatible with later
versions. For building the code, the following minimum versions are required:GCC and G++: version 9 or aboveCMake: version 3.15 or above.Pip: version 21.3 or aboveWe further recommend usingAnacondato manage your virtual python environment.Installation optionsWe provide two installation options for CommonRoad-Reach: Installation as a Python package or building from source.Python Package: Install the python package viapipin your Conda environment:$pipinstallcommonroad-reachBuild from source: To build the project from source and install it in your Conda environment, please refer to the
descriptions below.Building from SourceNote:Currently there appears to be a bug with boost geometry and newer versions of GCC (this seems to start with version 11.4).
A workaround until this is fixed is to use an older version of GCC (we suggest GCC 10).
To do so, indicate the path to the older version of GCC in theCXXenvironment variable before building the code (e.g.export CXX=/usr/bin/g++-10).Third Party DependenciesThe following third-party dependencies of the C++ code are only required for building the project from source!Essential dependencies:CommonRoad Drivability Checker(version >= 2023.1)Boost.GeometryOpenMPyaml-cpppybind11Optional dependencies (testing and documentation):Doctest(optional: for building unit tests)Doxygen(optional: for building documentation)The additional Python dependencies are listed inrequirements.txt.Building the CodeInstall Python dependencies:$pipinstall-rrequirements.txtInstallCommonRoad Drivability Checker. Please refer to itsdocumentationfor installation.Install yaml-cpp and Doctest:$sudoaptupdate
$sudoaptinstalllibyaml-cpp-dev
$sudoaptinstalldoctest-devInstall/upgrade OpenMP:$sudoapt-getinstalllibomp-dev
$sudoaptupgradelibomp-devBuild the package and install it to your conda environment via pip command:$CRDC_DIR="/path/to/commonroad-drivability-checker/"pipinstall-v.This will build the python binding (pycrreach) required for collision checks and other C++-boosted computations.Note:Replace"/path/to/commonroad-drivability-checker/"with the path to the Drivability Checker folder on your machine.The-vflag (verbose) prints information about the build progressOptional:To add unit tests,  set variableADD_TESTS=ONbefore thepipcommand.To build the code in Debug mode, setdebug=1in the setup configuration file (setup.cfg).Getting StartedRun the exemplary scripts to compute reachable sets and extract driving corridors.To compute reachable sets, runcompute_reachable_set.py.To extract driving corridors, runextract_driving_corridors.py.The outputs will be stored in the./output/folder. Default and scenario-specific configurations are stored in the./configurations/folder.DocumentationThe documentation of our toolbox is available on our website:https://cps.pages.gitlab.lrz.de/commonroad-reachable-set/.In order to generate the documentation via Sphinx locally, run the following commands in the root directory:$pipinstall-r./docs/requirements_doc.txt
$cddocs/Sphinx
$makehtmlThe documentation can then be launched by browsing./docs/Sphinx/build/html/index.html/.CitationIf you use our toolbox for your research, please cite ourpaper:@InProceedings{iraniliu2022commonroad,
      title     = {{CommonRoad-Reach}: {A} toolbox for reachability analysis of automated vehicles},
      author    = {Irani Liu, Edmond and W\"ursching, Gerald and Klischat, Moritz and Althoff, Matthias},
      booktitle = {Proc. of the IEEE Int. Conf. Intell. Transp. Syst.},
      pages     = {2313--2320},
      year      = {2022},
   }