Main Content

ScenarioServices

Perform calculations on scene elements of RoadRunner Scenario in MATLAB

Since R2024b

    Description

    A ScenarioServices object allows access to a set of services that perform calculations on scene elements of RoadRunner Scenario. For example, you can get the point of intersection of a ray with the closest surface in its path, given its source point and direction of travel.

    Creation

    Get the ScenarioServices object associated with a scenario by using the get function of the ScenarioSimulation object.

    Description

    scenarioServ = get(scenarioSim,"ScenarioServices") returns a ScenarioServices object scenarioServ for the ScenarioSimulation object scenarioSim.

    example

    Input Arguments

    expand all

    RoadRunner scenario simulation, specified as a ScenarioSimulation object.

    Object Functions

    getGet calculations on scene elements of RoadRunner Scenario in MATLAB

    Examples

    collapse all

    This example workflow assumes that:

    • You have a RoadRunner license, and the product is installed.

    • You have a RoadRunner Scenario license, and the product is installed.

    Create a roadrunner object to launch the RoadRunner application, which then connects to the project folder at the specified path for use. For example:

    rrApp = roadrunner("C:\ScenarioServices_proj");

    Open the scenario file LaneChangeInterruptsSwerve.rrscenario that is included with the RoadRunner Scenario application.

    openScenario(rrApp,"LaneChangeInterruptsSwerve");

    Connect to the RoadRunner Scenario server to enable cosimulation by creating a ScenarioSimulation object named scenarioSim.

    scenarioSim = createSimulation(rrApp);

    Get a ScenarioServices object named scenarioServ by using the scenarioSim object.

    scenarioServ = get(scenarioSim,"ScenarioServices");

    Version History

    Introduced in R2024b