Preparation and Environment Setup

To prepare for the development, both CARLA and OpenXR need to be set up properly. For setting up CARLA, two major components, the source code of CARLA and a fork of Unreal Engine (UE) by the team of CARLA are required. Since CARLA uses a fork of UE 4.26 rather than the stock UE, the engine was cloned from the engine GitHub repository from CARLA and built using Visual Studio 2019, Windows 8.1 SDK, x64 Visual C++ Toolset, and .NET framework 4.6.2. The source project of CARLA was cloned from the simulator GitHub repository from CARLA. Due to the enormous size of the project, GitHub cannot host assets. They were downloaded separately using a batch script provided by the repository. Finally, the client PythonAPI and the server of CARLA were compiled using the x64 Native Tools Command Prompt.

For setting up OpenXR, the OpenXR plugin should be enabled inside the CARLA project first. The Oculus app was downloaded and installed to enable Oculus Link, which can use the standalone VR headset as a desktop VR headset. Then, the Oculus app was allowed to install from Unknown Sources and enrolled in the Public Test Channel, and the OpenXR runtime for Oculus was installed. Finally, the Oculus OpenXR runtime was added to the Environment Variables. In this way, if the project is required to use another headset in the future, it can be easily set up by just replacing the path in the Environment Variables.