function [scenario,assessment, laneInfo, targetVehicles] = scenario_LFACC_02_Straight_IntelligentLaneFollowing
% scenario_LFACC_02_Straight_IntelligentLaneFollowing creates a scenario
% that is compatible with
% HighwayLaneFollowingWithIntelligentVehiclesTestBench.slx model. This test
% scenario is on a straight road scenario. There are three other vehicles
% in this test scenario. One of the three vehicle is configured to do lane
% following and rest are configured with velocity keeping behavior.
% EgoCar travels by following the lanes.

% Copyright 2020 The MathWorks, Inc.

%  Get driving scenario that is compatible with
%  HighwayLaneFollowingWithIntelligentVehiclesTestBench.slx
[scenario, assessment, laneInfo] = helperGetLaneFollowingScenario("Straight road");

% Declare intelligentVehicles structure
targetVehicles = struct();

%% Add ego vehicle to the scenario
% Actors(1) is EgoCar in this scenario.
EgoCar = scenario.Actors(1);

% EgoCar travels in Lane4 with speed 10m/s
% Place EgoCar in Lane4 
Lane3CenterY  = laneInfo(4).LaneCenters(1,2);
waypoints = [...
    0   Lane3CenterY 0;
    500 Lane3CenterY 0];
speed = 10;
trajectory(EgoCar, waypoints, speed);

%% Add target vehicle 1
target1 = scenario.Actors(2);

% target1 travels in Lane5 with speed 13m/s
Lane4CenterY  = laneInfo(5).LaneCenters(1,2);
waypoints = [...
    0   Lane4CenterY 0;
    500 Lane4CenterY 0];
speed = 13;
trajectory(target1, waypoints, speed);

% Assign target1 attributes to intelligentVehicles structure
targetVehicles(1,1).ActorID = target1.ActorID;
targetVehicles(1,1).Position = target1.Position;
targetVehicles(1,1).Velocity = target1.Velocity;
targetVehicles(1,1).Roll = target1.Roll;
targetVehicles(1,1).Pitch = target1.Pitch;
targetVehicles(1,1).Yaw = target1.Yaw;
targetVehicles(1,1).AngularVelocity = target1.AngularVelocity;
targetVehicles(1,1).InitialLaneID = 5;
targetVehicles(1,1).BehaviorType  = VehicleBehavior.LaneFollowing;

%% Add target vehicle 2
target2 = scenario.Actors(3);

% target2 travels in Lane5 with speed 5m/s
Lane4CenterY  = laneInfo(5).LaneCenters(1,2);
waypoints = [...
    40  Lane4CenterY 0;
    500 Lane4CenterY 0];
speed = 5;
trajectory(target2, waypoints, speed);

% Assign target2 attributes to intelligentVehicles structure
targetVehicles(2,1).ActorID = target2.ActorID;
targetVehicles(2,1).Position = target2.Position;
targetVehicles(2,1).Velocity = target2.Velocity;
targetVehicles(2,1).Roll = target2.Roll;
targetVehicles(2,1).Pitch = target2.Pitch;
targetVehicles(2,1).Yaw = target2.Yaw;
targetVehicles(2,1).AngularVelocity = target2.AngularVelocity;
targetVehicles(2,1).InitialLaneID = 5;
targetVehicles(2,1).BehaviorType  = VehicleBehavior.VelocityKeeping;

%% Add target vehicle 3
target3 = scenario.Actors(4);

% target3 travels in Lane4 with speed 5m/s
Lane4CenterY  = laneInfo(4).LaneCenters(1,2);
waypoints = [...
    100  Lane4CenterY 0;
    500 Lane4CenterY 0];
speed = 5;
trajectory(target3, waypoints, speed);

% Assign target3 attributes to intelligentVehicles structure
targetVehicles(3,1).ActorID = target3.ActorID;
targetVehicles(3,1).Position = target3.Position;
targetVehicles(3,1).Velocity = target3.Velocity;
targetVehicles(3,1).Roll = target3.Roll;
targetVehicles(3,1).Pitch = target3.Pitch;
targetVehicles(3,1).Yaw = target3.Yaw;
targetVehicles(3,1).AngularVelocity = target3.AngularVelocity;
targetVehicles(3,1).InitialLaneID = 4;
targetVehicles(3,1).BehaviorType  = VehicleBehavior.VelocityKeeping;

%% Add target vehicle 4
target4 = scenario.Actors(5);

% Assign target4 attributes to intelligentVehicles structure
targetVehicles(4,1).ActorID = target4.ActorID;
targetVehicles(4,1).Position = target4.Position;
targetVehicles(4,1).Velocity = target4.Velocity;
targetVehicles(4,1).Roll = target4.Roll;
targetVehicles(4,1).Pitch = target4.Pitch;
targetVehicles(4,1).Yaw = target4.Yaw;
targetVehicles(4,1).AngularVelocity = target4.AngularVelocity;
targetVehicles(4,1).InitialLaneID = 5;
targetVehicles(4,1).BehaviorType  = VehicleBehavior.Default;

%% Add target vehicle 5
target5 = scenario.Actors(6);

% Assign target5 attributes to intelligentVehicles structure
targetVehicles(5,1).ActorID = target5.ActorID;
targetVehicles(5,1).Position = target5.Position;
targetVehicles(5,1).Velocity = target5.Velocity;
targetVehicles(5,1).Roll = target5.Roll;
targetVehicles(5,1).Pitch = target5.Pitch;
targetVehicles(5,1).Yaw = target5.Yaw;
targetVehicles(5,1).AngularVelocity = target5.AngularVelocity;
targetVehicles(5,1).InitialLaneID = 5;
targetVehicles(5,1).BehaviorType  = VehicleBehavior.Default;

% Simulation stop time
scenario.StopTime = 10;