2019 12 Carideo
2019 12 Carideo
I
Abstract
III
Contents
Sommario I
Abstract III
1 Introduction 1
3 Problem formulation 21
3.1 Research motivation . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3 Method properties . . . . . . . . . . . . . . . . . . . . . . . . 23
3.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4 Proposed solution 25
4.1 Proposed methodology . . . . . . . . . . . . . . . . . . . . . . 25
4.2 Generation method . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2.1 MIQP problem . . . . . . . . . . . . . . . . . . . . . . 29
4.2.2 Original method . . . . . . . . . . . . . . . . . . . . . 29
4.2.3 Proposed method . . . . . . . . . . . . . . . . . . . . . 31
4.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
V
5 System architecture 33
5.1 System pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2 XML model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.3 XML parser . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.3.1 Room rectangularization . . . . . . . . . . . . . . . . . 36
5.3.2 Room variance . . . . . . . . . . . . . . . . . . . . . . 38
5.4 Intermediate model . . . . . . . . . . . . . . . . . . . . . . . . 39
5.5 Layout generator . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.5.1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.5.2 Implementation . . . . . . . . . . . . . . . . . . . . . . 48
5.5.3 Cycle decomposition . . . . . . . . . . . . . . . . . . . 50
5.6 Drawer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.7 XML Writer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6 Experimental results 55
6.1 Generated layouts . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.1 Area control . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.2 Generation issues . . . . . . . . . . . . . . . . . . . . . 57
6.2 Generation examples . . . . . . . . . . . . . . . . . . . . . . . 60
6.3 Simulated robot setup . . . . . . . . . . . . . . . . . . . . . . 63
6.3.1 ROS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.3.2 Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.3.3 Exploration package . . . . . . . . . . . . . . . . . . . 66
6.3.4 Navigation stack . . . . . . . . . . . . . . . . . . . . . 67
6.3.5 SLAM package . . . . . . . . . . . . . . . . . . . . . . 67
6.3.6 Map preparation . . . . . . . . . . . . . . . . . . . . . 68
6.4 Planning experiments . . . . . . . . . . . . . . . . . . . . . . 68
6.4.1 Office 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.4.2 School 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.4.3 Planning results considerations . . . . . . . . . . . . . 73
6.5 Exploration experiments . . . . . . . . . . . . . . . . . . . . . 73
6.5.1 Exploration data overview . . . . . . . . . . . . . . . . 74
6.5.2 Exploration data analysis . . . . . . . . . . . . . . . . 74
6.5.3 Exploration results considerations . . . . . . . . . . . . 80
6.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Bibliography 87
VI
Chapter 1
Introduction
1
that the generated layouts have the same topology graph of the original en-
vironments, which means that we use as an input to our method a graph
representing the connection between rooms. The generation method we uti-
lize is inspired and adapted from the one proposed in [6], which formulates
the layout generation as a MIQP problem optimization. In particular, we
consider as input for each generation a single original layout, represented in
a graph format. We then define the adjacencies between rooms, described
in the topology graph, as hard constraints of the problem, and minimize the
deviation of the sizes of the rooms from their original values in the input
layout. We found that our generation method can generate successfully also
large layouts, while its main limitation is that the rooms are restricted to a
rectangular shape.
To evaluate the realistic building layouts we generate, we compare the
performance obtained by two experiments with simulated robots performed
in them. The first is based on the path planning between pairs of rooms,
with an analysis of the lengths of the paths planned between them. As sec-
ond experiment, we perform repeated exploration runs on various generated
layouts and on their original counterpart. We utilize as performance metrics
the time and the length of the path traveled by the robot to complete the ex-
ploration of each environment. Both experiments confirm that it is possible
to obtain, on average, very similar performance across original layouts and
generated ones. This confirms our hypothesis that procedurally generated
buildings are realistic and are similar with their real counterpart. However,
we found some issues with exploration performance when the original lay-
out contains a large number of non-rectangular rooms. The reason is that
these rooms are individually more difficult to explore and we can’t recreate
them in generated layouts since our method considers all rooms as rectangles.
2
beginning on the various phases of the technique and then on the specific
generation method we employ, presenting it also in its original formulation
as proposed in [6].
In Chapter 5 we describe the implementation of our system in detail,
focusing on each component and data structure utilized in the entire process.
In Chapter 6 we provide some considerations on our system, focusing on
the main issues found and presenting some examples of generated layouts.
We then introduce the setup utilized in the experiments, which are presented
afterwards along with their results and final considerations.
In Chapter 7 we present a summary of our work, the conclusions, and
some possible future developments.
3
4
Chapter 2
5
(a) Original floor plan (b) Metric layout map
cupancy grid map. As discussed in [7], these kind of maps are fine-grained
grids defined over the continuous space of locations. Each cell is associated
with an occupancy value, which describes the probability of that location to
be an obstacle. They are the common map representation used by robots
to navigate the environment. Usually the occupancy grid maps are 2D, but
the same concept can also be expanded to 3D worlds. However, one of their
main problems is the number of cells, since an high resolution of the grid,
while improving precision, also leads to significant computational expenses.
The map can be provided beforehand the run, or created directly while
traveling. In the first case the robot only needs a localization system in
addition to the navigation one, while in the second case a much more com-
plicated system is required since this problem is Simultaneous Localization
and Mapping. As discussed by Durrant-Whyte and Bailey in [8], this task is
based on a continuous learning of the map (both creating and updating it)
paired with a constant localization in it. The problem of navigating around
an unknown environment in order to collect enough information to create
a complete map is called exploration, and it is another task that is widely
studied in this field. Some examples of works that study this problem are
[9], [10], and [11].
6
2.2 Experiments in robotics
Both SLAM and exploration are some of the most complex and important
problems in autonomous mobile robotics. Their study and development de-
mand thorough testing. However, running a real robot in a real environment
requires both space and time to setup the experiments. A common solution
is the use of simulations, in which the algorithms can be tested on modeled
robots in a virtual environment, with a complete control of the entire setting
of the experiment.
A much more limited alternative to real and simulated runs (online exper-
iments) is the use of offline experiments, that are based on the prerecorded
data acquired by a robot in a specific environment. This approach excludes
any kind of interaction between the robot and the world, including also the
navigation itself, so it can’t be used to test for example exploration algo-
rithms, but only tasks that just require sensors readings like SLAM.
As discussed by Amigoni et al. in [1], offline experiments are used by
83.6% of the reviewed papers for SLAM evaluation. This can be explained
by the fact that offline experiments require the acquisition of the data only
once, reducing the overhead for the researchers, but limiting the choice of
the entire setting and platforms (map, sensors, robot, exploration and nav-
igation method, ...) that are made by the authors of the specific dataset
employed. Some examples of such datasets are Radish [12] and RAWSEED
[13, 14], which are both made by university researchers and are based on
campus buildings (mainly indoor environments). Considering the online ex-
periments, most of the publications employed simulations instead of real
robot runs. However, it is important to note that only 21.5% of the simu-
lated experiments used a real building as map, while in the other cases the
layout was based on non-realistic maps, usually grid-based and handcrafted
to test specific isolated features, like closed loops or labyrinths.
In fact, even if simulations have the advantage of allowing experimenta-
tion with almost any kind of environment, they can only be truthfully useful
and hopefully generalizable if a realistic layout is used, as otherwise the fea-
tures present in a certain custom map may be totally different from those of
a real building.
There are some datasets that provide a very detailed 3D representa-
tion of a small amount of buildings, like AI2-THOR [15] and 2D-3D-S [16].
These systems are more indicated for applications that require high fidelity
in both visualization and interaction between the world and the objects of
the simulated world. However, the maps that they provide are very limited
in number.
7
When testing SLAM or exploration algorithms the focus is typically on
the map itself. In these cases, there are more suited frameworks like Stage
[17], a lightweight 2D simulator. A bitmap image provided by the user is
used to create the environment as input map, while both sensors and actua-
tors are already implemented with various models. The user can also create
plugins to expand and customize the capabilities of the engine and of the
models provided. A more advanced simulator is Gazebo [18], which includes
both high-quality graphics and a complex physic simulation based on Open
Dynamics Engine1 . There is also an improved sensors and actuators model-
ing, that allows accurate and extensive interactions between the robot and
the environment. Both these systems can also handle multi-robot settings
and are usually utilized in conjunction with ROS.
ROS (Robotic Operating System) [19] is a framework employed in robotics.
It can be used seamlessly with simulated robots or with real ones, since it
provides both hardware and software abstractions, organizing the single ele-
ments of the system in nodes, which operate individually and communicate
between them with a message-passing protocol managed directly by ROS.
There is a package manager with a large amount of already implemented
algorithms and real hardware controllers. The distributed nature of ROS
also allows the execution of a complete system on different devices. An ex-
ample is a real robot with limited computational capabilities that relies on
an external computer to perform SLAM and exploration tasks.
Stage and Gazebo can be used to test a large variety of maps and algo-
rithms. To do so, a map layout is needed to be recreated in the simulated
world. This can be done both by handcrafting a bitmap file or by using
a dataset with specific buildings already encoded in a certain format (not
necessarily in image files ready to be utilized directly in a simulator). These
collections of floor plans are usually composed of layouts of the university
campuses where the researchers who created the dataset work. Some exam-
ples are the MIT [20], the KTH [21] and the HouseExpo [22] datasets. In
particular, the MIT and KTH datasets are based on the buildings of their
respective university campuses and are encoded in XML files with the tech-
nique proposed in [23]. This format is based on the concept of graph with a
floor as root of the XML, which contains the various spaces (rooms, the nodes
of the graph) with a label to represent their type (e.g., corridor or classroom)
and their geometrical structure, and the portals that consist of connections
between two spaces (like doors, the arcs of the graph). Their main limitation
is that even if they contain a relative large amount of floor plans, they are
1
http://www.ode.org
8
very homogeneous as they include very similar layouts multiple times, and in
particular they are all campus buildings, so not representative of the various
classes of maps.
According to Amigoni et al. in [24], it is possible to use simulations in the
evaluation of SLAM algorithms and obtain results comparable to real robot
runs. In particular they propose a system to automate experimental runs in a
simulated environment, overcoming in this way also the issue of variability of
results (that is present even with real robots). This result is very important
as some of the metrics used to evaluate SLAM algorithms require additional
data to supplement those provided by the onboard sensors. In fact, the
metric [25] that they use needs the ground truth information of the robot
pose, which is the real position of the robot in the environment. The robot
computes its estimated pose with odometry, which is the integration of the
distance covered by wheels over time. However, the sensor readings from the
wheels are not very precise, so the cumulative error can increase a lot over
time. As discussed in [7], it is possible to improve the localization provided by
the odometry in a probabilistic way, using data received from other sources,
like laser sensors. Still, this corrected pose is still an estimation, so it can’t
be used as ground truth. In simulated settings it is easy to get the ground
truth data of the robot position, while in a real setting with a physical robot
it requires the use of complex and costly equipment, like the OptiTrack2
system employed in [24] and the hardware utilized in [26].
However, an intrinsic limitation of their automated evaluation approach
is that the simulated maps, as already reported in [1], need to be realistic
in order to be actually significant in relation to real world environments.
In particular, it is underlined the importance of the topological structure
of the map, which is the adjacency relation between the various rooms of
the layout. Another limitation is the quantity of realistic maps available,
since we need a large amount of them to obtain consistent results. However,
this is not always possible to do as it is difficult to retrieve a large dataset
composed of maps that are both realistic and heterogeneous.
To solve this problem, we decided to increase the number of available
realistic maps by generating them in a procedural way.
9
by approach, focusing in particular on how they would behave when applied
to generate layouts with specified features. The layout is a representation
of the floor plan of a building. While the map is focused more on the struc-
ture of the walls and of other obstacles, like furniture, the layout includes
information about the rooms, like their geometry, their function, and their
connections.
The procedural layout generation is a technique that, starting from an
initial set of input parameters, produces as output a layout that follows as
much as possible the properties defined by the input data. The nature of the
input parameters depends on the method itself and on the representation
format used for the layout. Typically, the parameters are topological and
structural. The topological parameters are the adjacency relations of the
rooms, representing the connections between them, which are usually the
doors. These parameters are commonly expressed in a graph format, in which
the nodes represent rooms and the edges the connections between them. The
structural parameters are the geometrical and functional properties of the
rooms, like their sizes, their aspect ratio and their type.
As we want to generate realistic layouts, we need a generation technique
that allows enough control on the result, since we want to impose the features
that would make the resulting layout realistic.
As discussed in [27], the layout generation topic is not only considered
in the field of Computer Science, but also in Architecture, so there is a large
variety of methodologies. Some of them require a lot of interaction by the
user as their main goal is more to assist an architect than to automatize the
entire creation process.
Even in pure generative techniques there are different goals. In fact,
some methods are focused towards generating layouts with a large amount
of structural details, like rooms and facades forms, while others are aimed
to keep a topological resemblance with the input data provided.
In addition to that, there is also a difference in the quantity of input
data required by the various generation processes. In some cases a lot of
information and parameters are provided to create a layout that adheres
to most if not all of the initial constraints, which can be for example the
requested adjacency of the rooms. In other cases just few basic parameters
are needed by the system. This increases its degree of freedom but also allows
for less control on the final solution by the user. In fact, in some works the
explicit goal is to try to recreate a realistic building, by strictly following the
parameters provided by an expert user or by another layout, while in other
approaches the objective is to create quickly a lot of plausible buildings,
for example to populate a large 3D scene, disregarding many details of the
10
generated floor plans.
As last remark, most of the works are based on small buildings, usu-
ally residential houses, without focusing on the scalability of the method to
medium and large layouts. It is also clear that some approaches can handle
only problems with a very restrict number of rooms, at times even stating
the limit themselves or showing the largest building produced.
In the following subsections we analyze some of the most interesting and
studied approaches for the layout generation problem, dividing the works by
methodologies.
Genetic algorithms
Genetic algorithms (GA) are a very popular optimization and search method-
ology that models a possible solution of the problem, called in this case geno-
type, with a particular low-level encoding format that is usually binary, so
with a sequence of bits. As reviewed in [31], the genotype of each individual
is modified by operators to improve the fitness function. In the general case
genetic algorithms have three operators. The first, selection, chooses some
individuals (typically the most fit) to be bred, while the second, crossover,
creates new individuals by combining the two genotypes of the selected par-
ents with a certain strategy. An example of crossover from [31] is pictured in
11
Figure 2.2: Example of crossover
Figure 2.2, where the genotype of the parents is transferred to the children
by copying directly the genes until a certain point, after which the target of
the copy is exchanged between the offspring. There are also more complex
strategies to combine two original genotypes. The third operator is mutation.
It operates changing the genotype locally in a certain random fashion by a
small amount, acting directly on the genotype string. After the application
of the operators, there will be new individuals that replace the original ones
in the population. However, it is possible to adopt an elitism method that
carries to the new generation the best individuals in any case, guaranteeing
that the value of the fitness function won’t decrease over time since at each
generation the best solutions can’t be lost.
An example that applies this technique is [32], that uses GA in different
contexts. In fact, the goal is to generate a multi-level flat by producing ini-
tially the single floors and then, with the interaction of a user, combine them
to form the entire building. This work states that the maximum number of
rooms of a single floor that can be generated is 11.
A more advanced use of GA is in [33], where the layout representation is
based on a grid and the rooms are considered spaces that occupy a certain
amount of adjacent cells. A complex fitness function tries to enforce the
input parameters, but it can’t guarantee to always satisfy them all. In the
corresponding thesis [34] it is presented the example in Figure 2.3, in which
on the left it is pictured the generated office as retrieved from the genetic
algorithm process, while on the right it is shown the same floor plan with
some post correction steps. This work states that medium/large layouts are
impractical to solve because of the exponential growth of the search space
(the office in Figure 2.3 is considered one of the largest layouts that is possible
to generate with this method) and even in smaller cases it is not guaranteed
that all objectives are actually satisfied.
12
operators in a different way. The reason why genetic algorithms are the
most famous and common ones is their low-level encoding of the solution,
which increases the generality of the method since don’t require a complete
understanding of the problem to be solved.
There are various works that utilize a particular kind of evolutionary
algorithm, like in [35], where the goal is to create an interactive application
that generates some unrefined layouts using generic parameters and an input
target building. In particular, the system compares local neighborhoods
similarity between the given floor plan and the one that is being generated,
and utilizes this value as one of the multiple objectives of the fitness function.
The operators employed are local transformations of the rooms, that allow
movements, rotations, and swaps. The results are unrefined because they
are meant to be starting drafts for architects.
Another system is [36]. The peculiarity of this work is that the fitness
function also includes a similarity term based on the user ratings of previously
generated layouts. One of the main issues of this method is the difficulty
in the creation of a large dataset of rated environments, which must be
provided in a considerable number while keeping the scores assigned in a
consistent way during the entire process. Moreover, this strong dependence
on user ratings can misguide the generation towards solutions that are not
necessarily good but just contain particular features present in other highly
rated layouts.
Evolutionary strategies
13
candidate solution evaluated with the fitness function, but in this case the
individuals are not combined between them. Instead, they are only mutated
with very problem-specific operators. The selection guarantees that par-
ticularly bad solutions are discarded (and replaced with freshly generated
ones). The mutations can still perform modifications that decrease the value
of a solution, so that it is possible to evade from local maxima, which are
sub-optimal solutions that can’t no longer be improved by moving locally.
There are two very promising layout generation systems that follow this
approach. The first, called Evolutionary Program for the Space Allocation
Problem (EPSAP), is proposed by Rodrigues et al. in [4,37], where an evolu-
tionary strategy is coupled with a stochastic hill climbing (SHC) technique,
which is a local optimization algorithm that tries to improve a given function
with small movements, but not necessarily in the direction of the best local
improvement. The evolutionary strategy guarantees the constant presence of
multiple feasible solutions, one for each individual, and applies operations to
the layouts on a global scale, aligning walls and assuring the feasibility of the
layout. These operators are applied at each ES generation, but only after the
SHC optimization, which acts on a local scale to manipulate geometrically
the rooms. The system accepts as input both geometrical and topological
parameters. A further improvement of this method has been proposed with
enhanced capabilities, among which the generation of multi-level buildings,
in [38], while a practical application of it, with also the purpose of optimiz-
ing thermal performance of the generated layouts, is [39]. An example of
the enhanced method in [38] is reported in Figure 2.4, where a medium size
building is successfully generated.
The second method is proposed by Guo et al. in [5]. Even in this case
the procedure is divided in two steps, but here they are purely sequential.
The first step is a multi-agent system finalized to find a feasible layout for
the rooms according to the topology constraints. This system employs bub-
ble agents that can be spheres or capsules (the system considers multi-level
buildings) and, by the application of interaction rules (attraction, repulsion,
...) among them, provides in the end a certain topological layout mapped in
space. The second part is the evolutionary strategy, that acts on the con-
version of the previous layout to a grid-based representation and optimizes
the entire building manipulating the geometrical features of the rooms with
two specific operators. The first is the local movement of a boundary of a
room, while the second is optional and is based on the swap of two rooms
in the layout. The fitness function of the ES is calculated with a weighted
sum of four criteria (topology, size, aspect ratio, and building shape). The
main issues of this approach are scalability, the grid-based model, and that
14
Figure 2.4: Example of building generated with the EPSAP method
the evolutionary strategy algorithm used is too simple and can get stuck in
local maxima.
2.3.2 Treemaps
15
Figure 2.5: Example of derivation of a treemap from a tree
2.3.3 Grammars
Grammars in theoretical computer science are sets of defined rules used to
form valid strings according to a certain defined syntax. They don’t encode
the meaning (semantics) but only the structure.
One of the first works to utilize grammars to generate layouts is [43]. The
proposed approach is to capture a certain architectural style by creating a
Figure 2.6: Example of office generated with the Evolutionary Treemap method
16
language based on basic shapes, which can be combined using grammar rules
to create an entire building. The grammar rules are defined manually by an
expert. In particular, it is presented as example the generation of a Palladian
villa.
In general there are two main ways grammars can be employed in layout
generation. The first is to define a grammar to describe the structure of
a building and using it directly to generate some solutions (which are syn-
tactically valid strings). A method proposed in [44] is based on an initial
derivation of a certain number of layouts, from which the user can choose
one to consider as final result or to further modify with the same set of
rules. A similar system developed by Leblanc et al. in [45] is based on a
programmatic way to apply derivations, where the input data is a program
that defines the order and the conditions of the operations to be applied to
the layout.
The second approach is to use as in the previous case the grammar to
define the structure of the layout, but then to utilize a particular algorithm
(usually a genetic one) to apply rules like in [46] or to represent the building
itself as in [47], where the walls are directly encoded as genotype. The fitness
functions are utilized to evaluate the quality of the structure of the layouts,
like the respect of the adjacency and the sizes of the rooms. In both cases
only small houses can be generated.
Some of the main issues of these methodologies are the difficult formu-
lation of high level constraints in a clear and direct way, and the scalability
with buildings of medium/large sizes (at least in an autonomous way).
17
sampling method to estimate a certain distribution, using local operations
that manipulates the layout by sliding walls and swapping rooms. A complex
cost function tries to guide the optimization towards the desired architec-
tural program. Differently, in [3] the Bayesian network is used to predict the
rooms sizes and positions which, after a manual placement in the layout by
the user, are further optimized with a simulated annealing approach in two
steps. Simulated annealing [50] is a probabilistic technique used to approxi-
mate in a fast way the global optimum of a function. The first step involves
local operations to improve the position and orientation of the rooms, while
the second step refines the sizes. In both cases a relatively large dataset is
required to train the model.
A particular approach has been proposed by Feng et al. in [51], in which
the focus is optimizing large layouts according to some crowd flow metrics,
that are based on the potential movements of people in the environment. A
regressor [52], which is a predictor that learns a given function, is trained
with the proper complete agent-based simulations to evaluate in a fast way
an approximation of their costs instead of running dedicated simulations each
time. This improvement is used during the optimization performed with a
Metropolis-Hastings algorithm, that applies local operations and evaluates
at each generation the cost of the layout using the regressor. This evalua-
tion would be impracticable if the entire agent-based simulations had to be
repeated at each iteration.
18
Figure 2.7: Example of building generated and later improved with the MIQP method
19
offers hints and information each time the user interact with the layout. To
do so, the system considers various constraints and costs (the work is focused
on the minimization of cuts of pre-cast concrete slabs required to realize the
building).
Another different approach based almost entirely on graphs is [56], in
which a planar dual graph is generated from the starting floor plan. Once
the layout is represented in this way, it can be subjected to automatic or
user-based transformations, like addition or deletion of single rooms. At the
end of the entire process, the graph can be reconverted in a proper floor plan
for final refining.
2.4 Summary
In this chapter we presented various approaches and techniques related to
robotic experiments and to layout generation methods. In the first part we
introduced autonomous mobile robots. In the second we highlighted the im-
portance of simulations for robotic development and their limits, which are
specifically related to the use of realistic buildings. At last, we discussed
various layout generation techniques, underlining that just few of them can
actually handle specific input parameters to create mid/large scale environ-
ments while allowing the user to control the presence of particular features
in the generated buildings.
20
Chapter 3
Problem formulation
21
Figure 3.1: Example of maps used in the RC2019RVRL competition
22
Figure 3.2: Layout with corresponding graph
23
In contrast to other layout generation techniques, which either require
a large dataset of floor plans to learn or architectural rules to be directly
inserted by experts, our method should be usable by robotic researchers
with just a small amount of real building plans available. These floor plans
will constitute the foundation of the generative process. In this way, the
availability of a few dozen floor plans could be used to generate hundreds or
thousands of them. To do so, the objective is to be able to generate multiple
different environments for simulations starting from just a single original
building plan.
The generation method doesn’t necessarily need to generate new envi-
ronments in real-time, as is often the case within the field of procedural
content generation. Our goal is to generate mid/large layouts that reflect
in an accurate way features of real buildings, rather than to populate large
scenarios with many simple ones. Still, since the main idea is to increase the
number of available floor plans, the system should take a reasonable time to
produce an output, possibly in the order of minutes.
The fundamental feature that we want to guarantee is the topological
structure, that is the adjacency between rooms. The structural features,
considered as the geometrical properties of the rooms, are also important but
not as much as the topology. In fact, it is not strictly required to generate
rooms with complex structure and even rectangles are fine. For our intended
application, what is actually important is that the sizes of the original rooms
are maintained to a certain degree in the generated layout.
Another important property of the system is the compatibility of both
input and output formats with other common datasets, like the MIT and
KTH ones, which follow the format presented in [23]. In this way, these
datasets can be used as input to generate thousands of buildings.
In general, there is no need to generate multi-level buildings but only
single-level floor plans.
3.4 Summary
In this chapter we introduced the problem of generating realistic layouts for
simulation purposes. Next, we set the goal of the thesis and specified the
input and output of our system. Finally, we defined the properties that must
be respected by a generation system to be used for our purposes.
24
Chapter 4
Proposed solution
25
Figure 4.1: Fragment of the XML model of a layout
26
In this case it is possible to see the definition of the rooms with their sizes
and their type. The boundary is the space available to generate the layout,
and corresponds to a rectangle with the specified weight and height. At
the end of the file there is the proper topology graph, represented as a list
of adjacency between rooms, with additional information about the specific
connection.
27
(a) Original floor plan (b) Original layout in graph format
4.3a is shown the floor plan of the original building. Its conversion into
the XML graph format is not directly considered in this thesis. In Figure
4.3b is pictured this graph model, which can be utilized to draw each room
with the same location and structure of the original floor plan. Between the
rooms, it is possible to see points that represent the portals, that are the
connections between rooms (e.g., doors or passages). In Figure 4.3c is shown
the topology graph of the layout, which is part of the intermediate model
along with the sizes of the single rooms. In the figure it is possible to see the
nodes of the graph colored according to the room type. The corridors are
red, the entrances are yellow, and the generic rooms are blue. The result of
our generation process, that is stored in the same graph format of the input
layout, is displayed in Figure 4.3d.
28
4.2 Generation method
Considering the state of the art of layout generation techniques discussed in
Section 2.3, we found that most of them are not adequate for our goal, since
they can’t handle mid or large layouts and enforce all the input constraints
at the same time. The method we decided to employ is based on the one
proposed by Wu et al. in [6], which is based on the formulation of the layout
generation as a MIQP problem.
29
of a room in the space, and the adjacency between a room and the boundary.
In the basic formulation, each room is defined by five variables:
• w : integer variable that specifies the width of the room, which is its
size along the x axis.
• h: integer variable that specifies the height of the room, which is its
size along the y axis. In the original paper it is called depth.
• o: binary variable that specifies the orientation of the room, which can
be either vertical or horizontal.
The problem is based on finding the best allocation of rooms in the space
defined by the boundary. This is performed by considering the objective
function as the sum of two quadratic terms, which respectively control the
total filling of the boundary and the closeness to the target sizes.
The validity of the generated layout is ensured by two constraints. The
first imposes that every room is completely inside the boundary, while the
second guarantees the non-overlapping of the rooms.
To satisfy the additional requirements, like the adjacency of rooms, there
are other constraints. The most important are the aspect ratio constraints,
which enforce the respect of the minimum and maximum values defined as
input by considering the width, the height, and the orientation of the room,
and the adjacency constraints, which impose the overlapping of the two
specified rooms which, combined with the non-overlapping constraints, lead
to the overlapping of just their borders.
The method can be expanded with a hierarchical framework, which allows
to improve the details of single rooms and to generate large layouts efficiently.
The concept of improving rooms is utilized to close holes in the layout. It
is based on the decomposition of the rooms around the hole into multiple rect-
angles. In particular, each room is considered as the union of two rectangles
of the same size, obtained by dividing the original room along a random di-
rection. A new optimization problem is formulated on this local sub-domain,
using additional constraints to restrict the possible modifications of the new
layout with respect to the initial situation. With this process, it is possible
to obtain rooms with non-rectangular shapes.
30
The generation of large-scaled layouts is based on separating the complete
generation into multiple problems. The first one is used to divide the initial
boundary into macro-regions, which are later considered the boundaries for
other problems. Utilizing this iterative process, it is possible to generate
very large layouts with many simple optimization processes.
The formulated generation problem is very hard to solve, since there are
many variables and the search space is huge. However, it is possible to accept
sub-optimal solutions if they fulfill all the constraints and are obtained in a
reasonable time.
31
4.3 Summary
In this chapter we proposed a method to generate in a procedural way re-
alistic layouts. Our technique is based on the extraction of the topological
and structural features from the original plan. This process is performed by
creating a graph representation of the original layout, which is saved in an
intermediate file. This model, that can be manually modified or even created
from scratch, is then used as input data for a generation method based on
[6], which produces as output a new layout that is guaranteed to respect the
topological structure defined in input.
32
Chapter 5
System architecture
33
form a conversion that extracts this information from the XML format. As
it can be seen in the pipeline, the result of this procedure is the intermediate
model, which is encoded as a plain-text file. This new format allows the user
to manually modify the layout structure and add new constraints which are
later considered in the generation process. When the intermediate model is
ready, another parsing is performed in order to prepare the MIQP formu-
lation with the provided data. This procedure is straightforward, since the
intermediate format contains the parameters used in the optimization prob-
lem. Once the generation is completed, the resulting layout is both drawn
to file and saved in the same XML format utilized for the input layout.
Our system is entirely implemented in Python. In the rest of the chapter
we describe each element of the pipeline in detail.
• id: unique string that identifies the space. It is used in the definition
of portals connections.
34
• type: the general type of the room, which is usually one between R -
generic room, C - corridor, and E - entrance.
– id: unique string that identifies the linesegment, used when rep-
resenting a portal to define the connection in the portal list.
– points: two points that define the starting and the ending of
the entity considered by the linesegment (usually a wall, if it is a
portal then the points share the same coordinates).
– class: type of the linesegment entity. Can be wall or portal.
– type: type that describes the portal, which can be explicit in
case of a door or another generic passage with a barrier, and
implicit if there is no physical barrier but the two spaces are still
considered different. The case of vertical portals, included in the
original MIT format, is not considered as we handle only single-
level buildings.
– features: not implemented, it should describe the type of door
in case of portal.
• portals: the list of portals that are related to the current space. The
portal element is formed by:
35
– target: the list of ids of the spaces that this portal connects. It
defines the adjacency relations between the rooms.
– features: it is not implemented as in the linesegment case.
wb = xmax − xmin
hb = ymax − ymin
There are two issues in the conversion of the rooms. The first is the
presence of non-rectangular shaped spaces, while the second is the definition
of the margin allowed as minimum and maximum for the sizes and the aspect
ratio of the rooms. In the rest of the section, we discuss them in detail and
present the solutions we devised to solve them.
36
(a) Single complex space (b) Composition of simple spaces
(a) (b)
37
velop a method to approximate problematic rooms based on their area. We
consider the aspect ratio of the final room equal to that of the bounding box
of the original space. To do so, we compute the area of the polygon that
defines the original space. This value is by definition less than (or equal to)
the area of the entire bounding box of the room, since the polygon shape
is the part of surface of the bounding box that is effectively occupied. In
particular, we consider the square root of their ratio, defined as:
r
areapolygon
r
areapolygon
ratio = =
areabbox (xmax − xmin ) · (ymax − ymin )
This value is used to scale the sizes of the original bounding box to compute
the target sizes of the room converted in rectangular shape. These sizes w∗
and h∗ are calculated as:
The aspect ratio is computed with a more complex formula with a quadratic
term. We still use the minimum and maximum variance provided, but in this
38
case we don’t multiply them directly since it would create extreme values
for the rooms with an already high aspect ratio. The formula is based on
the sum of two terms that depends on the average of the variances. In
particular, the second term is quadratic in the aspect ratio, so that its effect
is significant only with rooms with an high aspect ratio. Each term also
includes a weighting parameter (α and β). The values we utilized are α = 1.5
and β = 0.2. The minimum and maximum aspect ratio (armin and armax )
are computed from the original one (ar∗ ) in this way:
variance+ − variance−
varianceavg =
2
armin = max(1, ar∗ − α · varianceavg − β · varianceavg · (ar∗ − 1)2 )
armax = ar∗ + α · varianceavg + β · varianceavg · (ar∗ − 1)2
• rooms:
39
to the type of the room and a progressive number starting from
0 (e.g., R5 it is the sixth room with the type "R").
– minw, maxw, minh, maxh: the minimum and maximum sizes
(width and height) of the room. They are hard constraints.
– targetw, targeth: the room target sizes that the optimization pro-
cess tries to achieve. They represent the soft constraints of the
problem.
– minar, maxar : the minimum and maximum aspect ratio of the
room. They are hard constraints.
– rtype: the type of the room. In the layouts that we used there
are just: R - generic room, C - corridor, and E - entrance.
– label : the label of the room. It usually describes the function of
the room (e.g., classroom, bathroom, office, ...).
– [onB] : optional constraint that imposes that this room needs to
directly touch at least a side of the external boundary.
• boundary:
• adjacencies:
40
• [positions]:
• [connections]:
• [clusters]:
– clusterid : the unique name of the cluster. After the cluster id, it
must follow a list of rooms that belong to that cluster. Multiple
clusters can be defined in this section leaving a blank line between
the end of the list of rooms belonging to a cluster and the next
cluster id. The list of rooms is defined as:
∗ id : the room that belongs to this cluster.
∗ x, y: the coordinates of the specified room.
5.5.1 Model
In this section we will present in detail our formulation of the MIQP problem.
41
As discussed in the previous chapter, the topology of the layout is an
hard constraint of the optimization problem. There are hard constraints
also to guarantee the minimum and maximum sizes of the rooms.
Another property we would like to enforce is that the area of the gener-
ated layout corresponds as much as possible to the original one. However,
this can’t be expressed in quadratic terms, since it would require a quadratic
difference of the areas (already quadratic). Therefore, we decided to keep
the objective function originally proposed in [6], while also introducing some
parameters to control in a better way the generation process. As in the orig-
inal formulation, the objective function is the weighted sum of two terms,
both quadratic:
min λcover · Ecover + λerror · Eerror (5.1)
The first term controls the total area of the layout, guiding the optimiza-
tion toward the filling of the entire boundary with the rooms. In particular,
we added a parameter ρcover to control the importance of each room in this
summation. The area term is:
rooms
X
Ecover = (wb · hb ) − (wi · hi ) · ρcoveri (5.2)
i
The first product is the total area available in the boundary and it is used to
keep the term positive. The summation operates on each room, computing
the area of the single rooms weighted with ρcoveri , which is intended to
decrease the importance of specific rooms in the entire term (usually the
corridors). Weighting more this part of the objective function with λcover
leads to fill the given boundary, expanding as much as possible every room.
The second term of the objective function tries to minimize the total
divergence of the rooms sizes from the target ones given in input. As the
error is already computed with a product, the term operates on the width
and on the height independently. It also considers the orientation o of the
room, that is a binary variable which represent the orientation of the room,
to guarantee the right comparison between the target sizes. In particular,
o = 0 means that the room is placed horizontally, with the width larger than
the height, while with o = 1 the room has a larger height than width. The
error term is:
rooms
X
Eerror = ρerrori ·((hi −oi ·wi∗ −(1−oi )·h∗i )2 +(wi −(1−oi )·wi∗ −oi ·h∗i )2 )
i
(5.3)
Also in this case there is a parameter ρerrori that allows a specific weight for
certain rooms (typically to reduce the importance of errors of the corridors).
42
The rest of the summation is the sum of the error between the sizes of the
room hi and wi , and their target values h∗i and wi∗ , which are defined in the
intermediate file, as seen in Section 5.4. In particular, the orientation variable
oi is used to consider the correct enforcement of the target size according
to the alignment assumed by the room in a specific solution, selecting for
example if the height hi of the room should be compared with the target
height or width, which are respectively h∗i and wi∗ .
The constraints used by our formulation are linear and usually affects all
the rooms. A list of the constraints and their explanation is provided below.
43
Aspect ratio constraint
The aspect ratio constraint is the same of the one implemented in the orig-
inal formulation. It is the first constraint that includes the constant M,
which is a large number utilized in formulating logical operations through
binary variables, which are integer variables restricted to the values 0 and
1. Here the constant M is used to control the enforcement of two alterna-
tive cases, expressed as different constraints, which are exclusively nullified
by the addition or subtraction of M (according to the state of the binary
variable) that guarantees that the constraint is valid for any allocated value
of the other variables involved. We decided to actually enforce the aspect
ratio constraint on every room except the corridors. The reason is that we
already have the minimum and maximum size constraints and it is difficult,
especially in converted layouts, to define good aspect ratio values for long
corridors. Another important remark is that we only check the minimum
and maximum aspect ratio, while the target value is not considered here but
only in the error term of the objective function.
minAR · h ≤ w + M · o
maxAR · h ≥ w − M · o
∀ rooms \ corridors (5.6)
minAR · w ≤ h + M · (1 − o)
maxAR · w ≥ h − M · (1 − o)
Inside constraint
This constraint guarantees that each rooms remains in its entirety inside the
boundary. It is implemented in the same way of the original formulation. wb
and hb are respectively the width and height of the boundary.
(
x + w ≤ wb
∀ rooms (5.7)
y + h ≤ hb
Non-overlap constraint
44
is used to specify the relative direction (up, down, left, and right) of the
second room with respect to the first one. This constraint operates also on
the obstacles, if defined, that act as fixed rooms to not be overlapped.
xi ≥ xj + wj + walldim − M ·(1 − ωright )
xi + wi + walldim ≤ xj + M ·(1 − ωlef t )
yi ≥ yj + hj + walldim − M ·(1 − ωup ) ∀ i, j : rooms, i 6= j (5.8)
yi + hi + walldim ≤ yj + M ·(1 − ωdown )
ωright + ωlef t + ωup + ωdown ≥ 1
Adjacency constraint
45
described one.
minAdjacency
minA =
doorU tilization
x r1 ≤ x r2 + w r2 + walldim − minA · α
xr1 + wr1 + walldim ≥ xr2 + minA · α
yr1 ≤ yr2 + hr2 + walldim − minA · (1 − α)
Position constraint
Connection constraint
This is the two points version of the position constraint. The idea is the
same, with both points that are constrained to be inside the room. The
peculiarity of this constraint is that multiple pairs of points can be imposed
to be inside the same room.
xi ≤ xp1
xi + wi ≥ xp1
yi ≤ yp1
y +h ≥y
i i p1
∀ (i, p1, p2) : connections (5.11)
x i ≤ x p2
xi + wi ≥ xp2
yi ≤ yp2
yi + hi ≥ yp2
46
Boundary constraint
This optional constraint is used to guarantee that a room touches at least one
side of the boundary. It is a simplified version of the original one, since ours
doesn’t account for obstacles. We decided to ignore them because they are
not used by the converter. Also in this case, four auxiliary binary variables β
are used to select the boundary side to touch for each room. It is also possible
to use global β variables to force all the rooms affected by this constraint to
be on the same boundary side.
xi + wi ≥ wb − M ·(1 − βright )
xi ≤ M ·(1 − βlef t )
yi + hi ≥ hb − M ·(1 − βup ) ∀ i : rooms, i fixed to boundary
yi ≤ M ·(1 − βdown )
βright + βlef t + βup +βdown ≥ 1
(5.12)
Cluster constraint
This is a new optional constraint that we use to fix relative positions among
a certain group of rooms, which is called cluster. While the previous con-
straints enforce the location of a room within the boundary given one or
two fixed points, in this case the specified coordinates are considered rela-
tive between the rooms of the same cluster. In fact, the cluster itself can be
freely positioned within the boundary, as long as all the other constraints
of the rooms allow that. The functioning of this constraint is similar to the
position constraint defined previously, but with two differences. The first is
that the enforced point is not fixed but is composed of two additional con-
tinuous variables, xcluster and ycluster , that specify the position within the
boundary of the entire cluster. In fact, this constraint forces that each room
is located in a certain relative position to the cluster. The coordinates of the
room in the cluster space are xf and yf , which are defined in the intermedi-
ate model in Section 5.4. The second difference is the addition of a margin
parameter, which allows a certain deviation from the fixed coordinates by
enlarging the room sizes when enforcing the position constraint. This leads
to a larger degree of freedom in the positioning of the room by the solver.
The margin parameter can be set zero (eliminating this additional offset) or
even increased. It is possible to insert the same room in different clusters.
47
Figure 5.4: Overview of Gurobi API
In this way, the room is affected by both constraints at the same time.
xi − margin ≤ xfij + xclusterj
x + w + margin ≥ x + x
i i fij clusterj
∀ i : rooms, j : clusters, i ∈ j
y i − margin ≤ y f ij
+ ycluster j
yi + hi + margin ≥ yfij + yclusterj
(5.13)
5.5.2 Implementation
The optimization is performed with Gurobi 8.1 [62], using the Python API to
interface the solver with our system. Gurobi is a state of the art commercial
solver, able to solve optimization problems of different nature, both linear
and quadratic. The API architecture is described in the reference manual1
with the structure represented in Figure 5.4. Gurobi allows to customize the
optimization process through various parameters. We utilize the following:
48
• Heuristics: it is the percentage of time allocated in MIP problems to
the heuristics. The default value is 0.05, which means that the solver
tries to find new solutions instead of improving the current bounds in
only 5% of the runtime. We use a very high value of this parameter
(usually between 0.6 and the maximum allowed, which is 1) since our
model often requires a lot of efforts to even just find a feasible solution.
This is one of the most important parameters that the user has to set.
For smaller and simpler layouts, 0.6 is usually enough, while complex
ones require a much higher value.
The generation workflow begins with the loading of the layout specifi-
cation from an intermediate model file, usually created by the XML parser.
This parsing procedure is very simple, contrary to the one described in Sec-
tion 5.3, since the intermediate model embeds all the input parameters of the
MIQP problem. A Layout object is instantiated and filled with all the input
data. Once this procedure ends, the system prepares the Gurobi model by
creating the objective function and all the constraints utilized in the specific
problem. When the model is filled, the optimization process begins. After
the defined time limit, the system stores the best solution found inside the
Layout object itself. In the worst case, if no solution is found the program
terminates here. If a solution is found, the Layout object is saved in a dump
file using the pickle2 library, which serializes and stores the class in a binary
file, allowing its content to be reloaded in the future. After that, the system
draws the generated layout in an image file, which can be used to quickly
examine the result of the generation. At the end of the process, the system
saves the generated layout in a XML file, which follows the same format of
the initial input.
The optimization in some cases fail in identifying a feasible solution due
to the computational complexity of the given instance of the problem. In
particular, we found that this method works very well even with a large
number of rooms, but can have problems in finding solutions when the layout
contains cycles. To mitigate this issue, we develop a cycle decomposition
technique that is based on solving a sub-problem with a lower number of
2
https://docs.python.org/3/library/pickle.html
49
(a) Layout with two cycles
(b) Layout with a single cycle
rooms and then applying some additional constraints when solving the global
generation problem. We now present this method in detail.
50
(a) Cycle with a chord (b) Non-minimum cycle
Once this entire process ends, the system prepares the new global gener-
ation, adding the retrieved cluster to the layout specification. This problem
corresponds to the one formulated initially, with the addition of the cluster
51
Figure 5.8: Normalization of the cluster
5.6 Drawer
After the generation process is complete and a layout is found, the system
draws it to an image file. We don’t consider furniture, windows, or other
elements of the building, but just the walls and the connections between the
rooms. An example of generated layout can be seen in Figure 5.9.
52
Figure 5.9: Example of generated layout
The represented elements in the image are the walls, the labels of the
rooms, and the connections between them. In particular, the system uti-
lizes the original portal type to define whether a portal should be a door
or an implicit portal. The width of the door corresponds to the minimum
adjacency size defined in the layout specification, while its position is always
assumed to be at the center of the wall shared by the two adjacent rooms.
An example of both kind of connections is shown in Figure 5.10.
53
Figure 5.10: Example of explicit and implicit portal representations
derived in an easy way from the original file with a simple parsing procedure.
5.8 Summary
In this chapter we described the implementation of our system. We started
illustrating the pipeline of the entire process, which operates at each stage
with a different data structure for the layout. We then discussed each com-
ponent in detail, focusing in particular on the issues they face and how they
solve them.
54
Chapter 6
Experimental results
In this chapter, we present some building layouts generated with our method
and the experiments we performed to validate them. We start showing some
examples of generations, making considerations on the parameters used and
how they affect the results. Next, we introduce the infrastructure that we
utilize to perform the experiments. After that, we present the two experi-
ments we decided to use to evaluate the realism the generated layouts. The
first one involves static path planning between rooms, while the second one
involves exploration of the environments by a simulated robot. For both the
experiments, we present and comment their results.
55
Figure 6.1: Original layout of a school
This parameter weights the sum of the two terms Ecover and Eerror of the
objective function of the MIQP problem. In general, using a value λcover = 1,
like in the original formulation in [6], leads to layouts with a much larger area
than the original one, since the boundary size is automatically defined as the
bounding box of the original layout, which can be an overapproximation of
the original boundary for layouts like the one shown in Figure 6.1.
The area of the building is influenced directly by three factors in the
optimization. The first is the cover term Ecover of the objective function,
that is an explicit maximization of the total sum of the areas of each room.
The second factor is the other term of the objective function, Earea , which
minimizes the displacement of the sizes of the rooms from the target ones.
The third factor is the minimum and maximum sizes of the rooms, which
are hard constraints and guarantee that the width and height of each gener-
ated room don’t deviate much from the original values defined in the layout
specification.
We found that a λcover value between 0.1 and 0.2 allows to generate
layouts with areas similar to the original ones, even when the bounding box
used as boundary doesn’t fit very well the original shape of the building, like
the school in Figure 6.1. Lower values like 0.001 or less can be used, but
the resulting area will be much smaller than the original. In addition to the
λcover , it is also possible to tune the optimization process using the ρcover
and ρerror parameters, allowing a finer control of the importance of the two
terms of the objective function with specific values for each room. Their
default values are 1 for each room.
In Figure 6.2 we show an example of generated layouts with different
λcover . The generated layout with the area closer to the original in Figure
6.2a is the one with λcover = 0.1, which is shown in Figure 6.2c. The gener-
56
(a) Original - 1530 m2 (b) Generated - 2278 m2 - λcover = 1
(c) Generated - 1448 m2 - λcover = 0.1 (d) Generated - 1268 m2 - λcover = 0.0001
Figure 6.2: Comparison of generated layouts of a school with different values of λcover
ated version with λcover = 0.0001 is smaller but still relative close, while the
one with λcover = 1 is completely different considering the area.
We accept any solution found by the optimization process, since the hard
constraints of the MIQP formulation assure that every feasible solution re-
spects the topology graph and the rooms sizes defined in input. However,
there is no guarantee that the solver can actually find a solution in a certain
amount of time.
In these cases it is possible to help Gurobi by changing some of its param-
eters, defined in Section 5.5.2. In particular, increasing the TimeLimit and
the Heuristics values can provide a massive help to the solver. In addition,
it is also possible to enlarge the boundary size in the layout specification to
facilitate the search of a feasible solution.
Here, we present the main issues that we found with our method.
57
Figure 6.3: Example of non-rectangular rooms in the original layout
Non-rectangular rooms
The first issue is caused by particular room structures in the input layouts.
An example is shown in Figure 6.3, in which the corridors C8, C9, and C11
have non-rectangular shapes. The XML parser approximates these rooms
with the technique presented in Section 5.3.1. However, utilizing these ap-
proximations can lead to an unfeasible layout specification. In fact, the
conversion procedure is based on keeping the original area for the rectangu-
lar room, but since the final aspect ratio is the one of the initial bounding
box, the resulting room will be shorter and wider in case of a corridor like the
one reported in Figure 6.4, where in red is represented the original bounding
box and in gray the room.
If the original room has a relative small area, but a large bounding box
caused by an highly irregular profile, like the corridor C11 in Figure 6.3,
58
(a) (b)
then it is possible that the approximated room is too short to connect all
the required rooms.
To solve this issue, a possible solution is to increase the variance+ and
variance− values, which are used, like discussed in Section 5.3.2, by the
XML parser to specify larger bounds for the sizes of the rooms in the layout
specification. However, utilizing high values for variance+ and variance−
leads to a much larger search space of the MIQP problem, which increases
the difficulty of the solver in finding feasible solutions.
59
completely avoiding this issue.
The cycle decomposition technique, described in Section 5.5.3, helps the
solver in these situations by isolating a cycle, solving a sub-problem limited to
those rooms, and then keeping their relative positions in the global generation
problem.
The use of this method is optional, since it doesn’t guarantee to actually
find a solution and it can even prevent the generation of the layout. In fact,
the relative positions fixed in the sub-problems could be unfeasible in the
global formulation of the problem, since they don’t account for the presence
of rooms that aren’t directly part of the cycle or immediate neighbors. In
addition, another downside of this technique is that it requires an additional
global generation each time it is applied, until a solution is found or until
there are no more cycles to decompose. Even if the TimeLimit of the sub-
problem is typically chosen lower than the original one, it is usually better
to try multiple Gurobi parameters choices before applying this method.
Office 1
In Figure 6.6 is shown the original layout and three generated versions of a
medium sized office. The layout in Figure 6.6b is the layout generated di-
rectly from the input layout. To generate the other two, we fixed the position
of the room E1 within the boundary by manually editing the intermediate
model file. In this way, we obtained two generated layouts that are different
60
(a) Original - 1590 m2 (b) Generated - 1325 m2 - λcover = 0.1
(c) Generated - 1618 m2 - λcover = 0.1 (d) Generated - 1379 m2 - λcover = 0.1
from the first one. We can see that the general structure is similar between
all the layouts, and in particular the largest rooms in the original layout are
still the largest in the generated versions.
School 1
In Figure 6.7 is shown the generation of a large scale school. In this example,
we can see that our method handled well the generation of a large layout,
since despite the bounding box is not fit to the original building shape, the
areas of the two layouts are very similar.
School 2
The generation of this layout, pictured in Figure 6.8, is more difficult than
the previous examples because of the presence of a cycle. To find a feasible
solution, we employ the cycle decomposition technique illustrated in Section
5.5.3. We report in Figure 6.9a the layout generated for the sub-problem,
which contains less rooms than the global one. The complete result of the
generation is shown in Figure 6.9b.
61
(a) Original - 7166 m2
62
Figure 6.8: Original - 2764 m2
6.3.1 ROS
As introduced in the state of the art in Section 2.2, ROS (Robotic Operating
System) [19] is an open-source framework employed in robotics that provides
services like hardware abstraction, low-level device control, and standard im-
plementations of commonly-used functionalities. ROS is based on packages
that can be either written and built with the help of the provided tools
and libraries, or directly retrieved through a dedicated package management
system. ROS acts as an operative system, organizing the executions and
63
(a) Layout generated for the sub-problem
64
the communications of the software components in use, even across different
machines.
The execution of programs is modular and based on the concept of node,
which is a process that performs computation. Each node implements a
particular functionality, that can be both hardware or software related (e.g.,
controlling a sensor, localizing the robot, ...).
The exchange of information between nodes is handled directly by ROS.
In particular, the nodes communicate utilizing messages, which are data
structures that contain typed fields. These fields can be primitive types
(e.g., integer, floating point, Boolean, ...), arrays, or nested structures.
These messages are routed between nodes using a publisher/subscriber
protocol based on topics. A topic is the name reserved by a node to publish
messages. In this way, the messages are not exchanged directly from a node
to another, but are rather published on a topic and available to anyone that
is subscribed to it. This allows multiple nodes to send or to receive the same
messages, while keeping a decentralized architecture since the nodes aren’t
directly aware of the execution of other nodes.
An alternative communication paradigm offered by ROS is the service.
Services are based on a request/reply interaction between two nodes. In
particular, the format of the communication is based on a pair of different
data structures, one for the request and one for the response. With this
system, the communication is directly between a single provider of the service
and an individual requester, which sends a request and waits for the response.
6.3.2 Stage
Since the focus of our experiments is the planning and the exploration of
the environment, we decided to utilize Stage since we don’t require high
fidelity simulations. Stage [17], as already introduced in Section 2.2, is a
lightweight 2D simulator that model a single or multiple robots in a virtual
world. It models the uncertainty affecting the dynamics and the perception
of robots, but not their physical interaction with the environment. We use
it to simulate a generic differential drive robot equipped with a frontal laser
range scanner sensor, with a field of view of 270◦ and a range of 30 m.
Stage accepts the description of the setting, which includes the bitmap
image representing the environment and the parameters required to model
the robot, as a world file. The input floor plan is represented as a black and
white image, specifying with white pixels the free space and with black ones
the obstacles, which in our case are only the walls of the building layout.
65
Figure 6.10: Snapshot of a Stage simulation
Figure 6.11: Example of frontiers between explored and unexplored regions of a map
1
http://rtv.github.io/Stage/group__model__position.html
66
Figure 6.12: Architecture of the ROS Navigation stack
67
based on [67] and [68].
GMapping is a particle filter SLAM algorithm that utilizes information
from odometry and laser sensors to learn the grid map. As discussed in [7], a
particle filter considers a finite number of hypotheses (the particles), which
are utilized to store the candidate maps of the environment (as in the case
of GMapping), the estimated pose, or both.
The odometry and the raw laser range scanner data are provided to
GMapping directly by Stage.
68
All the generated layouts utilized in this experiments are generated with
λcover = 0.1
6.4.1 Office 1
The first layout we analyze is the same office presented in Section 6.2. This is
a medium size building with five entrances. We utilized the three generated
layout shown in Figure 6.6 and two other generated layouts, obtained by
fixing the location of E1 in different points of the space.
Figure 6.14: Path planning results for the Office 1 layout. The numbers indicate the
path between two entrances (e.g., 0-1 indicates the path between the entrance E0 and
E1)
In Figure 6.14 it is shown the data retrieved from the path planning. On
the horizontal axis there are the various paths between the rooms, which are
symmetric and so taken just once for each pair of rooms. On the vertical
axis it is represented the path distance. In particular, the blue column cor-
responds to the original layout, while the orange one is the average between
the five generated layouts, with the respective standard deviation.
It is possible to notice from both the data in Figure 6.14 and the layouts
in Figure 6.15 that the first four entrances (E0, E1, E2, and E3) are in the
same region, while the remaining one (E4) is on the other side of the building.
This feature is present in both the original layout and in the generated ones.
69
(a) Original layout
Figure 6.15: Comparison of entrances between the original Office 1 layout and a gen-
erated one
70
6.4.2 School 2
The second layout we consider is the second school presented in Section 6.2.
This is a large scale layout. As in the previous case, we utilize the technique
of fixing rooms to generate multiple variants with the same input layout.
Like the last example, also in this layout there are five entrances.
71
(a) Original layout
Figure 6.17: Comparison of E4 between the original School 2 layout and two generated
ones
72
(a) (b)
Figure 6.18: Comparison between two situations from the same topology structure
73
original building layout and in two generated layouts obtained with different
parameters. In particular, we utilize a layout generated with λcover = 0.1
and one with λcover = 0.2 for each environment.
In each exploration run, the starting point is always the same, and cor-
responds to the same room (an entrance) across all the three variants.
74
Figure 6.19: t-SNE that summarize the exploration data results
75
Figure 6.20: Original layout of Office 5
76
(a) Office 5 (b) Office 4
(c) School 5
77
(a) Office 5 (b) Office 4
(c) School 5
(c) School 5
78
(a) Office 5 (b) Office 4
(c) School 5
Figure 6.25: Comparison of exploration times and traveled distances divided by the area
of the layout for Office 5, Office 4, and School 5
79
point of view, and that the difference in the exploration performance in
Figure 6.23 and Figure 6.24 depends on the area of the layout. We expect
to obtain similar performance results in this environment with an extensive
tuning of the cover parameters to increase the area of these generated layouts.
Considering the data acquired in this experiment, we state that our gener-
ation method can provide layouts with exploration performances similar to
the original ones. This means that we can successfully generate multiple
realistic building layouts that behave like the real world ones that we utilize
as input in our generation process. However, we identified two issues that
can lead to a significant difference in exploration time and length of traveled
path.
The first is the presence of non-rectangular rooms in the original layouts.
This can be an issue both for the generation itself, as discussed in Section
6.1.2, and for the exploration. In fact, we are limited with our method to
generate rectangular rooms, which are easier to explore by the robot. The
reason is that a non-rectangular room can require multiple observations (and
thus multiple exploration goals) to be completely mapped, since a complex
room shape can limit the line of sight of the laser range scanner of the
robot. An example of this situation is shown in Figure 6.26, where the the
robot represented by the blue arrow has just entered the room. However, the
onboard laser range scanner is limited to view the green portion of the room.
The red dashed line is the line of sight limit caused by the structure of the
room. This leads to the creation of additional frontiers for the room on the
boundary between the green and the red regions. In this way, a single room
can take much longer to be fully explored, extending the entire exploration
process in both time and distance required.
The second issue is the variability of the connections between the rooms.
In fact, the same problem of the swap of the rooms introduced in Section 6.4.3
can affect both the starting position of the explorations and the corridors
configurations of the generated layout, reducing, or increasing, the original
distance and time required to reach another part of the building. Since we
utilized an exploration strategy based on the nearest frontiers, this issue was
probably minimized in our exploration runs. However, like in the previous
case of path planning, we expect these differences to be, on a global scale,
on average negligible.
80
Figure 6.26: Example of line of sight limitation of the onboard laser range scanner in a
non-rectangular room
6.6 Summary
In this chapter, we discussed at first the issues of our generation method.
After that, we presented some examples of generated layouts. Next, we
described the setup of the experiments we perform, their results, and some
observations on them, concluding that the major issue in both the generation
and the explorations experiment is the presence of non-rectangular shaped
rooms in the original layout.
81
82
Chapter 7
83
length of the paths planned vary across the original layout and the generated
ones. We found that the lengths of planned paths are similar on average (over
multiple generated layouts) to those measured in the original layout, even
if we don’t consider the distances between rooms in the generation method
but only the topology graph. The second experiment we performed is the
exploration of the environments with a simulated robot. In this case, we
focused on evaluating if the exploration time and the length of the traveled
path required to complete the exploration process is similar between real
world and simulated environments. Across the tested layouts, we found that
most of them share similar performance with the original layout, meaning
that our method successfully generated realistic building layouts. However,
in some isolated cases, our method generates layouts that don’t perform like
their original versions. We identified the cause of this problem, which is
caused by the complex structure of some rooms of the original layouts. In
fact, our method can only generate rectangular rooms, which are easier to
explore by the robot than non-rectangular shaped ones.
In conclusion, our procedural generation method performs well in gen-
erating realistic layouts, handling also medium and large scale ones, even if
there are some limitations that can affect both the generation process and
the experiments performed on the generated layouts. In fact, as we discussed
in Section 6.1.2, non-rectangular shaped rooms and cycles in the input graph
can increase the computational complexity of the generation, and even pre-
venting it in some extreme cases.
84
connection constraint, defined in Section 5.5.1, to impose the positions
of the rooms that connect them.
85
86
Bibliography
[5] Z. Guo and B. Li, “Evolutionary approach for spatial architecture layout
design enhanced by an agent-based topology finding system,” Frontiers
of Architectural Research, vol. 6, no. 1, pp. 53–62, 2017.
[6] W. Wu, L. Fan, L. Liu, and P. Wonka, “MIQP-based layout design for
building interiors,” in Proceedings of Computer Graphics Forum, vol. 37,
pp. 511–521, Wiley Online Library, 2018.
87
tational Intelligence in Robotics and Automation, pp. 146–151, IEEE
Computer Society, 1997.
[12] A. Howard and N. Roy, “The robotics data set repository (radish),”
2003. http://radish.sourceforge.net/.
[18] N. Koenig and A. Howard, “Design and use paradigms for Gazebo, an
open-source multi-robot simulator,” in Proceedings of IEEE/RSJ Inter-
national Conference on Intelligent Robots and Systems, (Sendai, Japan),
pp. 2149–2154, Sep 2004.
88
[20] E. Whiting, J. Battat, and S. Teller, “Generating a topological model of
multi-building environments from floorplans,” in Proceedings of CAAD
(Computer-Aided Architectural Design) Futures 2007, pp. 115–28, July
2007.
[22] T. Li, D. Ho, C. Li, D. Zhu, C. Wang, and M. Q.-H. Meng, “HouseExpo:
A large-scale 2D indoor layout dataset for learning-based algorithms on
mobile robots,” arXiv preprint arXiv:1903.09845, 2019.
89
[30] V. Calixto and G. Celani, “A literature review for space planning op-
timization using an evolutionary algorithm approach: 1992-2014,” in
Proceedings of XIX Congresso da Sociedade Ibero-americana de Gráfica
Digital 2015, CUMINCAD, 2015.
90
[41] F. Marson and S. Musse, “Automatic real-time generation of floor plans
based on squarified treemaps algorithm,” International Journal of Com-
puter Games Technology, vol. 2010, 2010.
[51] T. Feng, L.-F. Yu, S.-K. Yeung, K. Yin, and K. Zhou, “Crowd-driven
mid-scale layout design.,” ACM Transactions on Graphics (TOG),
vol. 35, no. 4, pp. 132–1, 2016.
91
[54] R. Rajapaksha, K. Jayawardena, and S. Fernando, “A knowledge base
approach for efficient home floor plan generation applying polygon based
representation,” in Proceedings of 8th International Conference on Ubi-
Media Computing (UMEDIA), pp. 324–329, IEEE, 2015.
92
[65] T. Andre, D. Neuhold, and C. Bettstetter, “Coordinated multi-robot
exploration: Out of the box packages for ROS,” in Proceedings of IEEE
GLOBECOM WiUAV Workshop, Dec. 2014.
93