メインコンテンツ

SpanSequenceNode

Define span sequence node in span sequence

Since R2025a

    Description

    The SpanSequenceNode object represents the span sequence node in a span sequence.

    Creation

    To retrieve a SpanSequenceNode object from a lane marking profile from your RoadRunner scene, extract the Nodes property of the corresponding LaneMarkingProfile object. For example, markingNodes = LaneMarkingProfile.Nodes extracts all the nodes in the marking profile and assigns them to the variable markingNodes.

    Properties

    expand all

    Distance of the node along the span sequence specified as a numeric scalar. Units are in meters. This distance is measured relative to the start of the span sequence and must lie within the range [0, total length of the span sequence].

    By default, a span sequence in RoadRunner includes two fixed nodes— one at the start (0 meters) and one at the end (equal to the total length of the span sequence). These nodes define the initial span and cannot be repositioned. You can add additional nodes at custom distances along the span sequence.

    Data Types: double

    This property is read-only.

    Span connected at the start of the node, specified as a SpanSequenceSpan object.

    This property is read-only.

    Span connected at the end of the node, specified as a SpanSequenceSpan object.

    Examples

    collapse all

    Create a roadrunner object, specifying the path to an existing project. For example, this code shows the path to a project, on a Windows® machine, located at "C:\RR\MyProject". This code assumes that RoadRunner is installed in the default location, and returns an object, rrApp, that provides functions for performing basic tasks such as opening, closing, and saving scenes and projects.

    rrApp = roadrunner(ProjectFolder="C:\RR\MyProject");

    Note

    If you are opening RoadRunner from MATLAB® for the first time, or if you have changed the RoadRunner installation location since you last opened it from MATLAB, you can use the roadrunnerSetup function to specify new default project and installation folders to use when opening RoadRunner. You can save these folders between MATLAB sessions by selecting the Across MATLAB sessions option from the corresponding drop down.

    Create a new scene in RoadRunner by using the newScene function, specifying the roadrunner object rrApp.

    newScene(rrApp)
    

    Create a RoadRunner authoring API object, rrAPI, that references the object for the current RoadRunner instance rrApp. The rrApi object enables you to programmatically author scenes, such as by adding and modifying road and lane components, using MATLAB.

    rrApi = roadrunnerAPI(rrApp);
    
    Extract the object for your scene from the Scene property of the authoring API object rrApi. The extracted Scene object enables you to specify the scene in which to add scene components, such as roads and lanes.
    scn = rrApi.Scene;

    Extract the object for your RoadRunner project from the Project property of the authoring API object rrApi. The extracted Project (RoadRunner)Project object enables you to specify the project folder for the current RoadRunner session from which to retrieve asset objects. You can use the asset objects to add lane markings to the lanes in your scene.

    scn = rrApi.Project;

    Use the addLineArcRoad function to add a new road with a line-arc horizontal curve type to the scene. Specify the position of the road by specifying the positions of its control points along the X- and Y- axes of the RoadRunner local coordinate system. Set the control points of the road to -100 and 50 on the X- axis and Y- axis, respectively.

    controlPoints = [-100 0; 0 50];
    rrRoad = addLineArcRoad(scn,controlPoints);

    Extract the reference lane from the ReferenceLane property of the road rrRoad. The extracted property ReferenceLane defines the center line of the road.

    refLane = rrRoad.ReferenceLane;

    Use the getAsset function to retrieve the LaneMarkingStyle objects for dashed solid yellow lane marking and solid yellow lane marking. These objects define the lane marking assets used to mark the spans in the lane marking profile of the reference lane.

    dashedSolidYellowMarkingStyle = getAsset(prj, "<PROJECT>/Assets/Markings/DashedSolidYellow.rrlms", "LaneMarkingStyle");
    solidDoubleYellowMarkingStyle = getAsset(prj, "<PROJECT>/Assets/Markings/SolidDoubleYellow.rrlms", "LaneMarkingStyle");

    Use the LaneMarkingProfile property of the refLane object to extract the lane marking profile of the reference lane.

    refLaneMarkingProfile = refLane.LaneMarkingProfile;

    Insert nodes in the lane marking profile at three 30-meter spans using the insertNode function. This divides the lane marking profile into four spans by inserting nodes at 30 meters, 60 meters, and 90 meters.

    insertNode(refLaneMarkingProfile, 30);
    insertNode(refLaneMarkingProfile, 60);
    insertNode(refLaneMarkingProfile, 90);
    

    Now, extract the individual span object refLaneSpan representing the span on which to place the desired lane marking using the Spans property of the lane marking profile object refLaneMarkingProfile. Mark the first and the third span with dashed solid yellow marking type and the second and fourth span with solid double yellow marking type. These markings denote passing zones on the road where vehicles are allowed to change lanes.

    refLaneSpan = refLaneMarkingProfile.Spans(1);
    refLaneSpan.LaneMarkingStyle = dashedSolidYelloMarkingStyle;
    refLaneSpan = refLaneMarkingProfile.Spans(2);
    refLaneSpan.LaneMarkingStyle = SolidDoubleYelloMarkingStyle;
    refLaneSpan = refLaneMarkingProfile.Spans(3);
    refLaneSpan.LaneMarkingStyle = dashedSolidYelloMarkingStyle;
    refLaneSpan = refLane.refLaneMarkingProfile.Spans(4);
    refLaneSpan.LaneMarkingStyle = SolidDoubleYelloMarkingStyle;
    

    Version History

    Introduced in R2025a

    See Also

    (RoadRunner) | (RoadRunner) | (RoadRunner)