MovableObjectAsset
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
This property is read-only.
Relative path to the asset in the RoadRunner project, represented as a string scalar.
Since R2026a
Forward distance, in meters, from the movable object mesh and the geometric center of its generated bounding box to the movable object origin, specified as a numeric scalar in the range [–10, 10]. The movable object origin is on the ground, at the geometric center of the movable object.
Since R2026a
Lateral distance, in meters, from the movable object mesh and the geometric center of its generated bounding box to the movable object origin, specified as a numeric scalar in the range [–5, 5] where a negative value offsets the movable object mesh and bounding box to the left of the origin. The movable object origin is on the ground, at the geometric center of the movable object.
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
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]);
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 R2025aAs of R2026a Update 4, the MovableObjectAsset object has new
ForwardOffset and LateralOffset properties that
enable you to specify the forward and lateral offset values, respectively, of the associated
movable object asset origin.
RoadRunner Scenario updates the position of the generated bounding box of movable object assets so
that it is centered at the xy-position [0, 0] relative
to the asset origin. By centering the bounding box to the asset origin, RoadRunner Scenario can calculate more accurate collisions in scenarios that use movable object
assets.
If you open a scenario in a project created with a previous version, RoadRunner Scenario automatically updates the bounding box positions of all movable object assets.
See Also
addActor | createAsset | MovableObject | CharacterAsset | VehicleAsset
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)