Customize Scene with Unreal Engine failed in R2020b

Back in MATLAB R2020a, I was able to follow the guide at https://www.mathworks.com/help/driving/ug/customize-scenes-using-simulink-and-unreal-editor.html to get my vehicle simulation to work with a 3D scene created by modification from an existing AutoVrtlEnv project level. Now I cannot seem to do the same thing with the newly shipped MATLAB R2020b. There's something not right. Tried the guide on both my Windows PCs, didn't work, need some help.
After click RUN in my Simulink model, and click PLAY in the UE4 editor, I got static image in UE4 window, and black screen on the 3D Camera Read block popped up window. The diagnostic viewer throws repretead warning message below:
> In sim3d/CameraReader/read
In sim3d/AbstractCameraSensor/read
In Simulation3DVisionSensor/stepImpl
Warning: The block 'DriftDemoBicycle/3D Visualization/Simulation 3D Camera Get/Simulation 3D Camera Read' returned no data (error code: -1). Make sure that the block sample time is greater than the Simulation 3D Scene Configuration block sample time.

1 Comment

Just to add to the above failure, if I first package the customized scene then use the Simulation 3D Scene Configuration block to specify the packaged executable, Simulink doesn't seem to recognize the newly packaged scene but provides a warning:
This means that the packaged scene (named "CircleTrack") wasn't recognized. And another thing observed in UE4 is that, all the pre-built scens have a Data Asset object alongside the Level map, but my customized scene doesn't have it, and I don't know if or how to create that Data Asset object for my customized scene:
I think missing the Data Asset object might be connected to both the failures (either in Unreal Editor mode, or in packaged executable form). If I right click on any of the Data Assets under Content/Maps folder, it points to the C++ file PrimaryAssetLabel.h, which is non-existing in the AutoVrtlEnv project.
So if someone knows how to create this Data Asset, it might solve my problem. Thanks for any hint.

Sign in to comment.

Answers (1)

Hi Tong Zhao,
Apologies for the late response here but I wanted to provide some suggestions in case anyone else is running into these issues.
For the first error:
> In sim3d/CameraReader/read
In sim3d/AbstractCameraSensor/read
In Simulation3DVisionSensor/stepImpl
Warning: The block 'DriftDemoBicycle/3D Visualization/Simulation 3D Camera Get/Simulation 3D Camera Read' returned no data (error code: -1). Make sure that the block sample time is greater than the Simulation 3D Scene Configuration block sample time.
Place all the Sim3D blocks into the same subsystem and pay close attention to the block execution order: https://www.mathworks.com/help/driving/ug/how-3d-simulation-for-automated-driving-works.html#mw_a02d2ce7-796c-491f-aeda-5f8082811e29
For the second issue, make sure to include the map when packaging the project. In the List of maps to include in a packaged build option, click the Adds Element button. See detailed instructions here: https://www.mathworks.com/help/sl3d/package-custom-scenes-into-executable.html
Nishan

Products

Release

R2020b

Asked:

on 26 Sep 2020

Answered:

on 7 Apr 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!