-
Notifications
You must be signed in to change notification settings - Fork 0
/
trigger.m
91 lines (74 loc) · 2.84 KB
/
trigger.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
function [scenario, egoVehicle] = trigger()
% createDrivingScenario Returns the drivingScenario defined in the Designer
% Generated by MATLAB(R) 9.9 (R2020b) and Automated Driving Toolbox 3.2 (R2020b).
% Generated on: 08-Jan-2021 13:35:24
% Construct a drivingScenario object.
scenario = drivingScenario;
% Add all road segments
roadCenters = [41.41 61.515 0;
41.41 0 0];
laneSpecification = lanespec(4, 'Width', 3.5);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road');
roadCenters = [54.81 0 0;
54.81 61.515 0];
marking = [laneMarking('Solid', 'Color', [0.98 0.86 0.36])
laneMarking('Dashed')
laneMarking('Dashed')
laneMarking('Dashed')];
laneSpecification = lanespec(3, 'Width', 3.12, 'Marking', marking);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road1');
roadCenters = [55 8.757 0;
-9.1672 8.757 0];
laneSpecification = lanespec(2, 'Width', 4);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road2');
roadCenters = [-9.1672 -1.753 0;
55 -1.753 0];
laneSpecification = lanespec(2, 'Width', 4);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road3');
roadCenters = [53.88 -44.835 0;
53.88 4.3 0];
laneSpecification = lanespec(4, 'Width', 3.75);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road4');
roadCenters = [39.3 4.3 0;
39.3 -44.835 0];
laneSpecification = lanespec(3, 'Width', 3.2);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road5');
roadCenters = [82.61 2.717 0;
40 2.717 0];
laneSpecification = lanespec([1 2], 'Width', 4);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road6');
roadCenters = [87.31 4.247 0;
332.31 4.247 0];
laneSpecification = lanespec([1 1], 'Width', 4);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road7');
roadCenters = [340.6 4.247 0;
384.5 4.247 0];
laneSpecification = lanespec([1 1], 'Width', 4);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road8');
roadCenters = [384.184 221.595 0;
384.184 -25.5086 0];
laneSpecification = lanespec([1 1], 'Width', 4);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road9');
roadCenters = [384.5 6.247 0;
429.31 6.247 0];
laneSpecification = lanespec([1 1], 'Width', 4);
road(scenario, roadCenters, 'Lanes', laneSpecification, 'Name', 'Road10');
% Add the ego vehicle
egoVehicle = vehicle(scenario, ...
'ClassID', 1, ...
'Name', 'Car');
% Add the non-ego actors
vehicle(scenario, ...
'ClassID', 1, ...
'Position', [36.699085259906 18.7595787254525 0], ...
'Yaw', -87, ...
'PlotColor', [0.494 0.184 0.556], ...
'Name', 'trigger');
actor(scenario, ...
'ClassID', 6, ...
'Length', 2, ...
'Width', 2, ...
'Height', 0.1, ...
'Position', [27.4 0.5 0], ...
'PlotColor', [0.635 0.078 0.184], ...
'Name', 'trigger');