Code Monkey home page Code Monkey logo

lanelet2's Introduction

Lanelet2

CI CD Build Status ROS focal/noetic Build Status ROS2 focal/foxy Build Status ROS2 jammy/humble PyPI Downloads

Overview

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:

  • 2D and 3D support
  • Consistent modification: if one point is modified, all owning objects see the change
  • Supports lane changes, routing through areas, etc.
  • Separated routing for pedestrians, vehicles, bikes, etc.
  • Many customization points to add new traffic rules, routing costs, parsers, etc.
  • Simple convenience functions for common tasks when handling maps
  • Accurate Projection between the lat/lon geographic world and local metric coordinates
  • IO Interface for reading and writing e.g. osm data formats (this does not mean it can deal with osm maps)
  • Python bindings for the whole C++ interface
  • Boost Geometry support for all thinkable kinds of geometry calculations on map primitives
  • Released under the BSD 3-Clause license
  • Support for ROS1, ROS2, Docker and Conan (see instructions below)

Lanelet2 is the successor of the old liblanelet that was developed in 2013. If you know Lanelet1, you might be interested in reading this.

Documentation

You can find more documentation in the individual packages and in doxygen comments. Here is an overview on the most important topics:

  • Here is more information on the basic primitives that make up a Lanelet2 map.
  • Read here for a primer on the software architecture of lanelet2.
  • There is also some documentation on the geometry calculations you can do with lanelet2 primitives.
  • If you are interested in Lanelet2's projections, you will find more here.
  • To get more information on how to create valid maps, see here.

You can also find the documentation at this link.

Installation

Within ROS

Lanelet2 has been released for ROS. Just install ros-[distribution]-lanelet2, e.g.:

sudo apt install ros-noetic-lanelet2

Without ROS

Outside 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 lanelet2

Note:

If you receive the error

ERROR: Could not find a version that satisfies the requirement lanelet2 (from versions: none)
ERROR: No matching distribution found for lanelet2

during 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 with

pip3 install -U pip 

Using Docker

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).

Manual installation

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.

Dependencies

Besides Catkin, the dependencies are

  • Boost (from 1.58)
  • eigen3
  • mrt_cmake_modules, a CMake helper library
  • pugixml (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 least 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
  • Install the dependencies above:
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).

Building

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 full installation process, with subsequent build and test based on a docker image with a clean Ubuntu installation.

Manual, experimental installation using conan

For 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:

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

Python3

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

Examples and common use cases in both C++ and Python can be found here.

Packages

  • lanelet2 is the meta-package for the whole lanelet2 framework
  • lanelet2_core implements the basic library with all the primitives, geometry calculations and the LanletMap object
  • lanelet2_io is responsible for reading and writing lanelet maps
  • lanelet2_traffic_rules provides support to interpret the traffic rules encoded in a map
  • lanelet2_projection for projecting maps from WGS84 (lat/lon) to local metric coordinates
  • lanelet2_routing implements the routing graph for routing or reachable set or queries as well as collision checking
  • lanelet2_maps provides example maps and functionality to visualize and modify them easily in JOSM
  • lanelet2_matching provides functions to determine in which lanelet an object is/could be currently located
  • lanelet2_python implements the python interface for lanelet2
  • lanelet2_validation provides checks to ensure a valid lanelet2 map
  • lanelet2_examples contains tutorials for working with Lanelet2 in C++ and Python

Citation

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}
}

lanelet2's People

Contributors

brandesjj avatar darrenwong avatar davuhll avatar denzel-haverkamp avatar dymons avatar franklynjey avatar haditab avatar harderthan avatar hibetterheyj avatar immel-f avatar jdrudolph avatar johschmitz avatar klintan avatar kosuke55 avatar m-naumann avatar mantkiew avatar michael-hoss avatar mikaelarguedas avatar mitsudome-r avatar neumann-nico avatar nspo avatar omersahintas avatar poggenhans avatar ppeltzerfka avatar r-fehler avatar robot8a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lanelet2's Issues

josm problem and routing

hello๏ผŒI have some questions there and I hope you can help me,thanks a lot.
the first is after I paint some road using lanelet2 on JOSM,the object doesn't have id,and the id in .osm file is negative,is it correct?could you tell me how to produce id?
the second is that I run the example code "06_routing" with the above file,the error comes "main.cpp:60: void part1CreatingAndUsingRoutingGraphs(): Assertion `!!routingGraph->right(lanelet)' failed."could you tell me how to solve it?

