Contenuto principale

roadrunner.hdmap.SignalState

R2026b

Define signal head state in RoadRunner HD Map

Since R2026b

    Description

    A roadrunner.hdmap.SignalState object defines the state of a traffic signal head in a RoadRunner HD Map scene model. A SignalState object represents a named configuration of bulb states for a traffic signal head. Use this object to group multiple bulb states that together define how a signal head appears during a traffic signal phase. For an example of how to create a complete T-junction with roads, maneuver lanes, and traffic signal phases that include bulb-level signal control, see Build Signalized Junction Using RoadRunner HD Map.

    Creation

    Description

    signalState = roadrunner.hdmap.SignalState creates an empty signal state.

    signalState = roadrunner.hdmap.SignalState(PropertyName=Value) sets one or more properties of the signal state using name-value arguments. For example, ID="Red" specifies the ID of the signal state as "Red".

    example

    Properties

    expand all

    ID of the signal state, specified as a character vector or string scalar.

    Example: signalState = roadrunner.hdmap.SignalState(ID="Red") creates a signal state with the ID "Red".

    Data Types: char | string

    Name of the signal state, specified as a character vector or string scalar. You can use this property to describe the bulb configuration of the state, such as "Red", "Yellow", or "Green".

    Example: signalState = roadrunner.hdmap.SignalState(StateName="Green") creates a signal state with the name "Green".

    Data Types: char | string

    States of bulbs in the signal head, specified as an array of roadrunner.hdmap.BulbState objects. Each bulb state defines whether a particular bulb is "On", "Off", or "Blinking".

    Examples

    collapse all

    Create a signal state representing a green traffic light where the green bulb is on and other bulbs are off.

    Create signal bulbs representing the red, yellow, and green lights in a traffic signal.

    bulbRed = roadrunner.hdmap.Bulb(ID="BulbRed",Name="Red Light");
    bulbYellow = roadrunner.hdmap.Bulb(ID="BulbYellow",Name="Yellow Light");
    bulbGreen = roadrunner.hdmap.Bulb(ID="BulbGreen",Name="Green Light");

    Define bulb states for the red, yellow, and green bulbs.

    bulbStateRed = roadrunner.hdmap.BulbState(BulbRef=roadrunner.hdmap.Reference(ID="BulbRed"),State="Off");
    bulbStateYellow = roadrunner.hdmap.BulbState(BulbRef=roadrunner.hdmap.Reference(ID="BulbYellow"),State="Off");
    bulbStateGreen = roadrunner.hdmap.BulbState(BulbRef=roadrunner.hdmap.Reference(ID="BulbGreen"),State="On");

    Create a signal state that combines the bulb states.

    signalStateGreen = roadrunner.hdmap.SignalState(ID="Green",StateName="Green",BulbStates=[bulbStateRed;bulbStateYellow;bulbStateGreen])
    signalStateGreen = 
      SignalState with properties:
    
                ID: "Green"
         StateName: "Green"
        BulbStates: [3×1 roadrunner.hdmap.BulbState]
    
    

    Limitations

    • RoadRunner does not import, visualize, or apply traffic signal bulb state information defined in RoadRunner HD Map files when you load them into a RoadRunner scene.

    Version History

    Introduced in R2026b