watonomous.github.io

  1. Software Division
  2. Software Division Home
  3. Processing Group
  4. HD Mapping

[ Software Division : OSM HD Map Technical Documentation ]

Created by [ Rowan Dempster], last modified by [ Henry Wang] on Mar 05, 2020

Recently Autonomous provided us with their OSM HD Map of our local test track facility ([WRESTRC). ] is available in the shared drive. In the absence of HERE HD Maps of local facilities, this is a tremendous resource for us as it enables us to test locally.

Lanelet OSM Format

Unlike HERE HD Maps, in the context of OSM, there is no standard definition for the representation of an HD Map, once again OSM format is custom-defined. Thankfully we don't have to come up with our own custom OSM representation, we will be using the Lanelet Maps described in Edward Chao's thesis and used by Autonomoose. [This format defines a human readable representation of the static environment and is able to represent geometrically and topologically accurate maps that are useful for navigation.]

The Lanelet Map is represented in xml file format, and follows the OSM data format.

[The atomic element of the Lanelet Map is the node, which is ][a single point that specifies a position in the world described by a latitude and longitude coordinate.  ]Additional properties can be tagged on a node, for example elevation. But for our purposes we are only concerned with latitude and longitude. An example of a node is shown below.

<node id=’-1123941’ lat=’43.5014638934’ lon=’-80.5366403762’>
    <tag k=’elevation’ v=’308.722194092’ />
</node> 

Two ordered nodes define a directed line segment, which is referred to as a way. Ways are polylines composed of two or more ordered nodes. A way can have many interpretations, it can be used to describe the geometry of a lane line, or the center reference line of a lane. An example of a way is shown below.

<way id=’-1145270’>
    <nd ref=’-1123941’ />
    <nd ref=’-1132261’ />
    <nd ref=’-1132263’ />
    <nd ref=’-1132265’ />
</way>

The minimal lanelet is defined by two ways, conventionally named left and right. Lanelets can represent a multitude of different road elements, but our context they represent drive lanes. For the purpose of lane centering, lanelets in Autonomoose's OSM maps are augmented with explicitly defined center ways. Properties applied to a lanelet are constant through the entire lanelet. For example, the speed limit on drive lanes. Therefore, when the speed limit changes, the lanelet must end and another lanelet must begin to reflect the change in property.

Driving direction is implied by the ordering of the nodes in the ways that are referenced by a lanelet. Since two lanelets with opposite driving direction can share their left way, the ordering of nodes in the shared left way is not used. Right side driving roads in North America can reliably depend on the right side way node ordering for driving direction. With Autonomoose OSM maps, the center way also implies driving direction. Therefore the center and right way of a lanelet are polylines going in the same direction.

An example of a lanelet is shown below.

<relation id=’-1145345’>
    <member type=’way’ ref=’-1145270’ role=’left’ />
    <member type=’way’ ref=’-1145255’ role=’right’ />
    <member type=’way’ ref=’-1145290’ role=’center’ />
    <member type=’relation’ ref=’-1145344’ role=’left’ />
    <member type=’relation’ ref=’-1145357’ role=’next’ />
    <member type=’relation’ ref=’-1145358’ role=’next’ />
    <tag k=’lane_type’ v=’driving’ />
    <tag k=’left_marking’ v=’none’ />
    <tag k=’name’ v=’-61099’ />
    <tag k=’right_marking’ v=’none’ />
    <tag k=’speed_limit’ v=’50’ />
    <tag k=’type’ v=’lanelet’ />
</relation> 

Connections define the road network by referencing drivable transitions from one lanelet to another. A lanelet's connections to other lanelets are represented by the left, right, next, and previous members. These connections define purely topological relations and do not represent legal transitions. For example, 2 adjacent lanelets of opposite direction both refer to one another with left connection members, but a lane change is typically not allowed. Lanelets may have multiple next and previous connections for representing many paths a vehicle can take. For example, at a four way stop sign intersection, a [lanelet entering the intersection can have three next lanelets: one for going straight, one for left turn, and one for right turn.]

[The figure below shows a simple example of such a lanelet connections. The main lanelet is composed of 3 ways (left, center, right), colored in red.  The two next connecting lanelets are highlighted in purple. One goes straight, the other is a right turn.]

[[{.confluence-embedded-image height=”400”}]{.confluence-embedded-file-wrapper .confluence-embedded-manual-size}]


Regulatory elements can be embedded into lanelets with property tags. For example a single stop regulation uses a node to represent a stop sign, and a way to represent the stop line. An example of a single stop regulation is shown below.

<relation id=’-1145343’ visible=’true’>
    <member type=’node’ ref=’-1130597’ role=’position’ />
    <member type=’way’ ref=’-1145323’ role=’stop_line’ />
    <tag k=’regulation’ v=’stop’ />
    <tag k=’type’ v=’regulatory_element’ />
</relation>

Additional regulatory elements such as pedestrian crosswalks, traffic lights can be added to the lanelet map definition simply by referring to them in the lanelet on which it affects.

JOSM

JOSM is the software tool used to view and edit OSM maps. It also allows for inspection of map "relations", that is, how lanelets are related to each other and other properties.

[{.confluence-embedded-image height=”250”}]{.confluence-embedded-file-wrapper .confluence-embedded-manual-size}

Installation

This tool works cross platform. Installation on Windows and MacOS is very easy, follow instructions at to their site

For installation on ubuntu, use the commands below.

echo deb https://josm.openstreetmap.de/apt $(lsb_release -sc) universe |
sudo tee /etc/apt/sources.list.d/josm.list > /dev/null
wget -q https://josm.openstreetmap.de/josm-apt.key -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get remove josm josm-plugins
sudo apt-get install josm

[Code Documentation From F19 Predecessors]

Instructions to test

cd ~/catkin_ws
git clone https://git.uwaterloo.ca/WATonomous/decision # checkout the develop branch
git clone https://git.uwaterloo.ca/WATonomous/localization # checkout the master branch
cd ~/catkin_ws
catkin_make

Then, in the 1st terminal run roscore
In 2nd terminal: rosrun osm_parsing publish_osm_lanes.py
In third terminal: rosrun path_planning rviz_publisher
In 4th terminal: rviz
In RVIZ, load the lanes.rviz config.

Then finally run a rosbag that has /navsat/odom data such as test_track_odom_2019_oct6.bag by running something like rosbag play test_track_odom_2019_oct6.bag

Output should be something like below, using the RVIZ visualizer
Sample videos here https://drive.google.com/drive/folders/17F8sEj44bFTe-eVukm1aMFiMfMSYr584

[{.confluence-embedded-image .confluence-external-resource}]

To use a different map, change the rosparam input file in hd_maps.launch

Resources

\

Attachments:

Screen Shot 2020-01-16 at 12.16.46 PM.png (image/png)
Screen Shot 2020-01-16 at 12.44.42 PM.png (image/png)\

Document generated by Confluence on Dec 10, 2021 04:02

Atlassian