주요 콘텐츠

StandStillCondition

R2026b

Specify Stand Still condition

Since R2026b

    Description

    A StandStillCondition object represents a Stand Still condition in the RoadRunner scenario logic. The Stand Still condition specifies for the associated phase to end when the specified actor has remained stationary for the specified duration. To add a Stand Still condition to a phase in the scenario logic, specify StandStillCondition as the condition type when creating an end or fail condition. Use the StandStillCondition object to programmatically modify the attributes of the corresponding Stand Still condition by changing the values of its properties.

    Creation

    You can create a StandStillCondition object in these ways:

    • The setEndCondition function creates and assigns a condition of the specified type to the end of a specified phase. Specify the conditionType argument as "StandStillCondition" to create a StandStillCondition object associated with the specified phase.

    • The setFailCondition function assigns a condition of the specified type to the Fail Conditions of the scenario root phase. Specify the conditionType argument as "StandStillCondition" to create a StandStillCondition object associated with the scenario Fail Conditions.

    Properties

    expand all

    Name of the condition, specified as a string scalar or character vector.

    Note

    You can specify the Name property of StandStillCondition in MATLAB®, but RoadRunner Scenario does not display the Name property of conditions in the user interface.

    Actor to monitor for the stand still condition, specified as one of these objects:

    • Vehicle — Represents a vehicle actor in the RoadRunner scenario.

    • Character — Represents a character actor in the RoadRunner scenario.

    • MovableObject — Represents a movable object actor in the RoadRunner scenario.

    If you do not specify this property, RoadRunner Scenario automatically uses the actor from the parent phase in the scenario logic to which you assign the condition.

    Duration, in seconds, for which the actor must remain stationary before the condition is satisfied, specified as a nonnegative scalar. RoadRunner Scenario measures the elapsed time during which the specified actor remains at zero speed against the value of Duration.

    Data Types: double

    Examples

    collapse all

    Create a scenario in which a vehicle brakes to a complete stop and remains stationary for 3 seconds, then transitions to an acceleration phase in which the vehicle resumes driving.

    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.

    Design Scenario Using Stand Still Condition

    Use addPhaseInSerial to add a braking phase after the initial driving phase. Use addAction to add a Change Speed action that decelerates the actor at 5 m/s² until it comes to a complete stop.

    brakePhase = addPhaseInSerial(rrLogic,initPhase,"ActorActionPhase",Insertion="after");
    brakePhase.Actor = car;
    brakeAction = addAction(brakePhase,"ChangeSpeedAction");
    brakeAction.Speed = 0;
    brakeAction.DynamicsDimension = "rate";
    brakeAction.DynamicsValue = 5;

    Use setEndCondition to add a StandStillCondition to the braking phase. Set the Actor property to the vehicle that has braked to a stop and the Duration property to 3 seconds. The scenario waits for the actor to remain stationary for the specified duration before transitioning to the next phase.

    rrCondition = setEndCondition(brakePhase,"StandStillCondition");
    rrCondition.Actor = car;
    rrCondition.Duration = 3;

    Use addPhaseInSerial to add an acceleration phase after the braking phase. The actor accelerates to 15 m/s at 3 m/s² once the stand still condition has been satisfied.

    accelPhase = addPhaseInSerial(rrLogic,brakePhase,"ActorActionPhase",Insertion="after");
    accelPhase.Actor = car;
    accelAction = addAction(accelPhase,"ChangeSpeedAction");
    accelAction.Speed = 15;
    accelAction.DynamicsDimension = "rate";
    accelAction.DynamicsValue = 3;

    Simulate the scenario using the simulateScenario function. The actor brakes to a stop, remains stationary for 3 seconds, and then accelerates to resume driving.

    simulateScenario(rrApp)

    Version History

    Introduced in R2026b