Simulation 3d Scene Configuration not adding camera to simulinkVehicle when co-simulating with Unreal Engine

Hi,
I have a project in MATLAB/Simulink for Adaptive Cruise Control which I am trying to co-simulate with Unreal Engine for an Output. The co-simulation itself runs fine, but the Camera that is supposed to be attached onto my ego Vehicle from the 'Scene View' Parameter from the 'Simulation 3D Scene Configuration block' does not work. Here is a quick video where the problem can be oberserved.
The expected output is wherein the camera follows the car along the Road like this:
My simluation output:
I have referrred to the following Mathworks post for my implementation: Link
I am using Unreal Engine 4.27.2 with all the plugins properly Configured.

 Accepted Answer

Hi Ninad,
Under Edit > Project Settings > Project > Maps and Modes (this path might look different in Unreal Engine 4)
Change the "Default GameMode" setting to Sim3dViewerGameMode and the camera should follow the car along the road.
Let me know if that works for you!
Nishan

4 Comments

Hi Nishan,
Thank you so much for the reply. The path is exactly the same in UE4 as you mentioned and it has solved the issue. Thanks for the help!
Ninad
Hello,
I have another problem.I am conducting co-simulation for UAV using MATLAB/Simulink 2023b and Unreal Engine 4.27. I have set up my project according to your instructions. However, when I select the vehicle name perspective, the view displayed in Unreal Engine is underneath the UAV, and I cannot switch the camera position using the numeric keypad.
Hello, this seems unusual if you have completed the steps that I described above. Pressing 'Tab' allows you to switch between camera views, when you press "Tab" do you get the view where the UAV is in your screen and the numeric keypad works?
Nishan
not works, here is my scene of UAV, it's under the UAV. If I need to add some cameras while making fbx model or making the custom ue scene?

Sign in to comment.

More Answers (0)

Products

Release

R2023b

Asked:

on 28 Jan 2024

Commented:

on 19 Nov 2024

Community Treasure Hunt

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

Start Hunting!