Main Content

remapAnchor

Remap road anchor in RoadRunner Scenario in MATLAB

    Description

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

    example

    remapAnchor(rrApp,source,target,NewAnchorName=newName) also sets the name of the target anchor when the target is specified as a position.

    Examples

    collapse all

    Remap road 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 a road 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 road anchor on the road closest to the provided position. The distance between this position and the closest road in the scene must be greater than 25 meters.

    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.

    Version History

    Introduced in R2022b