10.10 Traffic signal
The following examples use the ASAM OpenDRIVE controller element for creating signal groups that have identical signal cycles. This is in alignment with civil engineering specifications like [14].
10.10.1 X-Junction
The following example shows an X-Junction with six traffic signals for vehicles, six traffic signals for trams, and eight traffic signals for pedestrians.
These are grouped into six controllers.
The ASAM OpenDRIVE controller ID is used as the name of the TrafficSignalController
to reference it.
The trafficSignalId
attributes are taken from ASAM OpenDRIVE.
Traffic signals can be modeled in two ways, just like in ASAM OpenDRIVE:
The type attribute of the ASAM OpenDRIVE signal specifies if the traffic signal was modeled as a whole box or if each light bulb was modeled individually. |
<TrafficSignals>
<TrafficSignalController name="42">
<Phase name="stop" duration="19">
<TrafficSignalState trafficSignalId="17251" state="on"/>
<TrafficSignalState trafficSignalId="17252" state="off"/>
<TrafficSignalState trafficSignalId="17253" state="off"/>
</Phase>
<Phase name="go" duration="12">
<TrafficSignalState trafficSignalId="17251" state="off"/>
<TrafficSignalState trafficSignalId="17252" state="off"/>
<TrafficSignalState trafficSignalId="17253" state="on"/>
</Phase>
<Phase name="attention" duration="2">
<TrafficSignalState trafficSignalId="17251" state="off"/>
<TrafficSignalState trafficSignalId="17252" state="on"/>
<TrafficSignalState trafficSignalId="17253" state="off"/>
</Phase>
<Phase name="stop" duration="39">
<TrafficSignalState trafficSignalId="17251" state="on"/>
<TrafficSignalState trafficSignalId="17252" state="off"/>
<TrafficSignalState trafficSignalId="17253" state="off"/>
</Phase>
</TrafficSignalController>
<TrafficSignalController name="43">
<Phase name="stop" duration="19">
<TrafficSignalState trafficSignalId="17261" state="on"/>
<TrafficSignalState trafficSignalId="17262" state="off"/>
<TrafficSignalState trafficSignalId="17263" state="off"/>
</Phase>
<Phase name="go" duration="12">
<TrafficSignalState trafficSignalId="17261" state="off"/>
<TrafficSignalState trafficSignalId="17262" state="off"/>
<TrafficSignalState trafficSignalId="17263" state="on"/>
</Phase>
<Phase name="attention" duration="2">
<TrafficSignalState trafficSignalId="17261" state="off"/>
<TrafficSignalState trafficSignalId="17262" state="on"/>
<TrafficSignalState trafficSignalId="17263" state="off"/>
</Phase>
<Phase name="stop" duration="39">
<TrafficSignalState trafficSignalId="17261" state="on"/>
<TrafficSignalState trafficSignalId="17262" state="off"/>
<TrafficSignalState trafficSignalId="17263" state="off"/>
</Phase>
</TrafficSignalController>
<TrafficSignalController name="44">
<Phase name="go" duration="15">
<TrafficSignalGroupState state="off;off;on"/>
</Phase>
<Phase name="attention" duration="3">
<TrafficSignalGroupState state="off;on;off"/>
</Phase>
<Phase name="stop" duration="48">
<TrafficSignalGroupState state="on;off;off"/>
</Phase>
<Phase name="stop_attention" duration="1">
<TrafficSignalGroupState state="on;on;off"/>
</Phase>
<Phase name="go" duration="5">
<TrafficSignalGroupState state="off;off;on"/>
</Phase>
</TrafficSignalController>
<TrafficSignalController name="45">
<Phase name="stop" duration="35">
<TrafficSignalGroupState state="on;off"/>
</Phase>
<Phase name="go" duration="20">
<TrafficSignalGroupState state="off;on"/>
</Phase>
<Phase name="stop" duration="17">
<TrafficSignalGroupState state="on;off"/>
</Phase>
</TrafficSignalController>
<TrafficSignalController name="46">
<Phase name="stop" duration="34">
<TrafficSignalGroupState state="on;off;off"/>
</Phase>
<Phase name="stop_attention" duration="1">
<TrafficSignalGroupState state="on;on;off"/>
</Phase>
<Phase name="go" duration="24">
<TrafficSignalGroupState state="off;off;on"/>
</Phase>
<Phase name="attention" duration="3">
<TrafficSignalGroupState state="off;on;off"/>
</Phase>
<Phase name="stop" duration="10">
<TrafficSignalGroupState state="on;off;off"/>
</Phase>
</TrafficSignalController>
<TrafficSignalController name="47">
<Phase name="go" duration="13">
<TrafficSignalGroupState state="off;on"/>
</Phase>
<Phase name="stop" duration="54">
<TrafficSignalGroupState state="on;off"/>
</Phase>
<Phase name="go" duration="5">
<TrafficSignalGroupState state="off;on"/>
</Phase>
</TrafficSignalController>
</TrafficSignals>
10.10.2 X-Junction with broken lights
To model a broken traffic signal, the observable state
of a TrafficSignalState
can be used.
In this example, the original Phase
instances of the TrafficSignalController
with the name "45" look like this:
<TrafficSignalController name="45">
<Phase name="stop" duration="35">
<TrafficSignalGroupState state="on;off"/>
</Phase>
<Phase name="go" duration="20">
<TrafficSignalGroupState state="off;on"/>
</Phase>
<Phase name="stop" duration="17">
<TrafficSignalGroupState state="on;off"/>
</Phase>
</TrafficSignalController>
If the traffic signal with ID "17271" had broken lights, all traffic signals would still have the same Phase
instances, but show a different observable state
.
The TrafficSignalController
with the name "45" would change to this:
<TrafficSignalController name="45">
<Phase name="stop" duration="35">
<TrafficSignalState trafficSignalId="17271" state="off;off"/> <!-- This light is broken-->
<TrafficSignalState trafficSignalId="17300" state="on;off"/>
<TrafficSignalState trafficSignalId="17360" state="on;off"/>
<TrafficSignalState trafficSignalId="17361" state="on;off"/>
</Phase>
<Phase name="go" duration="20">
<TrafficSignalState trafficSignalId="17271" state="off;off"/> <!-- This light is broken-->
<TrafficSignalState trafficSignalId="17300" state="off;on"/>
<TrafficSignalState trafficSignalId="17360" state="off;on"/>
<TrafficSignalState trafficSignalId="17361" state="off;on"/>
</Phase>
<Phase name="stop" duration="17">
<TrafficSignalState trafficSignalId="17271" state="off;off"/> <!-- This light is broken-->
<TrafficSignalState trafficSignalId="17300" state="on;off"/>
<TrafficSignalState trafficSignalId="17360" state="on;off"/>
<TrafficSignalState trafficSignalId="17361" state="on;off"/>
</Phase>
</TrafficSignalController>