主要内容

roadGroup

Add road junction or intersection to driving scenario

Description

example

roadGroup(scenario,rg)creates a road junction or intersection from road segments and adds it to the driving scenarioscenario。这路线组objectrgspecifies the road segments that link the roads meeting at an intersection.

Examples

collapse all

三向交点是Y结,其中两条相邻的道路以钝角与第三条道路相交,如该图所示。为了连接这三条道路,您将通过添加三个路段来创建Y结。

Add Three Roads to Driving Scenario

创建一个n empty driving scenario.

scenario = drivingScenario;

Specify the number of lanes and the width of each lane in the roads.

ls = lanespec(2,'Width',5);

Define the road centers for three roads and add them to the driving scenario. The first road is diagonally oriented to the left of the scenario canvas, second road is diagonally oriented to the right of the scenario canvas, and the third road is oriented vertically.

% Add the first roadroadCenters = [-20 0; 6 0]; road(scenario,roadCenters,'Name','Road 1','Lanes',LS);%添加第二条路Roadcenters = [23 7;50 33]; road(scenario,roadCenters,'Name','Road 2','Lanes',LS);% Add the third roadroadCenters = [23 7; 50 -33]; road(scenario,roadCenters,'Name','Road 3','Lanes',LS);

Plot the scenario.

figure plot(scenario)

Figure contains an axes object. The axes object contains 5 objects of type patch, line.

Create Y-Junction to Connect Roads

创建一个路线组目的。Specify the width for each road segment that forms the Y-junction.

rg = drive.scenario.RoadGroup('Name','Y-Junction'); roadWidth = 10;

Specify the road centers for three road segments, and add these road segments to the路线组object by using theroadfunction. These road segments intersect with each other.

%添加第一个路段Roadcenters = [23 7;14 1;6 0];路(RG,Roadcenters,Roadwidth,'Name','Segment 1');%添加第二条路segmentroadCenters = [23 7; 14 -1; 6 0]; road(rg,roadCenters,roadWidth,'Name','Segment 2');%添加第三条路段Roadcenters = [23 7;21 4;21 -4;23 -7];路(RG,Roadcenters,Roadwidth,'Name','Segment 3');

Add Y-Junction to Driving Scenario

Add the road segments stored in the路线组object to the driving scenario by using theroadGroupfunction. The road segments form a Y-Junction that connects the three roads in the driving scenario.

路线组(场景,RG);

Figure contains an axes object. The axes object contains 3 objects of type patch, line.

Input Arguments

collapse all

驾驶场景,指定为drivingScenario目的。

Specifications for road segments that form an intersection, specified as a路线组目的。添加单独的道路细分市场,以连接每对十字路口的每一道通行道路会议。使用roadfunction to add a road segment to the路线组目的。

Note

  • You cannot alter the properties of road segments after adding them to the路线组目的。

限制

  • 这function does not support lane markings in intersections.

  • 这scenario plot does not display the road centers in the intersection.

Tips

  • Add at least one road segment to the路线组object to create an intersection using theroadGroupfunction.

  • To create a smooth surface shape in an intersection, you must match the specifications (road centers, width, elevation and banking angle) of the road segments in the路线组反对在十字路口开会的道路会议的人。

  • 该函数仅考虑每个道路段的第一个车道规范,同时创建交叉点,因此仅为每个道路段的单车道规范指定路线组object .

Version History

Introduced in R2021a