メインコンテンツ

Scene

Current RoadRunner scene

Since R2025a

    Description

    The Scene object represents the current scene in RoadRunner. Use a Scene object to specify the scene in which to add scene components, such as roads and lanes.

    Creation

    To return the Scene object that represents your current RoadRunner scene, extract the Scene property of your roadrunnerAPI object and assign it to a variable.

    For example, to create the Scene object scn from the roadrunner object rrApp, you can create a roadrunnerAPI object using rrApp and extract the Scene property of the roadrunnerAPI object:

    scn = roadrunnerAPI(rrApp).Scene

    Properties

    expand all

    This property is read-only.

    Roads in the scene, specified as a Road object.

    Object Functions

    addLineArcRoadAdd road with line-arc horizontal curve type to RoadRunner scene
    addSegmentedRoadAdd road with segmented curve type to RoadRunner scene
    addClothoidFitRoadAdd clothoid curve type road to RoadRunner scene

    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.

    Open an existing scene in RoadRunner by using the openScene function, specifying the roadrunner object rrApp and the filename of the specific scene that you want to open.

    openScene(rrApp,"FourWaySignal.rrscene")
    

    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

    Version History

    Introduced in R2025a