UE4 blueprint for indoor environment randomization. Rooms and corridors shapes, walls and floor textures, furniture can be easily randomized at the beginning of the experiment or at run-time.
Download the blueprint DomainRandomizer.uasset
and move it into you Content
folder (in your UE4 project).
Everytime a new experiment starts (i.e., when Play is pressed), the RandomizeAll
function is called. If Debug Mode
and Enable Tick
are both set to True, RandomizeAll
is called every tick. Debug Mode
and Enable Tick
can be enabled or disabled inside the Blueprint.
The main component of the blueprint. It is called when Play is pressed or every tick, depending on the chosen mode. If Debug Mode
is True, a random seed is set. Otherwise, the seed is set according to the Seed
variable (initialized to 0, but may be changed via Python). This function autonomously call the following functions for the randomization.
This function's aim is to spawn the floor, the external walls and the ceiling, setting a random material. It contains the following variables:
Room Size
: environment size (in UE4 meters).Floor/Wall/Plane Mesh
: mesh for the floor, the external wall and the ceiling.Gather Train Set
: a different array of meshes can be used if this boolean value is set to True or to False.Train/Test Materials
: material arrays (train and test materials can be different if needed).
This function allows spawning internal walls and doors according to a grid, and avoids the creation of closed rooms. It contains several variables, but the following helps in building an appropriate room, depending on the task:
Wall Grid Size
: the room size increases by increasing this grid size.Door Placement Change
: probability value to spawn a wall.
This function adds the doors where walls have not been spawned (with a fixed probability).
Door Placement Chance
: doors spawning probability.Door Meshes
: meshes array for the doors.
The main function in charge of spawning external wall decorations.
For the N-th external wall, this function spawns decorations so that they do not overlap and they are far enough from the doors.
Chance To Spawn Wall Deco
: probability value to spawn a wall decoration.Wall Deco Height Ratio
: the height for the wall decorations.Object Grid Ratio
: ratio between the object grid size and the wall grid size.
The main function in charge of spawning internal wall decorations.
Four functions to spawn the decorations on the internal walls with a fixed probability and following the same constraints as before (the objects are spawned far enough each other and far enough from the doors).
The main function in charge of spawning objects close to the external walls.
For the N-th external wall, this function spawns objects so that they do not overlap and they are far enough from the doors.
Change To Spawn Wall Object
: probability value to spawn an object close to the N-th external wall.Wall Object Margin Factor
: if higher than 1, the objects will be a bit detached from the wall.Train/Test Wall Object Meshes
: meshes array for the objects close to the walls. These meshes may vary for train and test sets.
The main function in charge of spawning objects close to the internal walls.
Four functions to spawn the objects in the X internal wall.
This function is in charge of spawning objects in the middle of the free grid cells, with a random probability and a random yaw orientation (and far enough from the doors).
Change To Spawn Floor Object
: spawn probability for an object.Train\Test Floor Object Meshes
: the object meshes may vary for train and test sets.
This function is in charge of spawning objects hanging from the ceiling.
Change To Spawn Roof Object
: spawn probability for an object.Train\Test Roof Object Meshes
: the object meshes may vary for train and test sets.
This functions randomizes the intensity and the orientation of the light.
- Open the UE4 project and drag the blueprint from the
Content
folder into an UE4 empty environment. - Rename it
DomainRandomizer_PORT
(e.g.,DomainRandomizer_9734
). - From the menu, some parameters may be changed. To modify the other parameters, the meshes or the materials, access the blueprint (double click) >
Components
>DomainRandomizer (self)
. - Set the parameter
Directional Light
to have the reference to the environmentLight Source
. - Blueprint is ready: press Play to create a randomized environment!
If you find this work useful in your research, please cite:
@article{felicioni2024vision,
author={Felicioni, Simone and Rizzo, Biagio Maria and Tortorici, Claudio and Costante, Gabriele},
journal={IEEE Robotics and Automation Letters},
title={Vision-Based Topological Localization for MAVs},
year={2024},
volume={9},
number={2},
pages={1158-1165},
doi={10.1109/LRA.2023.3341758}}