[Question] Speeding up building RoutingGraph

For a larger map, the routing graph builder (lanelet::routing::RoutingGraph::build) can take quite some time. I know there is the option to get a debug routing graph, but is there a way to cache the RoutingGraph object into a file and retrieve it in later run?

[Question] Using maps in multiple nodes

Since there is rosdoc.yaml in the repository, I assume Lanelet2 can be used for ROS systems.
If we are to use the map information in multiple ros nodes, how should the map be shared?
I don't see any ROS messages defined so are you using other framework.
If you have any experience on using map across multiple nodes, could you tell me how you did it?
Thank you in advance.

Illegeal Instruction

Hello,
I successfully build my program including Lanlets2 at a virtual machine at my system.
After I export and import the VM at another system, I get a "Illegal Instructionโ€ error at the program start. My program was stable at the second system in this VM without lanlet2 and catkin build.
Any idea why there is this difference between the systems?

building for python3

Dear guys,

I tried following the instructions to make lanelet2 in Python3, so, inside your docker image the command :

catkin init
catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_VERSION=3.6
catkin build

yielded this error :

[build] Found '11' packages in 0.0 seconds.
[build] Updating package table.
Starting  >>> catkin_tools_prebuild                
_______________________________________________________________________________________
Errors     << catkin_tools_prebuild:cmake /home/developer/workspace/logs/catkin_tools_prebuild/build.cmake.000.log
ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/usr/bin/python3.6
  "/opt/ros/melodic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/melodic/share/catkin/cmake/../package.xml"
  "/home/developer/workspace/build/catkin_tools_prebuild/catkin/catkin_generated/version/package.cmake")
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/melodic/share/catkin/cmake/all.cmake:167 (_catkin_package_xml)
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:4 (find_package)


cd /home/developer/workspace/build/catkin_tools_prebuild; catkin build --get-env catkin_tools_prebuild | catkin env -si  /usr/bin/cmake /home/developer/workspace/build/catkin_tools_prebuild --no-warn-unus
ed-cli -DCATKIN_DEVEL_PREFIX=/home/developer/workspace/devel/.private/catkin_tools_prebuild -DCMAKE_INSTALL_PREFIX=/home/developer/workspace/install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_VERSION=3.6;
 cd -
.......................................................................................
Failed     << catkin_tools_prebuild:cmake           [ Exited with code 1 ]
Failed    <<< catkin_tools_prebuild                 [ 1.3 seconds ]
Abandoned <<< mrt_cmake_modules                     [ Unrelated job failed ]
Abandoned <<< lanelet2_core                         [ Unrelated job failed ]
Abandoned <<< lanelet2_io                           [ Unrelated job failed ]
Abandoned <<< lanelet2_maps                         [ Unrelated job failed ]
Abandoned <<< lanelet2_projection                   [ Unrelated job failed ]
Abandoned <<< lanelet2_traffic_rules                [ Unrelated job failed ]
Abandoned <<< lanelet2_routing                      [ Unrelated job failed ]
Abandoned <<< lanelet2_python                       [ Unrelated job failed ]
Abandoned <<< lanelet2_examples                     [ Unrelated job failed ]
Abandoned <<< lanelet2_validation                   [ Unrelated job failed ]
[build] Summary: 0 of 11 packages succeeded.
[build]   Ignored:   1 packages were skipped or are blacklisted.
[build]   Warnings:  None.
[build]   Abandoned: 10 packages were abandoned.
[build]   Failed:    1 packages failed.
[build] Runtime: 1.3 seconds total.

lanelet2.io.load() crashes on a map cropped from JOSM

Dear Lanelet2 guys,

I tried to crop a piece of map from JOSM, saved it as osm, and tried to open it with lanelet2.io.load(<osm_map>, <origin_lat_lng_of_its_center>) but for this error:

RuntimeError: Errors ocurred while parsing Lanelet Map:
	- Error reading primitive with id 74660 from file: Relation has nonexistent member 550284583
 .... and many more

Apparently some relations are chopped off the crop I did. Should I not save maps that way ? if not, what is the best way to use a piece of JOSM map ?

How to delete a point by ID

Dear Lanelet guys,

I use this code to get rid of points created by mistake or make changes in the Linestring3D of a Lanelet. It seems **the API lets me remove points from a LineString but not completed delete the point from the Map. Can this be changed ? **

import lanelet2
import lanelet2.core as lncore

