function [scenario, egoVehicle] = exampleHelperUrbanScenario()
% createDrivingScenario Returns the drivingScenario defined in the Designer

% Generated by MATLAB(R) 9.7 (R2019b) and Automated Driving Toolbox 3.0 (R2019b).
% Generated on: 30-Jul-2019 09:16:52
% Copyright 2019 The MathWorks, Inc.

% Construct a drivingScenario object.
scenario = drivingScenario;

% Add all road segments
roadCenters = [0 0 0;
    150 0 0];
laneSpecification = lanespec(2);
road(scenario, roadCenters, 'Lanes', laneSpecification);

roadCenters = [80 59.95 0;
    80 -196 0];
laneSpecification = lanespec(4);
road(scenario, roadCenters, 'Lanes', laneSpecification);

roadCenters = [-0.005 -150 0;
    150 -150 0];
laneSpecification = lanespec(2);
road(scenario, roadCenters, 'Lanes', laneSpecification);

% Add the ego vehicle
egoVehicle = vehicle(scenario, ...
    'ClassID', 1, ...
    'Position', [5 -1.8 0]);

% Add the non-ego actors
car = vehicle(scenario, ...
    'ClassID', 1, ...
    'Position', [38 -1.8 0]);
waypoints = [38 -1.8 0;
    65.7 -1.8 0;
    100.1 -1.8 0;
    123 -1.8 0;
    145.8 -1.8 0];
speed = [10;12;10;0.1;0];
trajectory(car, waypoints, speed);

car1 = vehicle(scenario, ...
    'ClassID', 1, ...
    'Position', [74.45 33.1 0]);
waypoints = [74.45 33.1 0;
    74.45 -15.5 0;
    74.45 -30 0;
    74.45 -50 0;
    74.45 -88 0;
    74.45 -97.5 0;
    74.45 -160.7 0;
    74.45 -191 0];
speed = [14;14;8;4;4;4;0.001;0];
trajectory(car1, waypoints, speed);

car3 = vehicle(scenario, ...
    'ClassID', 1, ...
    'Position', [142.3 -148.2 0]);
waypoints = [142.3 -148.2 0;
    131 -148.2 0;
    101.6 -148.2 0;
    88.7 -148.2 0;
    57.7 -148.2 0;
    20.9 -148.2 0;
    2.7 -148.2 0];
speed = [2;6;8;8;8;2;0];
trajectory(car3, waypoints, speed);

car4 = vehicle(scenario, ...
    'ClassID', 1, ...
    'Position', [85.6 -191.9 0]);
waypoints = [85.625 -191.9 0;
    85.625 -84.8 0;
    85.625 -64.8 0;
    85.625 -9 0;
    85.625 10.3 0;
    85.625 56.3 0];
speed = [4;4;4;8;8;8];
trajectory(car4, waypoints, speed);

