主要内容

FixedTrajectoryBehavior

R2026b

Fixed trajectory behavior

Since R2026b

    Description

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

    A FixedTrajectoryBehavior object controls how an actor moves along a predefined trajectory during simulation. The behavior advances the actor along the trajectory at each simulation time step.

    Creation

    When you use a groundTrajectory or airTrajectory object as input to an actor creation function such as car, aircraft, or actor, the scenario creates a FixedTrajectoryBehavior object and stores the object in the Behavior property of the Actor object.

    Properties

    expand all

    This property is read-only while the simulation is running.

    Ground or air trajectory, specified as a groundTrajectory or airTrajectory object. When you create an actor with a trajectory, the FixedTrajectoryBehavior object stores the trajectory in this property.

    This property is read-only while the simulation is running.

    Simulation step size, in seconds, specified as a positive duration scalar. This property specifies the maximum time between updates for the corresponding actor during simulation. If the scenario has multiple actor behaviors with different step sizes, the time between simulation steps can vary. For more information about simulating a 3D scenario, see Simulate 3D Scenarios.

    Data Types: duration

    Behavior visuals, represented as a vector of WaypointTrajectoryVisual objects. By default, when you add an actor with a trajectory to a scenario with open viewers, the scenario creates a WaypointTrajectoryVisual object for each viewer and stores the objects in this property.

    Adjust the properties of a WaypointTrajectoryVisual object by using dot notation. For example, hide the waypoints for the visual associated with trajectory traj by using traj.Visual.ShowWaypoints = "off". To edit or query the properties of multiple behavior visuals at once, use the set or get function. To get the visual for a specific viewer, use the getvisual function.

    Adding or removing objects using this property is not supported.

    Object Functions

    getvisualGet visual for actor, behavior, or analysis
    zoomtoFocus camera on actor, behavior, or analysis

    Version History

    Introduced in R2026b