# create one lanelet with two borders with points 1,2,3,4
lb1 = lncore.LineString3d(lncore.getId(),
                [lncore.Point3d(lncore.getId(), 4, 0, 0), lncore.Point3d(lncore.getId(), 4, 2, 0),
                 lncore.Point3d(lncore.getId(), 3, 3, 1), lncore.Point3d(lncore.getId(), 3, 4, 1)])
rb1 = lncore.LineString3d(lncore.getId(),
                [lncore.Point3d(lncore.getId(), 6, 0, 0), lncore.Point3d(lncore.getId(), 6, 2, 0),
                 lncore.Point3d(lncore.getId(), 5, 3, 1), lncore.Point3d(lncore.getId(), 5, 4, 1)])
llet1 = lncore.Lanelet(lncore.getId(), lb1, rb1)

# add to map
lmap = lncore.LaneletMap()
lmap.add(llet1)

# remove the point 1 from each border
for llet in lmap.laneletLayer:
    del llet.rightBorder[0]
    del llet.leftBorder[0]

# print out the points of the borders (they are updated, and only contain points 2,3,4
for llet in lmap.laneletLayer:
    print ("right border: %s" % [(p.id, p.x, p.y) for p in llet.rightBorder])
    print ("left border: %s" % [(p.id, p.x, p.y) for p in llet.leftBorder])

# print all points in the map: the deleted points are still there
for p in lmap.pointLayer:
    print ("point %d (%.2f,%.2f)" % (p.id, p.x, p.y) )

# finally I want to delete the individual points ... but this won't work function "__delattr__" is not implemented
#for p in lmap.pointLayer:
#    del p 

Issues in catkin build

When I do "catkin build", I encountered some issues.

`Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.

[build] Found '11' packages in 0.0 seconds.
[build] Updating package table.
Starting >>> catkin_tools_prebuild
Finished <<< catkin_tools_prebuild [ 3.7 seconds ]
Starting >>> mrt_cmake_modules
Finished <<< mrt_cmake_modules [ 2.9 seconds ]
Starting >>> lanelet2_core
Finished <<< lanelet2_core [ 51.7 seconds ]
Starting >>> lanelet2_io
Starting >>> lanelet2_maps
Starting >>> lanelet2_traffic_rules
Finished <<< lanelet2_maps [ 3.2 seconds ]
Finished <<< lanelet2_traffic_rules [ 19.8 seconds ]
Starting >>> lanelet2_routing
Finished <<< lanelet2_io [ 38.8 seconds ]
Starting >>> lanelet2_projection
Finished <<< lanelet2_projection [ 9.8 seconds ]
Finished <<< lanelet2_routing [ 44.3 seconds ]
Starting >>> lanelet2_python
Starting >>> lanelet2_validation
Finished <<< lanelet2_validation [ 32.9 seconds ]
Finished <<< lanelet2_python [ 1 minute and 8.3 seconds ]
Starting >>> lanelet2_examples


Warnings << lanelet2_examples:make /home/neilzhang/Desktop/Research2/catkin_ws/logs/lanelet2_examples/build.make.000.log
CMakeFiles/lanelet2_examples-04_reading_and_writing-exec.dir/src/04_reading_and_writing/main.cpp.o:main.cpp:function part1LoadingAndWriting(): warning: the use of tmpnam' is dangerous, better use mkstemp'
cd /home/neilzhang/Desktop/Research2/catkin_ws/build/lanelet2_examples; catkin build --get-env lanelet2_examples | catkin env -si /usr/bin/make --jobserver-fds=3,4 -j; cd -
...............................................................................
Finished <<< lanelet2_examples [ 25.9 seconds ]
[build] Summary: All 11 packages succeeded!
[build] Ignored: 1 packages were skipped or are blacklisted.
[build] Warnings: 1 packages succeeded with warnings.
[build] Abandoned: None.
[build] Failed: None.
[build] Runtime: 3 minutes and 37.8 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.
Exception ignored in: <bound method BaseEventLoop.del of <_UnixSelectorEventLoop running=False closed=True debug=False>>
Traceback (most recent call last):
File "/home/neilzhang/.local/lib/python3.5/site-packages/trollius/base_events.py", line 395, in del
File "/home/neilzhang/.local/lib/python3.5/site-packages/trollius/unix_events.py", line 65, in close
File "/home/neilzhang/.local/lib/python3.5/site-packages/trollius/unix_events.py", line 166, in remove_signal_handler
File "/usr/lib/python3.5/signal.py", line 47, in signal
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object`

