Main Content

roadrunner.hdmap.BulbState

R2026b

Define signal bulb state in RoadRunner HD Map

Since R2026b

    Description

    A roadrunner.hdmap.BulbState defines the state of a signal bulb in a RoadRunner HD Map scene model. A BulbState object describes the operating state of a bulb at a specific time instance, such as "On", "Off", or "Blinking". Use this object to associate a signal bulb with its operating state as part of a signal configuration. For an example of how to create a complete T-junction with roads, maneuver lanes, and traffic signal phases that includes bulb-level signal control, see Build Signalized Junction Using RoadRunner HD Map.

    Creation

    Description

    bulbState = roadrunner.hdmap.BulbState creates an empty bulb state.

    bulbState = roadrunner.hdmap.BulbState(PropertyName=Value) sets one or more properties of the bulb state using name-value arguments. For example, State="On" specifies the state of the bulb as "On".

    example

    Properties

    expand all

    Reference to the signal bulb, specified as a roadrunner.hdmap.Reference object. This reference must specify the ID property value of a roadrunner.hdmap.Bulb object.

    Example: bulbState = roadrunner.hdmap.BulbState(BulbRef=roadrunner.hdmap.Reference(ID="BulbRed")) creates a bulb state that references a bulb with the ID "BulbRed".

    Operating state of the signal bulb, specified as one of these values:

    • "On"

    • "Off"

    • "Blinking"

    Example: bulbState = roadrunner.hdmap.BulbState(State="On") creates a bulb state with the state set to "On".

    Data Types: char | string

    Examples

    collapse all

    Create a signal bulb representing the red light in a traffic signal.

    bulbMeta = roadrunner.hdmap.Metadata(Name="Color",Value="Red");
    bulbRed = roadrunner.hdmap.Bulb(ID="BulbRed",Name="Red Light",Metadata=bulbMeta)
    bulbRed = 
      Bulb with properties:
    
              ID: "BulbRed"
            Name: "Red Light"
        Metadata: [1×1 roadrunner.hdmap.Metadata]
    
    

    Create a bulb state that sets the red bulb to "On".

    bulbStateRed = roadrunner.hdmap.BulbState(BulbRef=roadrunner.hdmap.Reference(ID="BulbRed"),State="On")
    bulbStateRed = 
      BulbState with properties:
    
        BulbReference: [1×1 roadrunner.hdmap.Reference]
                State: "On"
    
    

    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