varySceneProperties
Syntax
Description
varySceneProperties(
        adds property variations for the road variations,roadID,Name=Value)roadID to the
          variationProperties object variations by using one
        or more name-value arguments.
varySceneProperties(
        adds property variations for the lane variations,roadID,laneID,Name=Value)laneID on the road
          roadID to the variationProperties object
          variations by using one or more name-value arguments. For example,
          varySceneProperties(variation,1,2,Width=10) specifies a variant lane
        width of 10 meters for the lane with lane ID 2 on the road with road ID 1.
Note
This function requires the Automated Driving Toolbox™ Test Suite for Euro NCAP® Protocols support package. You can install the Automated Driving Toolbox Test Suite for Euro NCAP Protocols support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
Examples
Load a driving scenario into the workspace.
load("scenarioWithSingleActor.mat")Create a scenario descriptor from the input seed scenario.
seedScenarioDescriptor = getScenarioDescriptor(sc,Simulator="DrivingScenario");Create a variationProperties object.
variation1 = variationProperties;
Add scene property variations to a road by specifying the road ID, width of the road, and marking color of the road boundaries.
roadID = 1;
varySceneProperties(variation1,roadID,Width=30,MarkingColor="yellow")ans = 
  variationProperties with properties:
        ActorVariationProperties: [1×1 struct]
    CollisionVariationProperties: []
        SceneVariationProperties: [1×1 struct]
         TestVariationProperties: [1×1 struct]
Using the seed scenario descriptor and the scene variation, generate a scenario variant descriptor.
scenarioVariantDescriptor1 = generateVariants(seedScenarioDescriptor,variation1);
Generate a variant scenario, as a drivingScenario object, from the scenario variant descriptor object.
scenarioVariant1 = getScenario(scenarioVariantDescriptor1,Simulator="DrivingScenario");Create another variationProperties object.
variation2 = variationProperties;
Add scene property variations to a lane by specifying the road ID, lane ID, width of the lane, lane marking, and marking color of the lane boundaries.
roadID = 1; laneID = 2; varySceneProperties(variation2,roadID,laneID,Width=10,Marking="solid",MarkingColor="white")
ans = 
  variationProperties with properties:
        ActorVariationProperties: [1×1 struct]
    CollisionVariationProperties: []
        SceneVariationProperties: [1×1 struct]
         TestVariationProperties: [1×1 struct]
Using the seed scenario descriptor and the scene variation, generate another scenario variant descriptor.
scenarioVariantDescriptor2 = generateVariants(seedScenarioDescriptor,variation2);
Generate another variant scenario, as a drivingScenario object, from the scenario variant descriptor object.
scenarioVariant2 = getScenario(scenarioVariantDescriptor2,Simulator="DrivingScenario");Create a custom figure window to plot the seed scenario and the scenario variants.
figScene = figure; set(figScene,Position=[200 200 900 300]) hCarViewPanel1 = uipanel(figScene,Position=[0 0 0.33 1],Title="Input Seed Scenario"); hCarPlot1 = axes(hCarViewPanel1); hCarViewPanel2 = uipanel(figScene,Position=[0.34 0 0.33 1],Title='Generated Scenario Variant1'); hCarPlot2 = axes(hCarViewPanel2); hCarViewPanel3 = uipanel(figScene,Position=[0.68 0 0.33 1],Title='Generated Scenario Variant2'); hCarPlot3 = axes(hCarViewPanel3);
Plot the seed scenario and its variants. Observe the scene variation in the generated scenario variants.
plot(sc,Waypoints="on",Parent=hCarPlot1) plot(scenarioVariant1,Waypoints="on",Parent=hCarPlot2) plot(scenarioVariant2,Waypoints="on",Parent=hCarPlot3)

Input Arguments
Variation properties, specified as a variationProperties object. 
ID of the road, specified as a positive integer.
Data Types: int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
ID of the lane, specified as a positive integer.
Data Types: int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Name-Value Arguments
Specify optional pairs of arguments as
      Name1=Value1,...,NameN=ValueN, where Name is
      the argument name and Value is the corresponding value.
      Name-value arguments must appear after other arguments, but the order of the
      pairs does not matter.
    