I don't know how to fix this. I also have no idea which package failed in my installation. Could you please help me?

[Question] How not to add previous lanelet's when forming a Route?

When I try to find a route through several goals, use the function getRouteVia, it turns out that a path shorter than shortestPath appears in the route.
Because of this, we are not moving on shortestPath, and cut it. I suppose in the process of forming a Route, not only neighboring lanelet's are added, but also the previous ones.

For example:
I'm trying to drive start - > goal 1 - > goal 2 -> ... - >finish. At the time of loading the route getRouteVia(start, {goal 1}, goal 2), the next Route is obtained.
FirstChange
As a result, we are looking for the shortest path of movement, and we are not moving in the way that was supposed.
SecondChange
Is there a way not to add previous lanelet's, so that the Route was formed only on the path shortestPath?

[Question] processMergingLanelets gives an assert

Hi!
When searching for a route through the narrowing of the road from two-lane to single-lane, we have the following behavior. If the route is executed by one Lanelet, then the route will be successful, but when used on several Laneletโ€™s, a call is made to assert from the addPrevious functions.

furtherElement->addPrevious(lastElement);

I understand it, this is due to the fact that the source element RouteElement is already used in the route, and because we get this assert. Why could this happen? How can you solve this case at the stage of create cart if we need several Lanelet's or it solve software change?
One Lanelet (Good)
good
Several Laneletโ€™s(Bad)
bad
Log Error
log(1)

installing lanelet2_python

Dear Fabian,

I have followed the instructions in your repo (cloned both Lanelet2 and MRT repos) and did a catking build. All works well, but I cannot use python -c "import lanelet2" (ImportError: No module named lanelet2).

What else should I do to make it available ?

Angelo

route.getLaneletMap() - object has no attribute

Hi,

We're following the examples here - https://github.com/fzi-forschungszentrum-informatik/Lanelet2/tree/master/lanelet2_routing - trying to get routing working in python but the route.getLaneletMap() line is throwing the following error:

AttributeError: 'Route' object has no attribute 'getLaneletMap'

We tried checking what other properties are available and there is a laneletMap property but calling this returns the following:

TypeError: No to_python (by-value) converter found for C++ type: std::shared_ptr<lanelet::LaneletMap const>

Any suggestions?

Thanks,
trav.

[Question] Routing efficiency in LaneLet2

LaneLet2 seems to nicely describe complex lane geometries and traffic rules, however, it also appears that there is no concept of a road or road network. This could pose an issue for routing on a large map.
As far as a can tell from the documentation, when a route is being determined to go from point A to point B, the user must search the entirety of lanelet network. This is in-efficient for large maps. Has this been addressed in some way?
If not, I would think a Road concept could be added where roads contain lanelets and each road has defined connections to other roads thus reducing the initial search space.

locate gps point in which lanelet

Hi,I use the function findnearest to locate GPS point in which lanelet,but it didn't find correct lanelet id.
And my osm map is in China,I modify the origin in code.
I selected GPS point in my osm map with JOSM,in JOSM I use utm 50N projection,but I think the projection doesn't matter because I make comparing with different projection in JOSM with same location and their GPS similarily.
Is there something I need modify?How can I get the right lanelet id?thank you!

How to get left and right boundary of entire route(-map) object?

I'm in the situation where I need the left and right boundary of a route object. Is this possible?

I generated the route object by calling:
Optional<lanelet::routing::Route> route = routingGraph->getRoute(currentLanelet, targetLanelet, 0);

Then I can generate a map-object from the route:
LaneletMapConstPtr routeMap = route->laneletMap();

Now I would like to have the left and right boundary of the entire route or the map object. What would be the best way to do this?

I tried to take the shortestPath-object and look left and right for neighbour-lanelets, but then "merging"-relations are ignored.

With Optional<routing::RelationType> relation = routingGraph->routingRelation(lanelet1, lanelet2, false); I can get those relations, but then it's getting complicated to decide which boundary from which lanelet to take.

How to convert from ArcCoordinates back to x, y?

Say I have a centerline of a lanelet and the position of an object on this lanelet. Now I want to predict the movement of the object by following the lanelet. I can assume a linear motion model along the centerline of the lanelet with a specific offset/distance to centerline.

//Point3d posObj;
//Lanelet lanelet;

