Main Content

remapAnchor

Remap anchors in RoadRunner Scenario in MATLAB

Since R2022b

    Description

    remapAnchor(rrApp,source,target) remaps dependencies from a source anchor in the scenario to a different target anchor. You can specify the name of the source anchor and the name or position of the target anchor.

    example

    remapAnchor(rrApp,source,target,Name=Value) also sets additional options using one or more name-value arguments, such as the name or type of the target anchor, when the target is specified as a position.

    Examples

    collapse all

    Remap source anchor to a target anchor

    Open a project in RoadRunner using the roadrunner function by specifying the location in which to create a project. This example assumes that RoadRunner is installed in its default location in Windows.

    Specify the path to an existing project. For example, this code shows the path to a project located on C:\RR\MyProject. The function returns a roadrunner object, rrApp, that provides functions for performing basic workflow tasks such as opening, closing, and saving scenes and projects.

    projectFolder = "C:\RR\MyProject";
    rrApp = roadrunner(projectFolder, InstallationFolder='C:\Program Files\RoadRunner R2022b\bin\win64');

    Open an existing scenario in RoadRunner Scenario by calling the openScenario function and passing it the rrApp object and the specific scenario filename that you want to open. This call opens the desired scenario in the RoadRunner Scenario application through MATLAB.

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

    Remap the source anchor to the target anchor by calling the remapAnchor function and passing it the rrApp object and the source anchor name, the target anchor name and the new anchor name.

    remapAnchor(rrApp,"ScenarioStart",[-20 0 0],NewAnchorName="anchor3");

    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.

    Source anchor in scenario, specified as a character vector or string scalar.

    Target anchor in scenario, specified as one of these values.

    • A character vector or string scalar indicating the name of the target anchor. A name remap searches for an anchor with matching name in the scenario and scene.

    • A three-element numeric vector indicating the position of the target anchor relative to the center of the scene. A position remap creates a new anchor on the road closest to the provided position. The distance between this position and the closest road in the scene must be less than 25 meters.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: remapAnchor(rrApp,"anchor2",[-20 0 0],NewAnchorName="anchor3",AnchorType="Scenario")

    New anchor name for a position remap, specified as a character vector or string scalar. If the value is not specified, the remapAnchor function uses the default value.

    Type of anchor to be created for position remap, specified as "Unspecified", "AppPreference", "Scenario", or "Scene". The default type, "AppPreference", is the type set in the scenario application preferences. "Scenario" specifies the anchor as a scenario anchor, and "Scene" specifies the anchor as a scene anchor. If you set AnchorType to "Unspecified", RoadRunner Scenario uses the default AnchorType value, "AppPreference".

    Version History

    Introduced in R2022b

    expand all