Contenu principal

setPlatform

Assign platform to behavior asset

Since R2025b

    Description

    behaviorPlatform = setPlatform(behaviorAsset,platformType) assigns the specified platform platformType to the specified behavior asset behaviorAsset.

    By default, behavior assets use the RoadRunner platform, which recognizes only .rrbehavior files. To use behavior files defined outside of RoadRunner, such as in Simulink® or CARLA, you can use the setPlatform function to specify a different platform for a behavior asset, then associate the resulting platform object with your behavior file. This enables you to cosimulate scenarios across different applications. For more information about cosimulating scenarios, see Overview of Simulating RoadRunner Scenarios with MATLAB and Simulink and Overview of RoadRunner Scenario and CARLA Cosimulation (RoadRunner Scenario).

    Input Arguments

    collapse all

    Behavior asset for which to specify a platform, specified as a BehaviorAsset object.

    Type of platform to assign, specified as one of these strings:

    • "RoadRunnerPlatform" — Specifies the platform of the behavior asset as a RoadRunnerPlatform object.

    • "SimulinkPlatform" — Specifies the platform of the behavior asset as a SimulinkPlatform object.

    • "ExternalPlatform" — Specifies the platform of the behavior asset as an ExternalPlatform object.

    Example: simPlatform = setPlatform(simBehavior,"SimulinkPlatform"); creates a SimulinkPlatform object, simPlatform, and assigns it to the Platform property of the behavior asset simBehavior.

    Output Arguments

    collapse all

    Platform of the behavior asset, returned as one of these objects:

    • RoadRunnerPlatform object — Represents the platform of a behavior asset defined in RoadRunner.

    • SimulinkPlatform object — Represents the platform of a behavior asset defined in MATLAB® or Simulink.

    • ExternalPlatform object — Represents the platform of a behavior asset defined in an external platform, such as CARLA.

    Version History

    Introduced in R2025b