Turning CARLA Unreal into a Controllable Gas-Dispersion Test Platform 2.12.2026 Özaydin, Ali Industry and technology Lapland UAS Blog Publisher Lapland University of Applied Sciences Ltd, Jokiväylä 11, 96300 Rovaniemi, Finland ISSN: 2954-145X Publications are licensed under CC BY 4.0 Contacts: viestinta@lapinamk.fi URN: urn:nbn:fi:lapinamk-2954-145X-161 Author Ali Özaydin Specialist | Bachelor of Engineering, Information Technology +358 40 193 5518 ali.ozaydin@lapinamk.fi keywords Simulations Technology Ali Özaydin, MSc, works as a Specialist in Digital Solutions Expertise group at Lapland University of Applied Sciences. The MEQAL (Methane Quantification and Localization) project is a co-funded European Union (EU) project involving Mid Sweden University, the University of Oulu, and Lapland University of Applied Sciences (Lapland UAS). The project aims to support the mitigation of greenhouse-gas emissions by detecting, localizing, and quantifying methane emissions from different sources. Lapland UAS has particular responsibility for developing the test field in Rovaniemi, where an autonomous rover carrying a methane sensor will perform leak-detection tasks. This work also includes developing digital models of the robot, test field, and sensor so that tests can be carried out in a simulation environment before implementation in the physical test field. CARLA was selected as a suitable platform for this work. A brief introduction to CARLA and Unreal Engine CARLA is an open-source simulator for autonomous-driving research. It provides digital assets such as vehicles, sensors, and urban environments in a modifiable world, allowing developers to test and evaluate systems under repeatable simulated conditions (Dosovitskiy, Ros, Codevilla, Lòpez & Koltun 2017, 1.) CARLA is built on Unreal Engine, Epic Games’ real-time 3D creation platform. Unreal Engine is used for game development, visualization, content creation, live production, training, and simulation (Coursera Staff, 2025.) Unreal Engine offers interactive 3D and realistic graphics, dynamic lighting, advanced physics simulations such as fluid, hair, destruction, cloth, body, vehicle and visual debuggers (Epic Games, 2026-a). Epic provides access to the engine’s C++ source code to authorized developers under its licensing terms. (Epic Games, 2026-b). This source-code access makes it possible to customize and build the engine and project from the source. CARLA is distributed in packaged builds as well as source-code form. A packaged build is convenient for using the simulator as provided, while building from source is useful when a project requires changes to CARLA’s Unreal project, C++ code, or asset integration. For this project, building CARLA from source made it possible to integrate the custom map, vehicles, gas system, and methane sensor. Both CARLA and Unreal Engine provide documentation and community resources for developers. Asset migration and registration in CARLA Because the project required custom assets and actor registration, CARLA was built from source. After the build was completed, the gas simulation, custom map, custom vehicles, and custom sensor each required their own integration steps. This article focuses on the gas simulation, so the other assets needed to run the test environment are described more briefly. The test-field map, its assets, and the rover assets were migrated from an existing Unreal Engine project into the CARLA project’s Content folder. The source and target projects used the same Unreal Engine version. Picture 1. Earlier-developed test-field and rover assets prepared for migration. The rover’s digital model and track animation had previously been developed in the Lapland Robotics project. To register the rover in CARLA’s vehicle blueprint library, the CARLA custom-vehicle tutorial was used as a starting point (CARLA-a). The physical rover uses a differential tracked-drive system, but CARLA’s vehicle setup expects wheels and supports an Ackermann-style vehicle model. The rover model was therefore adapted in Blender by rigging its existing wheel elements so that it could be registered and controlled through CARLA. This is a registration and control workaround rather than a simulation of the rover’s actual tracked-drive dynamics. Picture 2. Wheel assignment in Blender for CARLA vehicle registration. The migrated track animations were then connected to animation blueprints associated with the registered vehicle. Track rotation direction and speed were estimated using the actor’s yaw rotation and its linear velocity, calculated from the actor’s forward vector. These values were combined to control the animation play rate. The tracks therefore provide a visual animation of rover movement; they do not use a physically simulated track-drive model. Picture 3. Track-speed calculation used to control the animation play rate. The same CARLA vehicle-registration tutorial was used for the drone. Wheels from the rover’s digital model were also connected to the drone’s leg frame in Blender because CARLA’s vehicle setup expects wheel components for this type of vehicle registration. The existing vehicle configurations were inspected, and the corresponding settings were added to the BP_VehicleFactory. Both the rover and the drone were registered through this vehicle-factory blueprint. CARLA expects map levels to be stored under Content/Carla/Maps. To support semantic tagging, relevant assets also need to be placed in the corresponding Content/Carla/Static subfolders. For example, a building intended to be recognized by a semantic camera should be stored under Content/Carla/Static/Building/CustomBuilding. Assets were relocated accordingly. Some materials, textures, and Blueprint classes also required manual repair after migration. Nanite compatibility and collision settings needed to be checked as part of the process. An existing CARLA level was inspected to identify the CARLA-specific actors required by the migrated level. The following actors were added manually. Their settings may vary depending on the project: VehicleSpawnPoint BlueprintParentClassFixer BP_GeneralSceneSettings BP_Carla_Sky OpenDriveActor Player Start BP_VehicleFactory The CARLA level also requires an OpenDRIVE (.xodr) file in Content/Carla/Maps/OpenDrive/. The file must have the same name as the level. The test field map does not contain substantial road-related information, duplicating an existing .xodr file and renaming it to match the level was used as a project-specific workaround. After registering the map and vehicles, CARLA’s manual_control.py example client was used to control the rover in the CARLA world. Controlling the drone with the same wheeled-vehicle interface was less suitable, so the manual-control script was modified to move the drone in the simulated world. The drone’s physics were disabled and its movement was implemented using a teleportation-based approach. In this use case, the drone primarily serves as a mobile platform for the methane sensor; a physically accurate flight model is not required. The drone’s propeller rotation is animated, while the propeller-induced particle effects are handled by Niagara, as described below. How the gas simulation was developed for the MEQAL project Niagara is Unreal Engine’s visual-effects (VFX) system for creating and controlling real-time particle effects. It uses systems, emitters, modules, and parameters to define particle generation, behavior, and rendering (Epic Games, 2026-c.) In this project, Niagara is used to visualize gas-proxy particles and control their movement through adjustable settings exposed to the user at runtime. To integrate Niagara into the CARLA project, the relevant plugins were enabled in Carla.uplugin and CarlaUnreal.uproject, and the required private and public module dependencies were added to Carla.Build.cs. A Niagara Data Channel asset was created in the project’s FX folder and configured for use by the gas system. Its asset path was added to the relevant DefaultEngine.ini and DefaultGame.ini configuration files. A Gas_Systems folder was created under Content/Static to hold the gas-related assets. The main assets in the gas system are: BP_GasSource_NS: a Blueprint actor that contains the Niagara particle-system component NS_GasFieldGrid. Its parent class is the C++ Gas Source Grid actor. NSGasFieldGrid: a Niagara system containing the particle emitter and the DC_GasSample data channel, together with user-exposed particle parameters. UI_NiagaraSystem: a Widget Blueprint that provides the runtime controls in the game level. Gas_mat: the material and related settings used to render the gas-proxy particles. test: a texture used by the gas material. Picture 4. Connections between the main gas-system assets. The NSGasFieldGrid Niagara system contains an emitter that renders particles as sprites using the configured gas material. Material settings can be adjusted according to the project’s needs. For example, the material may need to be changed so that the particles are visible in a semantic camera. The Niagara system controls particle settings such as spawn rate, speed, color, size, lifetime, turbulence, wind, and propeller-induced effects. These settings are exposed as user variables. The same parameter values are also made available through the data channel so that the gas subsystem can use them when preparing sensor samples. In other words, a slider changes the Niagara particle behavior and updates the corresponding values used by the sensor-side calculation. Picture 5. Niagara gas emitter and its user-exposed variables. The BP_GasSource_NS actor is spawned dynamically in the Unreal Engine level and uses Niagara to visualize the particle field. Its parent class is implemented in C++ in the CARLA plugin’s Actor folder. The Gas Subsystem connects the level, the user interface, and Niagara. Niagara controls the particle effect; the subsystem applies runtime settings, updates propeller positions, and reads particle data for sensor queries. Its main responsibilities are as follows: 1. Load the Niagara assets. When the subsystem starts, it loads the Niagara system and data-channel asset configured for the project. 2. Start an effect for each gas source. When a gas source registers, the subsystem reuses a Niagara component already attached to it or spawns a component at the source location. It keeps track of each source and its Niagara component. 3. Update propeller positions. Each tick, the subsystem looks for the drone and its propellers. If they are available, it reads their positions and sends the propeller names and positions to Niagara. Niagara can then use those positions when applying propeller point forces. If the propellers are unavailable, the subsystem sets the propeller strength to zero. 4. Apply UI slider changes. The subsystem exposes setter functions to Blueprint. When the widget calls a setter, the subsystem updates the corresponding user-exposed variable on each tracked Niagara component. For example, the sliders can change spawn rate, wind, particle lifetime, propeller force, and turbulence at runtime. 5. Read gas samples. When a sensor requests a sample at a world location, the subsystem reads particle information from the Niagara data channel and uses it to calculate a local, heuristic concentration indicator. The resulting sample is passed to the methane sensor. 6. Clean up removed sources. When a source is removed, the subsystem removes its Niagara component. It destroys the component if the subsystem created it or deactivates it if it belongs to the source actor. Implementation of the methane sensor The methane grid sensor acts as a virtual probe in the Niagara particle field. At each sensor update, it asks the Gas Subsystem for particle data around the sensor’s current location. The resulting sample is then packaged and sent through CARLA’s sensor pipeline so that it can be accessed through the PythonAPI. 1. The sensor updates after physics. In PostPhysTick, it checks that its data stream is ready and obtains the Gas Subsystem associated with its world. The sensor’s world position is used as the sampling location. 2. The subsystem reads data from Niagara. It queries the Niagara data channel at the sampling location and reads values such as the spawn rate, particle lifetime, sampling radius, adjustable air-density parameter, particle age, and particle positions. 3. The subsystem calculates a local indicator. It checks the distance between the sensor and each particle position returned by the Niagara Data Channel reader. Only particles within or on the boundary of the sampling radius are included in the calculation. The sampling radius (r) is specified in centimeters and converted to meters to calculate the corresponding spherical volume using (V = (4/3) × π × r³). For each particle within this radius, the subsystem calculates an individual contribution (ParticleMass) using the SpawnRate and ParticleLifetime parameters and that particle’s individual ParticleAge: ParticleMass = SpawnRate × ParticleLifetime / ParticleAge The contributions from all included particles are accumulated into TotalWeightedMass. The accumulated value is then divided by the spherical sampling volume to produce the value reported as Density. Finally, this density is divided by the adjustable AirDensity value and multiplied by 1,000,000 to obtain the value reported as PPM. These values are implementation-specific estimates. They are not derived from a calibrated methane mass model and should not be interpreted as physically accurate methane concentration measurements. 4. The sensor packages and sends the sample. The sample values are copied into a versioned MethanePacket and sent through CARLA’s sensor stream. 5. CARLA exposes the data to the client. On the receiving side, the serializer creates a MethaneSensorData object. Its accessors expose values such as PPM, density, particle count, sampling radius, and air density. The PythonAPI registers accessors such as get_ppm() and get_density(). The sensor follows CARLA’s standard sensor architecture: a sensor actor obtains the data, a packet carries the measurement through the sensor stream, and the serializer and sensor-data class expose the result to the client. This keeps the custom methane sensor integrated with the same general data-streaming approach used by CARLA sensors (CARLA-b.) In the Python client, the example HUD checks whether world.last_ppm contains a reading. When a reading is available, it displays the methane indicator together with supporting values, including the adjustable air-density value, the number of data-channel entries returned by the reader, particle lifetime, the minimum and maximum distances among valid returned particle positions, sampling radius, spawn rate, density, and sampling volume. If no reading is available, the HUD displays “Methane: Data not found.” The example changes the text color to green when the displayed value is at or below 1,000 and to red when it is above 1,000. This is a simple visualization rule in the example client. Picture 6. The methane sensor attached to the rover and the drone sensor data displayed in the CARLA pygame window. What features does the gas simulation provide? The current design supports one or more gas-source actors in the level. Sources can be spawned at designated spawn points during runtime. Particle emission can be enabled or disabled using a button in the user interface; by default, emission is disabled. The UI widgets appear when the level starts. They include sliders, an emission toggle button, and informative text showing the current parameter values. An on-screen message also reports the number of available gas sources. Each gas source operates within a predefined active region to limit resource consumption. Nearby sources can have overlapping active regions, while separated sources retain their own individual regions. The sliders apply the corresponding settings to all active gas sources. Slider changes are applied dynamically. Niagara uses the updated values to control particle visualization and movement, while the data channel makes the corresponding parameters and particle information available to the subsystem and the PythonAPI. A vehicle with the methane grid sensor attached can move through the particle field and request samples as it approaches the sources. The estimate changes as the particle positions and adjustable parameters change. Particles contribute to the estimate only when their distance from the sensor is within the configured sampling radius. The particle field can be influenced by adjustable wind-vector forces, particle-emission settings, turbulence, and propeller-induced point forces applied from each propeller’s rotation-center position. Curl noise is used as the default turbulence mode. These controls provide repeatable ways to change the particle field while testing sensor integration and detection algorithms. The environment is capable of running in real time with multiple vehicles in the CARLA world. This allows more than one vehicle, each equipped with a sensor, to operate in the same simulated environment and receive data while moving through the particle field. Picture 7. User-interface widgets and four gas-source actors in the level. The main sliders and their functions are described below: Spawn rate: controls the rate at which Niagara emits particles. Color scale: controls particle color transparency/opacity; particles can also be made invisible. Sprite size min: sets the minimum particle sprite size. Sprite size max: sets the maximum particle sprite size. Particle lifetime: sets how long each particle remains active, in seconds. Particle speed scale: scales the speed of particle movement. Sampling radius: sets the sensor’s sampling distance, in centimeters. Air density: an adjustable simulation parameter used in the calculation that produces the PPM-like indicator; it is not a live measurement of atmospheric air density. Wind vector X: controls the force component applied along the X axis. Wind vector Y: controls the force component applied along the Y axis. Wind vector Z: controls the force component applied along the Z axis. Turbulence speed: controls the strength of turbulence relative to the wind setting. Turbulence frequency: controls the frequency of noise in the particle movement pattern. Turbulence flow: controls how often the flowing noise pattern is reseeded. Propeller falloff: sets the distance over which a propeller’s point-force effect influences particles, in centimeters. Propeller strength: controls the magnitude of the force applied by each propeller. Propellers wind X: controls the X-axis component of the propeller-induced force. Propellers wind Y: controls the Y-axis component of the propeller-induced force. Propellers wind Z: controls the Z-axis component of the propeller-induced force. The following video demonstrates the implemented platform, showcasing its particle simulation, configurable environmental parameters, and integration with CARLA. Oops! This YouTube embed is not visible because you have not accepted marketing cookies.Accept marketing cookies. Viedo embed 1. If the embedded video above is not visible due to your cookie settings, watch the video on YouTube: https://youtu.be/cqM2GW4kb1w?si=4w9JsSBOmWnHm3ix Limitations and intended use The MEQAL gas simulation is an ongoing development project. The features and capabilities described here represent the current implementation and may change as development progresses. The system is not considered a finalized product, and its functionality and design remain subject to further modification. The current implementation provides a controllable, real-time particle-field environment for testing methane-detection algorithms, sensor integration, and CARLA’s data pipeline. Niagara particles act as visual and computational proxies whose movement can be adjusted through emission settings, wind, turbulence, and propeller-induced airflow. Multiple gas sources and vehicles can operate simultaneously, enabling repeatable testing scenarios. The simulation does not reproduce actual methane emission or dispersion behaviors and has not been validated against physical measurements. The displayed Density and PPM values are heuristic estimates calculated from nearby particle data and an adjustable air-density parameter. Therefore, despite the displayed units, they should be treated as simulation-specific indicators rather than physically accurate methane measurements. The current environment can be used to evaluate detection algorithms, sensor positioning, vehicle-based gas detection, and real-time data streaming. Possible further development includes more realistic methane dispersion and leak models, calibrated concentration estimation, and sensor characteristics such as measurement noise and response time. The system is intended for software development and controlled testing, not for predicting real leak behavior or making operational safety decisions. Potential applications Organizations developing methane leak detection technologies could use the platform to demonstrate to their clients the challenges of detecting methane under varying wind and environmental conditions at gas fields. By replacing the map assets, different types of terrain and environments can be represented, helping illustrate how field conditions can influence gas movement and detection. Furthermore, the platform is not limited to methane-related applications. Its particle-based simulation approach could be adapted to support other research involving the movement and detection of airborne particles. This flexibility makes it a potential virtual testing environment for a wider range of environmental monitoring, sensor development, and autonomous inspection applications. It can also serve as a practical reference for developers who want to extend CARLA and its Unreal Engine foundation for their own research or application needs. Reference List CARLA-a. CARLA: Content authoring – vehicles. Accessed on 12 November 2026 https://carla-ue5.readthedocs.io/en/latest/content_authoring_vehicles/. CARLA-b. CARLA: How to add a new sensor. Accessed on 12 November 2026 https://carla-ue5.readthedocs.io/en/latest/dev_create_sensor/. Coursera Staff 2025. What Is Unreal Engine? Accessed on 12 November 2026 https://www.coursera.org/articles/what-is-unreal-engine. Dosovitskiy, A., Ros, G., Codevilla, F., Lòpez, A., & Koltun, V. 2017. CARLA: An Open Urban Driving Simulator. Accessed on 12 November 2026 https://proceedings.mlr.press/v78/dosovitskiy17a/dosovitskiy17a.pdf. Epic Games, Inc 2026-a. Physics: Physics in Unreal Engine. Accessed on 12 November 2026 https://dev.epicgames.com/documentation/unreal-engine/physics-in-unreal-engine. Epic Games, Inc 2026-b. Frequently asked questions (FAQs). Accessed on 12 November 2026 https://www.unrealengine.com/faq. Epic Games, Inc 2026-c. Niagara Overview. Accessed on 12 November 2026 https://dev.epicgames.com/documentation/unreal-engine/overview-of-niagara-effects-for-unreal-engine. Read More All blog articles 19.5.2026 Lapland UAS Blog Mikkola Veronica New digital solutions to support forest counselling and risk management Forestry Engineer Veronica (Ruut) Mikkola works as an expert in the Future Bioeconomy research group at Lapland University… Industry and technology 12.8.2025 Lapland UAS Blog Sohan, Janaka Building a ROS2 based Autonomous Robot platform M.W. Sohan Janaka, B.Tech (Hons) in Engineering, works as a Specialist in Digital Solutions at Lapland University of… Industry and technology
19.5.2026 Lapland UAS Blog Mikkola Veronica New digital solutions to support forest counselling and risk management Forestry Engineer Veronica (Ruut) Mikkola works as an expert in the Future Bioeconomy research group at Lapland University… Industry and technology
12.8.2025 Lapland UAS Blog Sohan, Janaka Building a ROS2 based Autonomous Robot platform M.W. Sohan Janaka, B.Tech (Hons) in Engineering, works as a Specialist in Digital Solutions at Lapland University of… Industry and technology