Map Annotation
The LGSVL Simulator supports creating, editing, and exporting of HD/vector maps of existing 3D environments (Unity scenes). The maps can be saved in the currently supported Apollo or Autoware formats.
Currently, map annotation is only supported while running the simulator as a Unity project in a Windows environment.
Creating a new map
- Open
MapToolUtilEdit
inUnity
:Window
->Map Tool Panel
- By default, map annotation is not shown. Click
Show/Hide Map
to show existing map annotation. - Before annotation, select correct
Parent Object
in MapToolUtilEdit, for exampleMap
. Then every new object you create will be underMap
object.
- After annotation is done, remember to save: go to
Map
level, click Apply
Annotate Lanes
Create temp map waypoint
- Maker sure your roads belong to the layer of
Ground and Road
since waypoint will be only created on this layer. - Click
Create Temp Map Waypoint
button to create a new point in the center of current scene window.
Make Lane
- Select the waypoint,
ctrl
+d
to duplicate and move them to desired positions
- Connect them to make a lane
- Sequentially select points
- Click
Make Lane (MapLaneSegmentBuilder)
button to make a lane
- You can make
StopLine
and BoundaryLine
in a similar way by using the other two buttons below Make Lane (MapLaneSegmentBuilder)
- In-Between Lane Generation
- You can make lanes by creating temp points and connecting them, and you can also make an in-between lane easily when you have two existing lanes and want to make another lane to connect them together
- Select both lanes, create the new in-between lane by clicking
Auto Generate In-Between Lane
button at the bottom of MapToolUtilEdit panel
- Because you might want to connect lanes of different angles and do it multiple times, we provide the ability of saving different presets to generate in-between lanes.
- Larger value of
Tangent
makes the lane more straight - You can also change the number of presets by changing
Preset Count
- Check
Offset Start/End Points
if you want a small offset between the end points of the new lane and the end point of the selected two lanes, otherwise those points will overlap with each other completely.
- Larger value of
Link neighbor lanes
- After you create parallel lanes, you need to link them to have correct relations
- Link neighbor lanes of same direction
- Select lanes sequentially from left/right
- Click
Link Neighbor Lanes from Left/Right
to link them - After linking, you can check it in every lane object's inspector
- Link reverse neighbor lanes
- Select both reverse neighbor lanes
- Click
Link Reverse Neighbor Lanes
-
In the above screenshot, double yellow boundary lane can be generated by creating BoundaryLine and changing its
Line Type
fromSOLID_WHITE
toDOUBLE_YELLOW
in its inspector -
If anything goes wrong, you can nullify all neighbor lane fields by clicking
Nullify All Neighbor Lane Fields
button
Set correct left/right boundary type
- The rightmost lane typically has a right boundary type of
CURB
- Middle lanes typically have a left boundary type of
DOUBLE_YELLOW
Traffic light annotation
- Make SignalLight
- Select
local
instead ofglobal
in both Unity and MapToolUtilEdit panel - Find one traffic light that is already made whose type is
HDMapSignalLight
(with a red boundary box) - Load template by clicking
Load SignalLight Template
button
- In the above screenshot, the left SignalLight (type: HDMapSignalLight) has a red boundary box and the right one (type: MapSignalLight) doesn't have it
- Make sure relative axis relations are selected correctly
- In the row of
Make SignalLight(HDMapSignalLightBuilder)
, selectAim
asY Neg
,Up
asZ Pos
- In the row of
- Select your desired empty signal light holder
- Click
Make SignalLight (HDMapSignalLightBuilder)
to generate the signal light
- Note: currently,
HDMapSignalLightBuilder
is for Apollo; one per road is enough.MapSignalLightBuilder
is for Autoware, which needs one for every lane. There is a converter button at the bottom ofMapToolUtilEdit
to getMapSignalLightBuilder
fromHDMapSignalLightBuilder
- Link the created traffic light to the corresponding stopline
- Select both signallight and the stopline
- Click
Link SignalLight and StopLine
inAdvanced Utils
section in the panel
- Similarly, you can create stop sign and link the stop sign to the corresponding stopline using corresponding buttons.
Create traffic pole and link to contained signal light (additional step for Autoware)
- Select desired traffic pole
- Make sure
Local
andZ Pos
are selected - Click
Make Traffic Pole (VectorMapPoleBuilder)
-
Press
w
so you can rotate the created pole. -
Rotate the bounding box of the pole to include corresponding signal lights in it
- Click
Link to Contained SignalLights
in the traffic pole's inspector - OR select both signal lights and traffic pole, click
Link TrafficPole and SignalLight
in the MapToolUtilEdit panel - For traffic poles in multiple intersections, to save time you can
- Create and rotate for all
VectorMapPole
s - Select all
VectorMapPole
inHierarchy
tab ->Link Selected TrafficPoles To Contained SignalLights
-
Notes for stopline
-
For Autoware, there needs to be two waypoints for every lane, i.e. five waypoints are needed for four lanes, three waypoints are needed for two lanes, etc. Apollo does not have such a requirement.
Export map files
- For Apollo, select
HDMapTool
inHierachy
tab, clickExport HD Map
- If your map annotation is correct, you will see
Successfully generated and exported Apollo HD Map!
in the Console - You can find the generated map file in
hd_map
folder under the root of the repo - It is similar for Autoware: select
VectorMapTool
, then clickExport Vector Map