ConstHybridLineString3d centerline = utils::toHybrid(lanelet.centerline());
ArcCoordinates arcCoordinates = geometry::toArcCoordinates(utils::to2D(centerline), utils::to2D(posObj));

The arcCoordinates length and distance are the centerline coordinates which is something like Frenet-coordinates, correct? The distance is the perpendicular component and the length is the distance along the centerline, correct?
I can get the current distance and length of the object on the centerline with:

double s_start = arcCoordinates.length;       
double t_start = arcCoordinates.distance;

I want to predict the movement by doing something like s = s_start + v*dt.

So how can I transform back from centerline-coordinates(length s, distance t) to x,y-coordinates?
Do I use interpolatedPointAtDistance?

Any recommends on the GUI interface?

I wonder whether there is a simple GUI interface for this package. For example, I can see the routing results or something like that when it works online. Thanks.

Incorrect dependency names on ROS packages

Unresolvable dependencies by rosdep due to incorrect naming on:

  1. libgeographic-dev should read instead geographiclib
    <depend>libgeographic-dev</depend>
  2. pugixml should not be listed on
    <depend>pugixml</depend>

    and instead be installed with apt just like the in the provided Dockerfile.
  3. boost-python should not be listen on
    <depend>boost-python</depend>

[Question] Map matching module

Hi!
In the original paper you mention a Lanelet2 "Matching" module. Looking at the code I could not find this module. Is it planned to release this module publicly?
Thanks!

How to visualize the generated shortestPath?

Hi Fabian, I'm using the routing package to generate the shortest path and while I can list what lanelets are included in the path, I can't really get to visualize them on the map. When I try to open the generated map on JOSM (with the routing css file applied), I get the following image. Is there a way to draw/show the shortest path with arrows perhaps?
image

Also, using JOSM, how can I find the lanelet id? I would like to try generating paths between other pairs of lanelets, but I can't seem to figure out how to locate the ids. Thanks!

lanelet2 examples

Hi, I successfully built the working space without docker but my local computer.
After I source devel/setup.bash, I try to execute the examples with rosrun lanelet2_examples 01_dealing_with_lanelet_primitives but nothing happen. No errors, no windows show up.
Is there anything I missed?

lanelet_rviz_plugin_ros

Hello,I have an issue with lanelet_rviz_plugin_ros,and I am looking forward for your reply.

I catkin_make succeeded,but when I input command "roslaunch lanelet_rviz_plugin_ros sample_lanelet_viz.launch",the error occurs,"PluginlibFactory: The plugin for class 'lanelet_rviz_plugin_ros::LaneletMapPlugin' failed to load. Error: Failed to load library /.../catkin_ws/devel/lib//liblanelet_rviz_plugin_ros.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /.../catkin_ws/devel/lib//liblanelet_rviz_plugin_ros.so: undefined symbol: _ZTVN22lanelet2_interface_ros20Lanelet2InterfaceRosE)".

Could you please tell me how to solve it, thank you!

[Feature] LaneLet2 python on Windows

I would like to be able to handle LaneLet2 files in a project on windows but at the moment there is no way to use the Python submodule on Windows (or on Linux without ROS) due to its ROS dependencies.
Is there any way to use it as a separate package instead of part of the entire project?

XSD/DTD/XML Definition

In the document https://github.com/fzi-forschungszentrum-informatik/Lanelet2/tree/master/lanelet2_maps/README.md, it is described that lanelet2 uses the OSM XML format. However, the "OSM XML format" is not clearly defined. The format differs from version-to-version (currently on 0.6) and is a function of the API version that a server providing the document is using. Because the format changes from version-to-version and it was designed to be a document requested from a web API, a static definition of the format (XSD or DTD) is not available and/or provides many unnecessary elements which are not related to the driving task (API version, timeout values, etc.). In addition, you state that you are "converting" the lanelet2 primitives to OSM primitives. This brings me to my questions:

  1. Why was the OSM XML format chosen given the shortcomings listed above?
  2. Is FZI considering creating their own XML format and accompanying XSD or DTD?
  3. If the answer to 3 is no, would FZI be interested in working with a 3rd party to develop a new XML format and accompanying XSD or DTD?

I think lanelet2 is a great project and would work well as the base structure for many applications (simulation, visualization, automated driving, etc.) but I think the lack of a well-supported, static storage format is a big drawback.

how to make lanelet map with shape file?

Hi, Thanks for your work. I have a shape file of a driving road. I want to make a lanelet map with this shape file. Could you please tell me how? Thanks a lot.

