Hauptinhalt

roadrunnerViewer

R2026b

Open RoadRunner Viewer instance and connect to MATLAB

Since R2026b

    Description

    The roadrunnerViewer object represents a RoadRunner Viewer that enables you to visualize and annotate simulation data in 3D using MATLAB®.

    Creation

    Description

    rrViewer = roadrunnerViewer opens an instance of RoadRunner Viewer and connects MATLAB to it using the roadrunnerViewer object rrViewer.

    example

    rrViewer = roadrunnerViewer(Name=Value) sets additional options using one or more name-value arguments. For example, ForceNew=true specifies for MATLAB to start a new RoadRunner Viewer instance instead of connecting to an existing one.

    Name-Value Arguments

    expand all

    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: roadrunnerViewer(ForceNew=true,ProjectFolder="C:\users\MyProject") starts a new instance of RoadRunner Viewer and sets the project folder to C:\users\MyProject.

    Path to the RoadRunner Viewer project folder, specified as a string scalar or character vector. RoadRunner Viewer uses the Assets folder in the specified location. To add objects to the viewer, such as 3D meshes, the path you specify must be relative to this Assets folder. If you specify a project folder that does not contain an Assets folder, RoadRunner Viewer creates an Assets folder in it. If you do not specify this option, RoadRunner Viewer uses the current MATLAB folder as its project folder.

    Example: roadrunnerViewer(ProjectFolder="C:\users\MyProject") specifies for RoadRunner Viewer to use the project folder located at C:\users\MyProject.

    Path to the RoadRunner Viewer executable, specified as a string scalar or character vector. If you installed RoadRunner in its default location, roadrunnerViewer locates the RoadRunner Viewer executable path automatically.

    These are the default RoadRunner Viewer executable path locations on Windows® and Linux®:

    • Windows — C:\Program Files\RoadRunner\R20NNx\roadrunner\bin\win64\AppRoadRunnerViewer.exe

    • Linux, Ubuntu® — /usr/local/RoadRunner/R20NNx/roadrunner/bin/glnxa64/AppRoadRunnerViewer.exe

    R20NNx is the release version of RoadRunner.

    If you installed RoadRunner in a location other than the default, you must specify this option.

    RoadRunner Viewer port, specified as a positive integer. You can use this argument to connect multiple MATLAB sessions to the same RoadRunner Viewer instance.

    Open a new instance of RoadRunner Viewer, specified as a logical 0 (false) or 1 (true). By default, if an instance of RoadRunner Viewer, that you opened from MATLAB, already exists, MATLAB reuses uses that instance when creating the roadrunnerViewer object. To open additional instances of RoadRunner Viewer, or to specify a different project folder location, specify this argument as true.

    Example: roadrunnerViewer(ForceNew=true) specifies for MATLAB to open a new instance of RoadRunner Viewer.

    Connection timeout, in seconds, specified as a numeric scalar. The connection timeout is the duration that MATLAB waits for RoadRunner Viewer to start before timing out.

    Output Arguments

    expand all

    RoadRunner Viewer, returned as a roadrunnerViewer object. The roadrunnerViewer object provides functions for performing basic tasks such as adding mesh nodes to the scene graph and drawing primitives.

    Properties

    expand all

    This property is read-only.

    RoadRunner Viewer API server port, represented as a positive integer.

    This property is read-only.

    RoadRunner Viewer camera, represented as a Camera object. You can use the Camera object to specify the position and orientation of the camera.

    This property is read-only.

    Root node of the RoadRunner Viewer scene graph, represented as a Node (RoadRunner Scenario) object. The RoadRunner Viewer root node is the parent node of the 3D meshes you add in the scene graph.

    Object Functions

    addMeshNodeAdd mesh node to RoadRunner Viewer scene graph
    removeMeshNodeRemove 3D mesh node and child nodes from RoadRunner Viewer scene graph
    addPrimitiveCreate primitive collection in RoadRunner Viewer scene graph
    addImageOverlayAdd image overlay to RoadRunner Viewer viewport
    addTextOverlayAdd text overlay to RoadRunner Viewer viewport
    drawnowUpdate RoadRunner Viewer scene graph
    resetClear RoadRunner Viewer scene graph
    closeClose RoadRunner Viewer

    Examples

    collapse all

    Open RoadRunner Viewer and specify a project folder. This example assumes you have already added the folder containing the RoadRunner API to your MATLAB path and created a project folder. For information on getting started with RoadRunner Viewer, see Get Started with RoadRunner Viewer (RoadRunner Scenario).

    Specify the path to a project folder. RoadRunner Viewer uses the 3D mesh, material, and image files in the Assets folder of the specified project.

    If you do not have a project folder and want to create one that already contains an Assets folder with sample files, create a RoadRunner project. By default, RoadRunner projects contain an Assets folder prepopulated with sample assets, such as a Sedan.fbx file, that you can use in RoadRunner Viewer. For information on creating a RoadRunner project, see RoadRunner Project and Scene System (RoadRunner).

    myProject="C:\users\MyProject"

    Open RoadRunner Viewer and specify your project folder.

    rrViewer = roadrunnerViewer(ProjectFolder=myProject);
    

    Close RoadRunner Viewer.

    close(rrViewer)

    Limitations

    • RoadRunner Viewer does not support interactively modifying 3D meshes, primitives, or overlays in the scene graph using the viewer user interface.

    • RoadRunner Viewer does not display animations for 3D meshes, such as walk cycles for character assets.

    • If you want to simulate a scenario that uses actor meshes from RoadRunner Scenario, you must export the scenario to an ASAM OpenSCENARIO® format.

    Version History

    Introduced in R2026b