MATLAB: How to control the which car is controlled in the Unreal Editor in MATLAB R2018a

simulinkVehicle Dynamics Blockset

I am trying to get started with using the unreal engine for 3d visualization and would like to clarify if it is possible to control more than 2 cars in the unreal engine simulation using the editor mode. In addition to this I would like more detail on how I can specify which car in the unreal engine is controlled by a specific control signal.

Best Answer

Follow these steps to add a new controllable vehicle.
1) Add a “sim 3d pass veh” actor in the editor mode.
2) Click on the added actor to highlight it in World Outliner section of the editor and search of “tag” as shown in screen shot 1 and 2.
3) Click on the + sign shown in screen shot 2.
4) Add a name tag for the vehicle as shown in screen shot 3. Generally we follow SimulinkVehicle followed by any numeric value.
5) In Simulink model set Actor tag for “Simulation 3d Actor Transform Set” block to the same name that is added in editor.
This should control the newly added vehicle in the editor mode. To change the camera view while simulation is running, keep the editor window in focus and hit “Tab” key. That will switch between camera views when there are multiple vehicles.
Related Question