new package use

Hi,I write a package to join in the Lanelet2-master,and it compile successfully.After that I write a cpp to test the package, but comes the error "can't find that file or directory
#include <lanelet2_interface/lanelet2_interface.h>", lanelet2_interface is the package that I write.All CMakeLists.txt are imitated by examples.Could you please is there something I ignored?Or how could I do?thank you!

[Question] Tagging Traffic Light

According to this document, subtype is used to define information about traffic_light.
However, it only provides examples for simple traffic lights, like red_yellow_green.
Are there any naming conventions for more complex traffic lights, including traffic_light with arrows, flashing lights, traffic lights for pedestrians, etc...
e.g. how would you tag the traffic light in this image?

Issues with lanelet2_examples

When I do catkin build, I got:

Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.

[build] Found '11' packages in 0.0 seconds.
[build] Updating package table.
Starting >>> catkin_tools_prebuild
Finished <<< catkin_tools_prebuild [ 1.9 seconds ]
Starting >>> mrt_cmake_modules
Finished <<< mrt_cmake_modules [ 2.5 seconds ]
Starting >>> lanelet2_core
Finished <<< lanelet2_core [ 43.0 seconds ]
Starting >>> lanelet2_io
Starting >>> lanelet2_maps
Starting >>> lanelet2_traffic_rules
Finished <<< lanelet2_maps [ 3.2 seconds ]
Finished <<< lanelet2_traffic_rules [ 20.3 seconds ]
Starting >>> lanelet2_routing
Finished <<< lanelet2_io [ 42.1 seconds ]
Starting >>> lanelet2_projection
Finished <<< lanelet2_routing [ 40.5 seconds ]
Finished <<< lanelet2_projection [ 10.3 seconds ]
Starting >>> lanelet2_python
Starting >>> lanelet2_validation
Finished <<< lanelet2_validation [ 32.4 seconds ]
Finished <<< lanelet2_python [ 1 minute and 9.4 seconds ]
Starting >>> lanelet2_examples


Warnings << lanelet2_examples:make /home/neilzhang/Desktop/Research/catkin_ws/logs/lanelet2_examples/build.make.000.log
CMakeFiles/lanelet2_examples-04_reading_and_writing-exec.dir/src/04_reading_and_writing/main.cpp.o:main.cpp:function part1LoadingAndWriting(): warning: the use of tmpnam' is dangerous, better use mkstemp'
cd /home/neilzhang/Desktop/Research/catkin_ws/build/lanelet2_examples; catkin build --get-env lanelet2_examples | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Finished <<< lanelet2_examples [ 26.5 seconds ]
[build] Summary: All 11 packages succeeded!
[build] Ignored: 1 packages were skipped or are blacklisted.
[build] Warnings: 1 packages succeeded with warnings.
[build] Abandoned: None.
[build] Failed: None.
[build] Runtime: 3 minutes and 26.9 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.

Could you help me fix the warning "warning: the use of tmpnam' is dangerous, better use mkstemp' "?

lanelet2_core build fails because of missing includes

Hello,
I am trying to build the newest lanelet2 from git. I installed ROS Melodic from ros-melodic-ros-base in my Ubuntu 18.04 and then followed your installation instructions (including the extra dependencies). I also downloaded the catkin package into the workspace. When I try to build the workspace it fails with the following error:

--------------------------------------------------------------
Profile:                     default
Extending:             [env] /opt/ros/melodic
Workspace:                   /home/username/catkin_ws
--------------------------------------------------------------
Source Space:       [exists] /home/username/catkin_ws/src
Log Space:          [exists] /home/username/catkin_ws/logs
Build Space:        [exists] /home/username/catkin_ws/build
Devel Space:        [exists] /home/username/catkin_ws/devel
Install Space:      [unused] /home/username/catkin_ws/install
DESTDIR:            [unused] None
--------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
--------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
--------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
--------------------------------------------------------------
Workspace configuration appears valid.
--------------------------------------------------------------
[build] Found '12' packages in 0.0 seconds.                                    
[build] Package table is up to date.                                           
Starting  >>> catkin                                                           
Finished  <<< catkin                                [ 0.1 seconds ]            
Starting  >>> mrt_cmake_modules                                                
Finished  <<< mrt_cmake_modules                     [ 0.1 seconds ]            
Starting  >>> lanelet2_core                                                    
_______________________________________________________________________________
Errors     << lanelet2_core:cmake /home/username/catkin_ws/logs/lanelet2_core/build.cmake.001.log
Traceback (most recent call last):
  File "/home/username/catkin_ws/src/mrt_cmake_modules/scripts/generate_cmake_dependency_file.py", line 291, in <module>
    main(sys.argv[1], sys.argv[2], sys.argv[3])
  File "/home/username/catkin_ws/src/mrt_cmake_modules/scripts/generate_cmake_dependency_file.py", line 177, in main
    catkin_packages = getCatkinPackages(workspaceRoot)
  File "/home/username/catkin_ws/src/mrt_cmake_modules/scripts/generate_cmake_dependency_file.py", line 135, in getCatkinPackages
    catkin_packages = subprocess.check_output(args).split('\n')
  File "/usr/lib/python2.7/subprocess.py", line 216, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
