Editor: Integrating External Hardware or Software
Description
This guide provides an overview of the steps and considerations in integrating external hardware or software. The specifics of any deployed external integration will vary depending on the objectives of the integration. Separate guides exist for each of the integration methods supported that cover the specifics of the individual method of external integration.
Warning
The functionality for external hardware or software depends on a valid Internet connection and, depending on the use, a valid hardware connection. As such, the functionality of this feature may depend on the environment in which Nominal Editor is being run. Cloud deployments, for example, may not run external hardware connection functions.
Considerations
The following dot points cover topics that need to be considered when developing simulations for external integration:
- The number of connections or devices to connect. For example, does the hardware running the simulation have the required number of USB Ports?
- Of the External Integration methods supported by Nominal Editor, what integration methods are supported by the external software or hardware?
- If no overlapping integration methods exist, an adaptor or bridge will need to be created.
- What is the speed of the desired communication?
- The different integration methods or if an interfacing entity is required will affect the rate of data flow.
- How will the flow of data to or from the external software or hardware affect the simulation?
- Will this require the simulation to be built with synchronous or asynchronous external integration in relation to the simulation tick?
- If a synchronous integration approach is desired, when should updating the UI or Data logging occur in the Tick Simulation → Communicate to External Entity → Receive from External Entity Loop? Should updating the UI or Data logging occur when transmitting or receiving for asynchronous external integration?
Once answers to the above questions have been determined, work can begin on implementing the determined approach, with the following being advice on how to do so:
- Have clearly named references and variables for external integration. Especially if managing multiple connections that use the same or different external integration methods.
- Unreal Editor is single-threaded. This has advantages for building synchronous external integration-based simulations as the simulation loop has a clear procession. For asynchronous integration, it is recommended that any data-receiving functionality be implemented to occur over multiple frames or simulation ticks. This doesn’t mean that it must occur over multiple frames, just that it supports it without locking up the simulation.
- Use
Event End Play
to clean up any integration connections. This, at a minimum, should include calling any disconnect functions but can be expanded to sending any final data packets or disconnect information for a clean disconnection. Using Event End Play means the code is executed whenever an Unreal Level is closed, except for crashes.