Software-Aurora-Lab / ADS-Scenario-Transformer

Transferring scenarios running on Apollo and SimControl environments to scenarios running on Autoware and TIER IV Scenario Simulator v2 environments.
MIT License
4 stars 0 forks source link

Traffic Signal mapping between Apollo HD Map and Autoware Vector Map #17

Closed hcn1519 closed 4 months ago

hcn1519 commented 6 months ago

You can map the ID of traffic lights by checking whether the polygons of the traffic lights in the Apollo HD Map's Signal and Autoware Vector maps overlap by a certain percentage.

signal {
  id {
    id: "signal_1"
  }
  boundary {
    point {
      x: 587058.85589504242
      y: 4141604.0102615356
      z: 5.4707951545715332
    }
    point {
      x: 587059.47325801849
      y: 4141603.8475570679
      z: 5.4707951545715332
    }
    point {
      x: 587059.47325801849
      y: 4141603.8475570679
      z: 3.9743266105651855
    }
    point {
      x: 587058.85589504242
      y: 4141604.0102615356
      z: 3.9743266105651855
    }
  }
  subsignal {
    id {
      id: "0"
    }
    type: CIRCLE
    location {
      x: 587059.16457557678
      y: 4141603.9289073944
      z: 5.122560977935791
    }
  }
  subsignal {
    id {
      id: "1"
    }
    type: CIRCLE
    location {
      x: 587059.16457557678
      y: 4141603.9289073944
      z: 4.7225608825683594
    }
  }
  subsignal {
    id {
      id: "2"
    }
    type: CIRCLE
    location {
      x: 587059.16457557678
      y: 4141603.9289073944
      z: 4.3225607872009277
    }
  }
  overlap_id {
    id: "overlap_signal_1_lane_44"
  }
  overlap_id {
    id: "overlap_signal_1_lane_43"
  }
  overlap_id {
    id: "overlap_signal_1_lane_45"
  }
  overlap_id {
    id: "overlap_junction_I0_J0_signal_0_1"
  }
  type: MIX_3_VERTICAL
  stop_line {
    segment {
      line_segment {
        point {
          x: 587044.3645362854
          y: 4141560.2021617889
        }
        point {
          x: 587049.3931388855
          y: 4141558.9247989655
        }
        point {
          x: 587055.289273262
          y: 4141557.3708648682
        }
      }
    }
  }
}
<way id="468">
    <nd ref="466"/>
    <nd ref="467"/>
    <tag k="type" v="traffic_light"/>
    <tag k="subtype" v="red_yellow_green"/>
    <tag k="height" v="1.46000003814697"/>
</way>
<node id="466" lat="37.41705226969418" lon="-122.01638274507728">
    <tag k="mgrs_code" v="10SEG870415"/>
    <tag k="local_x" v="87039.2134"/>
    <tag k="local_y" v="41592.9489"/>
    <tag k="ele" v="4.5704"/>
    <tag k="x" v="-30.79523"/>
    <tag k="y" v="15.94909"/>
  </node>
  <node id="467" lat="37.417057744995795" lon="-122.01638085972475">
    <tag k="mgrs_code" v="10SEG870415"/>
    <tag k="local_x" v="87039.3739"/>
    <tag k="local_y" v="41593.5581"/>
    <tag k="ele" v="4.5704"/>
    <tag k="x" v="-30.63468"/>
    <tag k="y" v="16.55828"/>
  </node>
{
    "header": {
        "timestamp_sec": 1661458004.7851071,
        "module_name": "MAGGIE",
        "sequence_num": 1
    },
    "traffic_lights": [
        {
            "color": "GREEN",
            "id": "signal_10",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_0",
            "confidence": 1
        },
        {
            "color": "GREEN",
            "id": "signal_1",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_2",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_3",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_4",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_5",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_6",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_7",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_8",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_9",
            "confidence": 1
        },
        {
            "color": "GREEN",
            "id": "signal_11",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_12",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_13",
            "confidence": 1
        },
        {
            "color": "RED",
            "id": "signal_14",
            "confidence": 1
        }
    ]
}
hcn1519 commented 4 months ago

https://publications.pages.asam.net/standards/ASAM_OpenSCENARIO/ASAM_OpenSCENARIO_XML/v1.2.0/10_scenario_creation/10_10_traffic_signal.html