CMake Error at /home/username/catkin_ws/src/mrt_cmake_modules/cmake/Modules/GatherDeps.cmake:16 (include):
  include could not find load file:

    /home/username/catkin_ws/build/lanelet2_core/CMakeFiles/auto_dep_vars.cmake
Call Stack (most recent call first):
  CMakeLists.txt:16 (include)


cd /home/username/catkin_ws/build/lanelet2_core; catkin build --get-env lanelet2_core | catkin env -si  /usr/bin/cmake /home/username/catkin_ws/src/lanelet2/lanelet2_core --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/username/catkin_ws/devel/.private/lanelet2_core -DCMAKE_INSTALL_PREFIX=/home/username/catkin_ws/install; cd -
...............................................................................
Failed     << lanelet2_core:cmake                   [ Exited with code 1 ]     
Failed    <<< lanelet2_core                         [ 0.9 seconds ]            
Abandoned <<< lanelet2_io                           [ Unrelated job failed ]   
Abandoned <<< lanelet2_maps                         [ Unrelated job failed ]   
Abandoned <<< lanelet2_projection                   [ Unrelated job failed ]   
Abandoned <<< lanelet2_traffic_rules                [ Unrelated job failed ]   
Abandoned <<< lanelet2_routing                      [ Unrelated job failed ]   
Abandoned <<< lanelet2_python                       [ Unrelated job failed ]  
Abandoned <<< lanelet2_examples                     [ Unrelated job failed ]

I am not sure whether this is due to a misconfiguration on my part or actually a bug in lanelet2.

Error while building project using structs from Attribute.h of lanelet2_core

I have a building error with Ubuntu 18 gcc-7. The project is using c++14, the building tool is catkin tools. When I build workspace with my project using any static constexpr constant from any struct of Attribute.h I have undefined reference error on that constant.
That can be fixed with

  • using c++17
  • defining these constants as inline objects
  • using namespaces instead structs

P.S. there is no problem while using gcc-5 on Ubuntu 16

[Question] Why prohibit diverging and merging at the same time?

When I tried to create a routing graph with a lanelet that diverge and merge at the same time, it gave me following error:

Could not determine relationship between lanelets following lanelet 2. Lanelets that are diverging and merging at the same time are not permitted."

Are there any particular reason you prohibit this? It seems like it is using relation just for assigning costs, but it is assigning the same cost for successor, merging, and diverging anyways, so why not add new RelationType::DivergingAndMerging with same cost?

Release to ROS Build Farm

Any plans to release this to the build farm? We would love to not have to build this as a dependency.

[Question] Python3

Hi,
I would like to ask if there is also a Python3 binding or if it is planned for the future?
My whole project is written in Python3 and I want to use lanelet2 to generate maps.
Thanks in advance

example to test the graph.shortestPath()

Dear Fabian,

I was trying to use some code to calculate the shortest path between two lanes, but couldn't make it work. Can you give me an example OSM file you used for testing ?

import lanelet2

lmap = lanelet2.io.load(<path_to_map.osm>,  lanelet2.io.Origin(51.40, -0.04, 0.0))
lanes = [lane for lane in lmap.laneletLayer]

# my selection, given the ID showing on JSOM (IDs of a "relation" object)
startLane = [l for l in lanes if l.id == 5381][0]
endLane = [l for l in lanes if l.id == 5396][0]

# this takes a bit to compute but it terminates well
trafficRules = lanelet2.traffic_rules.create(lanelet2.traffic_rules.Locations.Germany, lanelet2.traffic_rules.Participants.Vehicle)
graph = lanelet2.routing.RoutingGraph(lmap, trafficRules)

