Editing an Aircraft Actor in Simulink-Unreal Simulation

71 ビュー (過去 30 日間)
Oscar Su
Oscar Su 2025 年 2 月 11 日 3:14
コメント済み: Oscar Su 2025 年 2 月 12 日 0:54
Hello,
As part of my project, I am simulating an aircraft using Simulink, and I have set up a Simulink system to communicate with Unreal Engine (as shown in the attached image). The issue I’m facing is that when I open the Unreal project AutoVrtlEnv, which is ported from MATLAB to Unreal, I can edit the airport scene but not the aircraft itself. The aircraft is an actor class that is dynamically spawned in Unreal via the Simulation 3D Aircraft Block.
The problem is that this aircraft actor (as shown in the attached image) does not exist when the simulation is not running—it only appears once the simulation starts. While I can technically edit these dynamically spawned actors by pausing the simulation, any changes I make are lost when the simulation restarts, as the actors are recreated from scratch.
I need to modify the Sim3dMainCamera under the Sim3dMWAirliner actor class. Is there a way to modify or duplicate it so that I can edit it as a separate class without losing my changes?
Any guidance would be greatly appreciated!
  2 件のコメント
Nishan Nekoo
Nishan Nekoo 2025 年 2 月 11 日 12:15
Hi Oscar, could you tell me a bit more about what changes you want to make to the Sim3dMainCamera so that I can best provide advice here? I wonder if the changes you want to make can be made in Simulink itself so that you can avoid creating custom actors in Unreal.
In the meantime, I recommend taking a look at the Simulation 3D Airliner Pack block which makes it easier to create inputs for the Simulation 3D Airliner block without needing to create your own matrix concatenate. It'll make it easier if you ever wanted to use multiple inputs to the different aircraft components.
Oscar Su
Oscar Su 2025 年 2 月 12 日 0:54
Hi Nishan,
I'm working on implementing two modifications to the Sim3dMainCamera:
  1. Adjusting the position of the internal camera view when running the simulation in VR.
  2. Retrieving the VR headset's orientation in Euler angles and feeding it back into Simulink.
The reason for adjusting the internal camera view is that, when I run the simulation in Unreal's VR preview, the internal camera (as documented in the "Run Simulation" section of this) is positioned above and slightly in front of the aircraft (as shown in the attached GIF). However, in non-VR mode, it functions perfectly, remaining fixed to the aircraft's cockpit.
This issue occurs across all MathWorks-provided aerospace examples when running them in Unreal's VR preview. I have tested the following examples and observed the same behavior:

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAerospace Scenarios についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by