US City Block

US city block 3D environment

Description

The US City Block scene is a 3D environment of a US city block that contains 15 intersections and 30 traffic lights. The scene is rendered using the Unreal Engine® from Epic Games®.

To simulate a driving algorithm in this scene:

  1. Add a Simulation 3D Scene Configuration block to your Simulink® model.

  2. In this block, set the Scene source parameter to Default Scenes.

  3. Set the enabled Scene name parameter to US city block.

Traffic Lights

The US City Scene contains 30 traffic lights, two at each of the 15 intersections. Each intersection has a traffic light group. If you use the Traffic Light Negotiation with Unreal Engine Visualization example, you can control the timing of the traffic lights.

This table provides the traffic light names and locations in the world coordinate system. Dimensions are in m. Only one of the traffic lights in the group can be green at a time. The traffic lights are green for 10 s and yellow for 3 s. At the start of the simulation, the first traffic lights in the group are green (for example, SM_TrafficLights1_3 and SM_TrafficLights2_3). The second lights in the group are red (for example, SM_TrafficLights1_4 and SM_TrafficLights2_4).

Intersection

Unreal Engine Editor Name

Location

Traffic Light GroupTraffic Light

X

Y

Z

Roll

Pitch

Yaw

1

TrafficLightGroup

SM_TrafficLights1_3

-196.55100.650

0

0

-90°

SM_TrafficLights1_4

-210.20113.400

0

0

0

2

TrafficLightGroup2

SM_TrafficLights2_3

-106.35-98.350

0

0

90°

SM_TrafficLights2_4

-120.40113.500

0

0

0

3

TrafficLightGroup3

SM_TrafficLights3_1

-13.10116.200.2

0

0

-90°

SM_TrafficLights3_4

-30.60113.800

0

0

0

4

TrafficLightGroup4

SM_TrafficLights4_3

71.40100.300

0

0

100°

SM_TrafficLights4_4

64.80113.00

0

0

0

5

TrafficLightGroup5

SM_TrafficLights5_1

171.50115.700

0

0

-90°

SM_TrafficLights5_4

157.40113.500

0

0

0

6

TrafficLightGroup6

SM_TrafficLights6_2

-177.30-5.700

0

0

-180°

SM_TrafficLights6_3

-189.60-7.400

0

0

90°

7

TrafficLightGroup7

SM_TrafficLights7_2

-105.20-5.500

0

0

-180°

SM_TrafficLights7_3

-117.80-7.700.2

0

0

90°

8

TrafficLightGroup8

SM_TrafficLights8_1

-13.107.600.1

0

0

-90°

SM_TrafficLights8_2

-10.90-5.600

0

0

-180°

9

TrafficLightGroup9

SM_TrafficLights9_2

85.90-7.600.2

0

0

-180°

SM_TrafficLights9_3

70.90-9.200

0

0

90°

10

TrafficLightGroup10

SM_TrafficLights10_1

172.107.700

0

0

-90°

SM_TrafficLights10_2

173.70-7.500

0

0

-180°

11

TrafficLightGroup11

SM_TrafficLights11_3

-189.80-118.450

0

0

90°

SM_TrafficLights11_4

-191.05-104.550

0

0

0

12

TrafficLightGroup12

SM_TrafficLights12_3

-117.60-117.600

0

0

90°

SM_TrafficLights12_4

-120.50-105.400

0

0

0

13

TrafficLightGroup13

SM_TrafficLights13_1

-12.80-102.500

0

0

-90°

SM_TrafficLights13_4

-30.50-105.300

0

0

0

14

TrafficLightGroup14

SM_TrafficLights14_3

70.90-118.700

0

0

90°

SM_TrafficLights14_4

69.30-105.300

0

0

0

15

TrafficLightGroup15

SM_TrafficLights15_1

171.40-105.200

0

0

-90°

SM_TrafficLights15_4

158.40-107.200

0

0

0

Explore US City Block Scene

Explore the 3D US City Block 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 (Image Processing Toolbox) 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.USCityBlock
spatialRef = 
  imref2d with properties:

           XWorldLimits: [-243.0500 200.2500]
           YWorldLimits: [-215.6500 227.6500]
              ImageSize: [4275 4275]
    PixelExtentInWorldX: 0.1037
    PixelExtentInWorldY: 0.1037
    ImageExtentInWorldX: 443.3000
    ImageExtentInWorldY: 443.3000
       XIntrinsicLimits: [0.5000 4.2755e+03]
       YIntrinsicLimits: [0.5000 4.2755e+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 city block. The full scene has a length and width of 2040 meters.

figure
fileName = 'sim3d_USCityBlock.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.

xlim([-35 35])
ylim([-35 35])

hold on
plot(0,0,'o','MarkerFaceColor','r','MarkerEdgeColor','k','MarkerSize',8)
offset = 1; % px
text(offset,offset,'(0,0)','Color','w','FontWeight','bold','FontSize',12)
hold off

Each intersection in the scene contains two traffic light groups. These traffic lights change color based on common US traffic light patterns. All roads in the scene are one-way and follow the direction of traffic shown here.

Tips

  • 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 USCityBlock.

    For more details on customizing scenes, see Customize Unreal Engine Scenes for Automated Driving.