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 in Unity: 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 example Map. Then every new object you create will be under Map 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.
  • 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 from SOLID_WHITE to DOUBLE_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 of global 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), select Aim as Y Neg, Up as Z Pos

  • 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 of MapToolUtilEdit to get MapSignalLightBuilder from HDMapSignalLightBuilder
  • Link the created traffic light to the corresponding stopline
  • Select both signallight and the stopline
  • Click Link SignalLight and StopLine in Advanced Utils section in the panel

  • Similarly, you can create stop sign and link the stop sign to the corresponding stopline using corresponding buttons.
  • Select desired traffic pole
  • Make sure Local and Z 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 VectorMapPoles
  • Select all VectorMapPole in Hierarchy 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 in Hierachy tab, click Export 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 click Export Vector Map