Add CARLA's traffic lights, stop signs and stop lines to Town10HD_Opt

#5
The Autoware Foundation org

The Town10HD_Opt lanelet2 map had no regulatory elements, so nothing in it said where a vehicle stops or which signal it obeys. Autoware could not look for the signals, and a scenario could not ask for the approach to a signalised junction.

This adds CARLA 0.10's own, read from a running server by the new scripts/add_regulatory_elements.py. For each lane a signal or stop sign governs, it follows CARLA's stop waypoints (or the sign's trigger volume) to where the lane enters its junction. There it adds:

  • a stop line: the end edge of the approach lanelet, through its two existing nodes, which are the nodes the junction lanelets start from;
  • a traffic_light regulatory element (a traffic_sign one for a stop sign) with that stop line as its ref_line, referenced by every junction lanelet (turn_direction) leaving the approach;
  • one traffic_light linestring per signal head, with its height and light_bulbs, in Autoware's lanelet2 format.

In all, 30 traffic-light regulatory elements for CARLA's 15 signals and 3 for its stop signs, on 62 of the 86 junction lanelets. Every approach CARLA reports was matched to a lanelet whose end is within 1 m. The file is edited as text, so the diff is only the added elements plus one member line per regulated lanelet. The original geometry is unchanged.

Checked with autoware_carla_scenario's logical scenarios on CARLA 0.10 with this map. Those that need stop lines expanded to cases they could not before, and ran:

  • traffic_light_compliance: 30/30 pass (0 cases before);
  • temporary_stop: 6/6 pass (0 before);
  • intersection_passing/right_turn_sweep: 18 cases (0 before).

The README's provenance now also records the turn_direction tags from #3.

The Autoware Foundation org

The script that generated these regulatory elements is a one-off tool, so it is no longer committed here. It is kept as a gist instead: https://gist.github.com/hakuturu583/f11582b8ca65a5e2efae9fe884e1dfc0

To regenerate, with a CARLA 0.10 server running Town10HD_Opt:

python add_regulatory_elements.py autoware_maps/Town10HD_Opt/lanelet2_map.osm --host localhost --port 2000

Run it on the map before this PR; it refuses a map that already has traffic lights. The output is byte-identical to the lanelet2_map.osm in this PR. The README's provenance links the gist.

The Autoware Foundation org

Merging: checked with autoware_carla_scenario's logical scenarios on CARLA 0.10 (traffic_light_compliance 30/30, temporary_stop 6/6).

hakuturu583 changed pull request status to merged

Sign up or log in to comment