Main Content

MovableObjectAsset

Movable object asset type

Since R2025a

    Description

    The MovableObjectAsset object represents an asset with the Movable Object asset type in the RoadRunner project. You can use the MovableObjectAsset object to represent MovableObject actors in the scenario.

    Creation

    The getAsset function extracts an object for the asset of the specified asset type at the specified path relative to the Asset folder of the specified project. Specify the assetType argument as "MovableObjectAsset" to extract a MovableObjectAsset object.

    Properties

    expand all

    This property is read-only.

    Relative path to the asset in the RoadRunner project, represented as a string scalar.

    This property is read-only.

    Axis-aligned bounding box used for collision detection, represented as an AlignedBox object. The AlignedBox object contains the Min, Max, Center, and Extents properties which represent the dimensions of the collision box for the asset. RoadRunner represents each property as a three-element vector.

    Examples

    collapse all

    Use getAsset to extract a MovableObjectAsset object from your RoadRunner project. Then, use addActor and the newly created MovableObjectAsset object to add a MovableObject actor to the scenario.

    This example assumes that you have prior knowledge of working with RoadRunner in MATLAB®. Before proceeding, follow the steps outlined in Set Up MATLAB Environment for RoadRunner Authoring Functions to set up your scenario using MATLAB functions for scenario authoring.

    Use the getAsset function to extract the MovableObjectAsset object myObj to represent the TrafficCone01.fbx asset in the project prj. Then, use the addActor function to add a MovableObject actor, cone, to the scenario scnro by specifying myObj as the asset to represent the new actor. Place the movable object actor cone at the world origin, specified as [0 0 0].

    myObj = getAsset(prj,"Props/TrafficControl/TrafficCone01.fbx","MovableObjectAsset");
    cone = addActor(scnro,myObj,[0 0 0]);
    
    Relocate the new actor by using findSceneAnchor to reference an existing anchor in the scene, then use anchorToPoint to relocate the actor from its current location to the location specified by the referenced anchor.

    anchorPoint = findSceneAnchor(scnro,"ScenarioStart");
    conePoint = cone.InitialPoint;
    anchorToPoint(conePoint,anchorPoint,PosePreservation="reset-pose")

    Run the simulation by using the simulateScenario function.

    simulateScenario(rrApp)

    MovableObject actors perform the same lane-following behavior as Vehicle actors. However, the default initial speed value for MovableObject actors is 0 m/s. To enable the MovableObject actor to move during simulation, change the Speed property of the initial phase to a value greater than 0. For more information on initial phases, see initialPhaseForActor.

    Version History

    Introduced in R2025a