sp = graph.shortestPath(startLane, endLane)
print sp  # = None

C++14 requirement not in CMakeLists.txt

Catkin builds using ROS Melodic are fine, but earlier versions fail due to the default C++ standard not being C++14.
Adding the flag in CMakeLists.txt would fix this.

can i use gpx to generate lanelets?

My idea is :

  1. I got 2 gpx file(eg. left.gpx and right.gpx ) , which include the left linestring and right linestring
  2. import these 2 gpx file into josm, merge them, then convert to data layer
  3. construct lanelet by the data form step 2

it's ok?

Routing miscalculates the ShortestPath when one border has zero length

Dear FZI,

I have cases where a lanelet is a junction lane. Say we are turning right at a junction. Right border is just one point (or a line with two equal points), while left border is a curve. In those cases the lanelet2.routing.RoutingGraph.shortestPath() does not take that lane into account, and calculates the path passing by other roads.

image

This case is very frequent (for junctions or corner roads). Can this be fixed ?

lanelet centerline() return error?

1.use tutorial.py, i generate a map which contains a lanelet
2. read map from 1, use lanelet.centerline(),I think the output may be error

  LaneletMapPtr map = load(testMapPath, projection::UtmProjector(Origin({34.49233,109.04286})));
  ConstLanelet lanelet = map->laneletLayer.get(1000);
  std::cout<<lanelet.centerline();

the result is
[id: 0 point ids: 0, 0, 0, 0, 0], something is error?

[Question] Traffic Sign Number

About tagging the type for traffic signs, there is following description:

The type is encoded as ISO 3166 region code + traffic sign number (e.g. de206 for a german stop sign)

I understand that de is ISO 3166 region code for Germany, but where did the traffic sign number come from?
I saw that the numbers match with the image in lanelet2_maps/josm/style_images.zip, but are the numbers originally defined by Lanelet2 developers or are they based on some other reference?

building from docker

Dear guys, I tried using lanelet2 as described in the instructions :

docker build -t lanelet2 .

Yields this error :

... 
Step 7/17 : RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y         libboost-all-dev         libeigen3-dev         libgeographic-dev         libpugixml-dev         libpython-dev         libboost-python-dev         python-catkin-tools         ros-$ROS_DISTRO-catkin         ros-$ROS_DISTRO-rosbash         ros-$ROS_DISTRO-ros-environment # missing dep of rospack on xenial         && apt-get clean && rm -rf /var/lib/apt/lists/*
 ---> Running in 17737a3e02f1
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:6 http://packages.ros.org/ros/ubuntu bionic InRelease [4,669 B]
Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB]
Err:6 http://packages.ros.org/ros/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
Get:8 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [837 kB]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [535 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,220 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [10.8 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [7,239 B]
Get:15 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3,902 B]
Get:16 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [2,496 B]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [717 kB]
Get:18 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [4,169 B]
Get:19 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [5,436 B]
Reading package lists...
W: GPG error: http://packages.ros.org/ros/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
E: The repository 'http://packages.ros.org/ros/ubuntu bionic InRelease' is not signed.
The command '/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y         libboost-all-dev         libeigen3-dev         libgeographic-dev         libpugixml-dev         libpython-dev         libboost-python-dev         python-catkin-tools         ros-$ROS_DISTRO-catkin         ros-$ROS_DISTRO-rosbash         ros-$ROS_DISTRO-ros-environment # missing dep of rospack on xenial         && apt-get clean && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

I would suggest to add this in the Dockerfile in the # install ROS part:

RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
    && apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

CMakeList.txt edit

Can you give a CMakelist.txt example .I want to use lanelet2 library in my project,which locates in the catkin_ws/src.But I dont know how to link your library.I am looking forward to your reply .Thank you.

How to include lanelet2 as a lib into a regular cmake C++ project?

I have simulator which is a regular C++ project just using CmakeLists. Now, I want to use the lanelet2 as the map to locate the vehicle and plan the Vehicle's motion. when I try to include the lanelet2, since I didn't find any .a files and it is a big project, I didn't really get how to include it. It seems too complicated if I just copy all the codes in src and put it in my project and write the CmakeList to include each files.

How do I run the C++ examples after building inside docker?

I successfully built the docker image, started the container and tested that python is able to import lanelet2 correctly. However, how do I run the example C++ files provided? I'm specifically trying to run 06_routing example on the provided .osm example map. The repo does not list any steps to actually run the example. I would really appreciate the help. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.