Main Content

roadrunner.hdmap.SignalType

R2026b

Create signal type in RoadRunner HD Map

Since R2025a

    Description

    A roadrunner.hdmap.SignalType object enables you to define the type and type information for a signal in a RoadRunner HD Map scene model. 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

    signalType = roadrunner.hdmap.SignalType creates an empty signal type.

    signalType = roadrunner.hdmap.SignalType(PropertyName=Value) sets properties of the signal type using one or more name-value arguments. For example, ID="SignalType1" sets the ID of the signal type element to "SignalType1".

    example

    Properties

    expand all

    ID of the signal type, specified as a character vector or string scalar. The roadrunner.hdmap.Signal object references this field to describe the type of a signal.

    Data Types: char | string

    Relative path of a signal asset file, specified as a roadrunner.hdmap.RelativeAssetPath object. The asset file contains information about the signal type.

    Bulbs associated with the signal type, specified as an array of roadrunner.hdmap.Bulb objects. Each bulb represents an individual light element, such as red, yellow, or green bulb that is part of the signal head.

    Signal states supported by the signal type, specified as an array of roadrunner.hdmap.SignalState objects. Each signal state represents a named combination of bulb states. Junction phases reference a signal state to specify the state of the signal during a phase.

    Examples

    collapse all

    Create an empty RoadRunner HD Map as a default roadrunnerHDMap object.

    rrMap = roadrunnerHDMap
    rrMap = 
      roadrunnerHDMap with properties:
    
                     Author: ""
               GeoReference: [0 0]
         GeographicBoundary: []
                      Lanes: [0×1 roadrunner.hdmap.Lane]
                SpeedLimits: [0×1 roadrunner.hdmap.SpeedLimit]
             LaneBoundaries: [0×1 roadrunner.hdmap.LaneBoundary]
                 LaneGroups: [0×1 roadrunner.hdmap.LaneGroup]
               LaneMarkings: [0×1 roadrunner.hdmap.LaneMarking]
                  Junctions: [0×1 roadrunner.hdmap.Junction]
               BarrierTypes: [0×1 roadrunner.hdmap.BarrierType]
                   Barriers: [0×1 roadrunner.hdmap.Barrier]
                  SignTypes: [0×1 roadrunner.hdmap.SignType]
                      Signs: [0×1 roadrunner.hdmap.Sign]
          StaticObjectTypes: [0×1 roadrunner.hdmap.StaticObjectType]
              StaticObjects: [0×1 roadrunner.hdmap.StaticObject]
        StencilMarkingTypes: [0×1 roadrunner.hdmap.StencilMarkingType]
            StencilMarkings: [0×1 roadrunner.hdmap.StencilMarking]
          CurveMarkingTypes: [0×1 roadrunner.hdmap.CurveMarkingType]
              CurveMarkings: [0×1 roadrunner.hdmap.CurveMarking]
                SignalTypes: [0×1 roadrunner.hdmap.SignalType]
                    Signals: [0×1 roadrunner.hdmap.Signal]
    
    

    Create a relative path to an asset. This code creates a relative path to a signal asset file from the RoadRunner asset library. This path is relative to the Assets folder of your RoadRunner project.

    path = roadrunner.hdmap.RelativeAssetPath(AssetPath="Assets/Props/Signals/Signal_3Light_Post01.fbx")
    path = 
      RelativeAssetPath with properties:
    
        AssetPath: "Assets/Props/Signals/Signal_3Light_Post01.fbx"
    
    

    Create a signal type, as a roadrunner.hdmap.SignalType object with a specified signal type ID and an asset path for the type information, and add it to the RoadRunner HD Map.

    rrMap.SignalTypes = roadrunner.hdmap.SignalType(ID="SignalType1",AssetPath=path)
    rrMap = 
      roadrunnerHDMap with properties:
    
                     Author: ""
               GeoReference: [0 0]
         GeographicBoundary: []
                      Lanes: [0×1 roadrunner.hdmap.Lane]
                SpeedLimits: [0×1 roadrunner.hdmap.SpeedLimit]
             LaneBoundaries: [0×1 roadrunner.hdmap.LaneBoundary]
                 LaneGroups: [0×1 roadrunner.hdmap.LaneGroup]
               LaneMarkings: [0×1 roadrunner.hdmap.LaneMarking]
                  Junctions: [0×1 roadrunner.hdmap.Junction]
               BarrierTypes: [0×1 roadrunner.hdmap.BarrierType]
                   Barriers: [0×1 roadrunner.hdmap.Barrier]
                  SignTypes: [0×1 roadrunner.hdmap.SignType]
                      Signs: [0×1 roadrunner.hdmap.Sign]
          StaticObjectTypes: [0×1 roadrunner.hdmap.StaticObjectType]
              StaticObjects: [0×1 roadrunner.hdmap.StaticObject]
        StencilMarkingTypes: [0×1 roadrunner.hdmap.StencilMarkingType]
            StencilMarkings: [0×1 roadrunner.hdmap.StencilMarking]
          CurveMarkingTypes: [0×1 roadrunner.hdmap.CurveMarkingType]
              CurveMarkings: [0×1 roadrunner.hdmap.CurveMarking]
                SignalTypes: [1×1 roadrunner.hdmap.SignalType]
                    Signals: [0×1 roadrunner.hdmap.Signal]
    
    

    Create a signal type definition with a complete bulb configuration for a traffic light.

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

    bulbRed = roadrunner.hdmap.Bulb(ID="BulbRed",Name="Red Light");

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

    bulbStateRed = roadrunner.hdmap.BulbState(BulbRef=roadrunner.hdmap.Reference(ID="BulbRed"),State="On");

    Create a signal state representing the red signal configuration. This signal state defines the bulb state for the red bulb.

    signalStateRed = roadrunner.hdmap.SignalState(ID="Red",StateName="Red",BulbStates=bulbStateRed);

    Create a signal type that includes the bulb and signal state.

    signalType = roadrunner.hdmap.SignalType(ID="TrafficLight",Bulbs=bulbRed,SignalStates=signalStateRed)
    signalType = 
      SignalType with properties:
    
                  ID: "TrafficLight"
           AssetPath: [0×0 roadrunner.hdmap.RelativeAssetPath]
               Bulbs: [1×1 roadrunner.hdmap.Bulb]
        SignalStates: [1×1 roadrunner.hdmap.SignalState]
    
    

    Version History

    Introduced in R2025a

    expand all