Double Lane Change
Double lane change 3D environment
The Double Lane Change scene is a 3D environment of a straight road containing cones, traffic signs, and barrels. The cones are set up for a vehicle to perform a double lane change maneuver. The scene is rendered using RoadRunner.
To simulate a driving algorithm in this scene:
Add a Simulation 3D Scene Configuration block to your Simulink® model.
In this block, set the Scene source parameter to
Set the enabled Scene name parameter to
Double lane change.
Explore Double Lane Change Scene
Explore the 3D Double Lane Change scene and inspect its dimensions by using a corresponding 2D top-view image of the scene.
You can use this image to inspect the scene before simulation and choose starting coordinates for vehicles. For details on using these images to select waypoints for path-following applications, see the Select Waypoints for Unreal Engine Simulation example.
Load the 2D spatial referencing object that corresponds to the scene. This
imref2d object describes the relationship between the pixels in the image and the world coordinates of the scene.
data = load('sim3d_SpatialReferences.mat'); spatialRef = data.spatialReference.DoubleLaneChange
spatialRef = imref2d with properties: XWorldLimits: [-1008 1008] YWorldLimits: [-1008 1008] ImageSize: [5080 5080] PixelExtentInWorldX: 0.3969 PixelExtentInWorldY: 0.3969 ImageExtentInWorldX: 2016 ImageExtentInWorldY: 2016 XIntrinsicLimits: [0.5000 5.0805e+03] YIntrinsicLimits: [0.5000 5.0805e+03]
Display the image corresponding to the scene. Use the spatial referencing object to display the axes in the world coordinates of the scene. Units are in meters.
By default, the
imshow function displays Y-axis values that increase from top to bottom. To align with the Automated Driving Toolbox™ world coordinate system, set the Y-direction to
'normal' so that Y-axis values increase from bottom to top.
The image displays only the area of the scene containing the parking lot. The full scene has a length and width of 2016 meters.
figure fileName = 'sim3d_DoubleLaneChange.jpg'; I = imshow(fileName,spatialRef); set(gca,'YDir','normal') xlabel('X (m)') ylabel('Y (m)')
Zoom in on the origin of the scene. Place a marker at the origin. If you place a vehicle at the scene origin and set the vehicle's yaw angle to
0, the traffic cones for performing the double lane change maneuver are directly in front of the vehicle.
xlim([-100 100]) ylim([-100 100]) hold on plot(0,0,'o','MarkerFaceColor','r','MarkerEdgeColor','k','MarkerSize',8) offset = 3; % px text(offset,offset,'(0,0)','Color','w','FontWeight','bold','FontSize',12) hold off
If you have the Automated Driving Toolbox™ Interface for Unreal Engine® 4 Projects support package, then you can modify this scene. In the Unreal Engine project file that comes with the support package, this scene is named
For more details on customizing scenes, see Customize Unreal Engine Scenes for Automated Driving.
Version HistoryIntroduced in R2019b
R2022b: Scene rendered using RoadRunner
Starting from R2022b, the Double Lane Change scene in the Unreal Engine 3D environment is rendered using RoadRunner. As a result, the locations of scene objects, including cones and parked vehicles, are moved from their pre-R2022b locations.
Straight Road | Curved Road | Parking Lot | Large Parking Lot | Open Surface | US City Block | US Highway | Virtual Mcity