Main Content

getAnchors

Retrieve anchor attributes from RoadRunner scenario using MATLAB

Since R2024a

    Description

    values = getAnchors(rrApp) retrieves the attributes for the available scene and scenario anchors in the specified RoadRunner scenario rrApp. The function returns the attributes as an array structures with these fields: Name, AnchorType, RoadID, and WorldPosition.

    Examples

    collapse all

    Retrieve information for all anchors in the current RoadRunner scenario using MATLAB®.

    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 workflow tasks such as opening, closing, and saving scenes and projects.

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

    Open an existing scenario in RoadRunner Scenario by using the openScenario function with the roadrunner object, rrApp, and the filename of the specific scenario that you want to open. This MATLAB code opens the desired scenario in RoadRunner Scenario.

    filename = "TrajectoryCutIn.rrscenario";
    openScenario(rrApp,filename)

    Retrieve the attributes for all anchors in the scenario using the getAnchors function.

    values = getAnchors(rrApp)

    Input Arguments

    collapse all

    RoadRunner application associated with a project, specified as a roadrunner object. This object provides functions for performing common workflow tasks such as opening, closing, and saving scenes and projects. rrApp provides functions that support importing data from files and exporting scenes to other formats from RoadRunner.

    Output Arguments

    collapse all

    Attributes of the available scene and scenario anchors, returned as a structure array with these fields:

    • Name — Name of the anchor.

    • AnchorType — Type of anchor.

    • RoadID — ID of the road that contains the anchor.

    • WorldPosition — Position of the anchor in world coordinates.

    Version History

    Introduced in R2024a