ROS focal/noetic | ROS focal/foxy | Gitlab CI | Coverage |
---|---|---|---|
Lanelet2 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:
Lanelet2 is the successor of the old liblanelet that was developed in 2013. If you know Lanelet1, you might be interested in reading this.
You can find more documentation in the individual packages and in doxygen comments. Here is an overview on the most important topics:
Lanelet2 has been released for ROS. Just install ros-[distribution]-lanelet2
, e.g.:
sudo apt install ros-noetic-lanelet2
There 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 fine
The 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 again catkin build
on docker to recompile the code (update python modules).
In case you want to build it in your own way (without the above Docker image) use these instructions.
Lanelet2 relies mainly on Catkin for building and is targeted towards Linux.
At least C++14 is required.
Besides Catkin, the dependencies are
Boost
(from 1.58)eigen3
mrt_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:
rospack
, catkin
and mrt_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-modules
sudo apt-get install libboost-dev libeigen3-dev libgeographic-dev libpugixml-dev libpython-dev libboost-python-dev python-catkin-tools
On 16.04 and below, mrt_cmake_modules
is not available in ROS and you have to clone it into your workspace (git clone https://github.com/KIT-MRT/mrt_cmake_modules.git
).
As 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
mkdir catkin_ws && cd catkin_ws && mkdir src
catkin init
catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo # build in release mode (or whatever you prefer)
cd src
git clone https://github.com/fzi-forschungszentrum-informatik/lanelet2.git
cd ..
catkin build
If unsure, see the Dockerfile or the travis build log. It shows the the full installation process, with subsequent build and test based on a docker image with a clean ubuntu installation.
For non-catkin users, we also offer a conan based install proces. Its experimental and might not work on all platforms, expecially Windows. Since conan handles installing all C++ dependencies, all you need is a cloned repository, conan itself and a few python dependencies:
pip install conan catkin_pkg numpy
conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan # required for python bindings
conan config set general.revisions_enabled=1 # requried to use bincrafters remote
git clone https://github.com/fzi-forschungszentrum-informatik/lanelet2.git
cd lanelet2
From here, just use the default conan build/install procedure, e.g.:
conan source .
conan create . lanelet2/stable --build=missing
Different 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:
conan install lanelet2/0.0.0@lanelet2/stable --build=missing -g virtualenv # replace 0.0.0 with the version shown by conan
source activate.sh
python -c "import lanelet2" # or whatever you want to do
source deactivate.sh
The 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 with catkin init
. The command python
should point to python3
.
After catkin init
run catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_VERSION=3.6
to make sure that the correct python version is used. Then build and use as usual.
Note: With bionic and beyond, the apt package python3-catkin-tools
conflicts with ROS melodic and should not be used. Use either the python2 version or use pip to install the python3 version.
Examples and common use cases in both C++ and Python can be found here.
If you are using Lanelet2 for scientific research, we would be pleased if you would cite our publication:
@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}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。