Package: lanelet2
Lanelet2OverviewLanelet2 is a C++ library for handling map data in the context of automated driving. It is designed to utilize high-definition map data in order to efficiently handle the challenges posed to a vehicle in complex traffic scenarios. Flexibility and extensibility are some of the core principles to handle the upcoming challenges of future maps.Features:2D and 3DsupportConsistent modification: if one point is modified, all owning objects see the changeSupportslane changes, routing through areas, etc.Separated routingfor pedestrians, vehicles, bikes, etc.Manycustomization pointsto add new traffic rules, routing costs, parsers, etc.Simple convenience functionsfor common tasks when handling mapsAccurate Projectionbetween the lat/lon geographic world and local metric coordinatesIO Interfacefor reading and writing e.g.osmdata formats (this does not mean it can deal withosm maps)Pythonbindings for the whole C++ interfaceBoost Geometrysupport for all thinkable kinds of geometry calculations on map primitivesReleased under theBSD 3-Clause licenseSupport forROS1, ROS2, Docker and Conan(see instructions below)Lanelet2 is the successor of the oldliblaneletthat was developed in 2013. If you know Lanelet1, you might be interested inreading this.DocumentationYou can find more documentation in the individual packages and in doxygen comments. Here is an overview on the most important topics:Hereis more information on the basic primitives that make up a Lanelet2 map.Read herefor a primer on thesoftware architectureof lanelet2.There is also somedocumentationon the geometry calculations you can do with lanelet2 primitives.If you are interested in Lanelet2'sprojections, you will find morehere.To get more information on how to create valid maps, seehere.InstallationWithin ROSLanelet2 has been released for ROS. Just installros-[distribution]-lanelet2, e.g.:sudo apt install ros-noetic-lanelet2Without ROSOutside of ROS, Lanelet2 can be installed from PyPI. Note that currently only Python 3.8-3.11 linux builds are available and that Python 3.10+ is only supported for recent linux distributions such as Ubuntu 20.04+.pip install lanelet2Note:If you receive the errorERROR: Could not find a version that satisfies the requirement lanelet2 (from versions: none)
ERROR: No matching distribution found for lanelet2during installation, even when using e.g. python 3.9 or 3.8 on a somewhat recent linux such as Ubuntu 18.04 or newer, your pip version is probably too old,
as e.g. the pip version that comes with apt on Ubuntu 20.04 (20.0.2) is not recent enough for the provided package.In this case you need to simply update pip withpip3 install -U pipUsing DockerThere is a Docker container from which you can test things out:docker build -t lanelet2 .                    # builds a docker image named "lanelet2"
docker run -it --rm lanelet2:latest /bin/bash # starts the docker image
python -c "import lanelet2"                   # quick check to see everything is fineThe docker image contains a link to your local lanelet2, so you can work and see changes (almost) at the same time. Work with two screens, one local and one on docker. Make your code changes locally, then run againcatkin buildon docker to recompile the code (update python modules).Manual installationIn case you want to build it in your own way (without the above Docker image) use these instructions.Lanelet2 relies mainly onCatkinfor building and is targeted towards Linux.At leastC++14is required.DependenciesBesidesCatkin, the dependencies areBoost(from 1.58)eigen3mrt_cmake_modules, a CMake helper librarypugixml(for lanelet2_io)boost-python, python2 or python3(for lanelet2_python)geographiclib(for lanelet2_projection)rosbash(for lanelet2_examples)For Ubuntu, the steps are the following:Set up ROS, and install at leastrospack,catkinandmrt_cmake_modules(e.g.ros-melodic-rospack,ros-melodic-catkin,ros-melodic-mrt-cmake-modules):sudo apt-get install ros-melodic-rospack ros-melodic-catkin ros-melodic-mrt-cmake-modulesInstall the dependencies above:sudoapt-getinstalllibboost-devlibeigen3-devlibgeographic-devlibpugixml-devlibpython-devlibboost-python-devpython-catkin-toolsOn 16.04 and below,mrt_cmake_modulesis not available in ROS and you have to clone it into your workspace (git clone https://github.com/KIT-MRT/mrt_cmake_modules.git).BuildingAs usual with Catkin, after you have sourced the ros installation, you have to create a workspace and clone all required packages there. Then you can build.source/opt/ros/$ROS_DISTRO/setup.bash
mkdircatkin_ws&&cdcatkin_ws&&mkdirsrc
catkininit
catkinconfig--cmake-args-DCMAKE_BUILD_TYPE=RelWithDebInfo# build in release mode (or whatever you prefer)cdsrc
gitclonehttps://github.com/fzi-forschungszentrum-informatik/lanelet2.gitcd..
catkinbuildIf unsure, see theDockerfileor thetravis build log. It shows the full installation process, with subsequent build and test based on a docker image with a clean Ubuntu installation.Manual, experimental installation using conanFor non-catkin users, we also offer a conan based install process. Its experimental and might not work on all platforms, especially Windows.
Since conan handles installing all C++ dependencies, all you need is a cloned repository, conan itself and a few python dependencies:pipinstallconancatkin_pkgnumpy
conanremoteaddbincraftershttps://bincrafters.jfrog.io/artifactory/api/conan/public-conan# required for python bindingsconanconfigsetgeneral.revisions_enabled=1# requried to use bincrafters remotegitclonehttps://github.com/fzi-forschungszentrum-informatik/lanelet2.gitcdlanelet2From here, just use the default conan build/install procedure, e.g.:conansource.
conancreate.lanelet2/stable--build=missingDifferent from the conan defaults, we build lanelet2 and boost as shared libraries, because otherwise the lanelet2's plugin mechanisms as well as boost::python will fail. E.g. loading maps will not be possible and the python API will not be usable.To be able to use the python bindings, you have to make conan export the PYTHONPATH for lanelet2:conaninstalllanelet2/0.0.0@lanelet2/stable--build=missing-gvirtualenv# replace 0.0.0 with the version shown by conansourceactivate.sh
python-c"import lanelet2"# or whatever you want to dosourcedeactivate.shPython3The python bindings are build for your default python installation by default (which currently is python2 on most systems). To build for python3 instead of python2, create a python3 virtualenv before initializing the workspace withcatkin init. The commandpythonshould point topython3.Aftercatkin initruncatkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_VERSION=3.6to make sure that the correct python version is used. Then build and use as usual.Note: With bionic and beyond, the apt packagepython3-catkin-toolsconflicts with ROS melodic and should not be used. Use either the python2 version or use pip to install the python3 version.ExamplesExamples and common use cases in both C++ and Python can be foundhere.Packageslanelet2is the meta-package for the whole lanelet2 frameworklanelet2_coreimplements the basic library with all the primitives, geometry calculations and the LanletMap objectlanelet2_iois responsible for reading and writing lanelet mapslanelet2_traffic_rulesprovides support to interpret the traffic rules encoded in a maplanelet2_projectionfor projecting maps from WGS84 (lat/lon) to local metric coordinateslanelet2_routingimplements the routing graph for routing or reachable set or queries as well as collision checkinglanelet2_mapsprovides example maps and functionality to visualize and modify them easily in JOSMlanelet2_matchingprovides functions to determine in which lanelet an object is/could be currently locatedlanelet2_pythonimplements the python interface for lanelet2lanelet2_validationprovides checks to ensure a valid lanelet2 maplanelet2_examplescontains tutorials for working with Lanelet2 in C++ and PythonCitationIf you are using Lanelet2 for scientific research, we would be pleased if you would cite ourpublication:@inproceedings{poggenhans2018lanelet2,
  title     ={Lanelet2: A High-Definition Map Framework for the Future of Automated Driving},
  author    ={Poggenhans, Fabian and Pauls, Jan-Hendrik and Janosovits, Johannes and Orf, Stefan and Naumann, Maximilian and Kuhnt, Florian and Mayr, Matthias},
  booktitle ={Proc.\IEEE Intell.\Trans.\Syst.\Conf.},
  year      ={2018},
  address   ={Hawaii, USA},
  owner     ={poggenhans},
  month     ={November},
  Url={http://www.mrt.kit.edu/z/publ/download/2018/Poggenhans2018Lanelet2.pdf}}