Example: varySceneProperties(variation,1,2,Width=10) specifies a
        variant lane width of 10 meters for the lane with lane ID 2 on the road with road ID
        1.
Width of the road or lane, specified as a positive scalar. Units are in meters.
For the first syntax, the Width name-value argument specifies
              the road width. For
              example,
varySceneProperties(variation,1,Width=10)
For the second syntax, the Width name-value argument
              specifies the lane width. For
              example,
varySceneProperties(variation,1,2,Width=10)
Example: Width=10 specifies a variant lane or road width of 10
              meters.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Type of the lane, specified as "driving" or
                "parking".
For the first syntax, the LaneType name-value argument
              specifies the type of lane for all lanes on the specified road. For
              example,
varySceneProperties(variation,1,LaneType="parking")
For the second syntax, the LaneType name-value argument
              specifies the type of lane for the specified lane on the specified road. For
              example,
varySceneProperties(variation,1,2,LaneType="parking")
Example: LaneType="parking" specifies a variant lane with a lane
              type of parking.
Data Types: char | string
Lane markings of the road, specified as "solid",
                "dashed", "doublesolid", or
                "doubledashed".
For the first syntax, the Marking name-value argument
              specifies the type of marking for the sides of the specified road. For
              example,
varySceneProperties(variation,1,Marking="solid")
For the second syntax, the Marking name-value argument
              specifies the type of marking for the sides of the specified lane. For
              example,
varySceneProperties(variation,1,2,Marking="solid")
Example: Marking="solid" specifies the type of marking as solid
              for the sides of the specified lane or road.
Data Types: char | string
Marking color of the lane or road boundaries, specified as
                "white" or "yellow".
For the first syntax, the MarkingColor name-value argument
              specifies the marking color for the sides of the specified road. For
              example,
varySceneProperties(variation,1,MarkingColor="white")
For the second syntax, the MarkingColor name-value argument
              specifies the marking color for the sides of the specified lane on the specified road.
              For
              example,
varySceneProperties(variation,1,2,MarkingColor="white")
Example: MarkingColor="white" specifies the marking color for
              the sides of the specified lane or road as white.
Data Types: char | string
Marking width of the lane or road boundaries, specified as a positive scalar or a two-element numeric row vector. Units are in meters.
If you specify a scalar, the variationProperties object stores
              the marking width for both the boundaries of the specified road or lane. If you
              specify a two-element numeric row vector of the form [a
              b], the variationProperties object stores the
              marking widths a and b for the left and right
              boundaries of the specified lane or road, respectively. For more information on the
              direction of roads and lanes, see Draw Direction of Road and Numbering of Lanes.
For the first syntax, the MarkingWidth name-value argument
              specifies the marking width of the road boundaries. For
              example,
varySceneProperties(variation,1,MarkingWidth=3)
For the second syntax, the MarkingWidth name-value argument
              specifies the marking width of the specified lane boundaries on the specified road.
              For
              example,
varySceneProperties(variation,1,2,MarkingWidth=3)
Example: MarkingWidth=3 specifies a variant marking width of 3
              meters for sides of the specified lane or road.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Marking side of the lane or road boundaries, specified as
                "both", "left", or "right".
              For more information on the direction of roads and lanes, see Draw Direction of Road and Numbering of Lanes.
For the first syntax, the MarkingSide name-value argument
              specifies the side of the specified road that applies the marking. For
              example,
varySceneProperties(variation,1,MarkingSide="left")
For the second syntax, the MarkingSide name-value argument
              specifies the side of the specified lane on the specified road that applies the
              marking. For
              example,
varySceneProperties(variation,1,2,MarkingSide="left")
Example: MarkingSide="left" specifies that the left side of the
              specified road or lane that applies marking.
Data Types: char | string
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
 - Canada (English)
 - United States (English)
 
유럽
- Belgium (English)
 - Denmark (English)
 - Deutschland (Deutsch)
 - España (Español)
 - Finland (English)
 - France (Français)
 - Ireland (English)
 - Italia (Italiano)
 - Luxembourg (English)
 
- Netherlands (English)
 - Norway (English)
 - Österreich (Deutsch)
 - Portugal (English)
 - Sweden (English)
 - Switzerland
 - United Kingdom (English)