主要内容

car

R2026b

Create car actor in 3D scenario

Since R2026b

    Description

    Add-On Required: This feature requires the 3D Scenarios add-on.

    actr = car(scnro,p) creates a car actor in the specified scenario using the specified position or trajectory. A car actor includes a 3D model used for visualization and analysis. If you specify multiple positions or trajectories, then the function creates multiple car actors.

    By default, creating an actor automatically creates an actor visual in each open scenario viewer. To avoid the automatic creation of visuals in a viewer, set the AutoUpdate property of the corresponding GlobeViewer object to "off".

    actr = car(scnro,p,Name=name) specifies the name of the car actor.

    Input Arguments

    collapse all

    3D scenario, specified as a Scenario object.

    When the scenario uses custom terrain, the actor must be within the bounds of the terrain.

    Actor position or trajectory, specified as one of these options:

    • A geospatial table containing 2D geopointshape objects — Place the actors at the positions specified by the table. You can create a geospatial table from coordinates by using the pointtable function. Each row of the table corresponds to one actor. The car function places the actors on the terrain or surface specified by the height reference of the points. If the points do not specify a height reference, then the function places the actors on the terrain.

    • A vector of pose objects — Place the actors using the positions and orientations specified by the pose objects. Each pose object corresponds to one actor.

      • The velocity, acceleration, angular velocity, and angular acceleration of the pose objects must be 0.

      • If the ReferenceFrame property of the pose object is empty, then the function interprets the pose using the ReferenceFrame property of the scene.

    • A vector of groundTrajectory objects — Place the actors using the initial positions and orientations specified by the trajectory objects. Each trajectory object corresponds to one actor. The function converts the trajectory objects to FixedTrajectoryBehavior objects and stores them in the Behavior property.

    Actor name, specified as a string scalar, character vector, string array, or cell array of character vectors. Actor names do not need to be unique.

    This argument sets the Name property of each actor object.

    Data Types: char | string | cell

    Output Arguments

    collapse all

    Car actor, returned as an m-by-1 vector of Actor objects, where m is the number of actors.

    Version History

    Introduced in R2026b

    See Also

    Functions

    Objects