Automatic Mapping of A Room Using LIDAR-Based Measuring Sensor
Automatic Mapping of A Room Using LIDAR-Based Measuring Sensor
Abstract— The intense growth in the mobile robotics market in different fields. Since mobile phones are very popular, a
is leading to a demand for low cost solutions concerning the domain of interest nowadays is indoor navigation using a
robotics navigation and mapping. This paper presents a smartphone application. The information regarding a mapped
complex system made for mapping closed spaces like rooms. area can be used by an indoor navigation software as presented
The entire process of developing such a system will be described, in [1].
starting with the hardware parts, continuing with the
algorithms that were used and finally, the actual results that The continuous growth in the real estate transactions on
were achieved. The complexity of the project consists in the fact market is forcing the developers to offer low cost solutions
that a large variety of knowledge from different domains was concerning the robotics navigation and mapping. Since
used such as: embedded systems, robotics, principles, hardware can be quite expensive and over-specified for the
techniques and measuring devices, data communication, cloud requirements of the application, the new class of LIDAR
computing, database principles and so on. The paper will devices can be used as it was presented in [2]. The information
describe the usage of the distance measurement sensor, Scanse provided by the LIDAR sensor can be combined as presented
Sweep, which is using the LIDAR (light detection and ranging) in [3] with the information provided by a vision sensor in order
technique in order to collect data which will be analysed by a to improve the achieved results. When the mapping process is
software application that is running on a PC. The paper also started, SLAM (Simultaneous Localization and Mapping)
presents features like the usage of mobile phones, usage of Cloud
method covered by [4] can be taken into consideration. The
for data saving and manipulation, algorithms that ensure the
concept behind this is that the robot should act as a person than
autonomy of the robot and algorithms used for achieving a full
scan of a room making as fewer moves as possible. enters for the first time into an unknown building and starts to
notice the doors, elevators and so on.
Keywords— mapping system, LIDAR sensors, robots, A fully functioning scanning system is presented in the
automatic control, data communication, Cloud paper [5], which is also based on a LIDAR sensor, but the
I. INTRODUCTION mobility of the system is assured by a human cartographer not
by a machine. The problem that can appear when a person is
The cost of making a robot has dropped considerably. As using such a system is that its actions can’t be controlled. From
a result, more robot-based applications are being developed in this a series of issues can appear like the lack of efficiency or
all areas. Practical, but also didactic, are applications such as wrong usage of the system that can be harmful to the output.
the identification of an optimal route (based on different Also, the reference, highlights the advantages of a 3D
metrics) or the revealing of hardly accessible or dangerous scanning device over a 2D one but also the costs that are
interior spaces. University environments, through students involved. Even more, the paper [6], shows the possibility of
and teachers, contribute to the diversification of such using a smartphone-based mapping project that reduces
applications that involves robots and minimal costs. Rather significantly the hardware requirements, bus, yet again, the
than studying the supply of sensors, modular robotic platforms human factor is a key aspect, which reveals how hard is to
and scientific papers in the field, the present paper brings new achieve a fully automated mapping platform. The mobile
solutions for revealing a room that have not only direct exploration and recognition of indoor structures exploiting
teaching utility, but also can be taken into consideration by omnidirectional images is presented in [7], where the images
companies that sell, buy or rent real estate. taken by a mobile device are used to create a map of an indoor
Indoor mapping is useful in many domains and the area.
information provided by the whole process is required as input
690
The following equipment was used: by the moving algorithms that will be covered next. The
measurement error grows in concordance to the distance and
x Devastator Tank Mobile Robot Platform [13]. This can reach variations of 17 cm when a 40 m measurement is
platform was used as a chassis, all other components done.
being equipped to this platform.
x Metal DC Geared Motor w/Encoder - 6V 100RPM
6.5Kg.cm [14]. Since the Devastator platform is
equipped with caterpillars, for increased mobility, 2
motors were used, therefore each caterpillar can be
controlled individually.
x 2x7A DC Motor Driver [15]. In order to protect the
microcontroller from high currents this dual motor
driver was used to control the DC motors.
x 16x2 LCD Brick [16]. LCD can be used to display
different error, control or informative messages (E.g. Fig. 5. The error range of Scanse Sweep in centimetres
the IP of the microcontroller).
B. Software architecture
x Raspberry Pi 3 [17]. Given the capabilities of the From an architectural point of view, the software is
microcontroller and the fact that it has an integrated divided into four modules as follows: the Raspberry Pi
Wi-Fi module and several USB ports, Raspberry Pi 3 module, the PC module, the Cloud module and the
is a suitable microcontroller for the requirements of smartphone module. The architecture of the entire system
this paper since data transmission is done using Wi-Fi (Fig. 6) is a hybrid one, since the master – slave architecture
and the communication with the distance measurement is used for the PC - Robot connection and client – server
sensor is done via USB. principles are applied for the connection between
x Scanse Sweep Sensor [18] PC/Smartphone and Cloud.
691
C. Implementation aspects on the next point. If the point verifies the line’s equation, it is
When asked, the robot will measure the distance (360° added to the line. If the point doesn’t verify the equation, the
range) and will provide that data to the PC. The format of the line will be saved and a new line will be computed, based on
data is the following: angle, distance, signal power and a the current point and the next one. The algorithm goes on until
terminator symbol (E.g. 94337,133,191T – meaning 94 all the points are consumed. The line’s equation looks like (1)
degrees, 133 centimetres, 191 out of 255 signal power and the and since there are measurement errors, an ο (epsilon) must be
letter T which is used as terminator symbol). The sensor’s taken into consideration when the verification of the
zero-degree angle is marked by a line (Fig. 4) and all the appurtenance of a point to a line is done thru equation (2).
angles are relative to that point. The signal power is a number
that tells how precise the measurement is, the range of the y = mx + b
signal is uint8 [0 – 255] and based on that value the distance
can be taken into consideration or not. \İ P[E
The data processing algorithm uses simple mathematical Epsilon depends on the distance of the point from the
formulas such as Pythagorean theorem in order to extract origin because for a farther point, the epsilon will be bigger
points (more specifically, the coordinates of the points, than for a closer point since the measurement errors will
relative to the reference point taken at the start of the process). increase in proportion to the distance (Fig. 5). Another aspect
Once the algorithm is applied on raw data a set of points (x, y) that is checked during this step is the distance between
will be obtained. consecutive points because, if the distance exceeds a
threshold, the space between the points will be considered
unexplored area, therefore the presumption that there is a wall
may or may not be a valid one.
After all points are consumed in the first step, a new round
of analysis will be performed. This time the straight lines
obtained will be compressed. Using mathematical formulas,
consecutive lines will be checked if they can be considered
parallel or perpendicular. If possible, the lines will be merged,
Fig. 7. Data processing algorithm in this way the number of lines will be reduced. This check is
performed twice, using knowledge acquired during testing,
In Fig. 7 a representation of this algorithm is shown. As applying line compression twice is enough and the results are
seen, information provided by the robot is formatted as satisfactory.
presented above so the PC can understand and analyse the
incoming data. The text data received is presented in a After applying the data processing algorithm, a map of the
graphical way, each measurement done being drawn as a line room will be obtained. If there will be some unexplored areas
from the origin (marked with X). Next, from each found, it is sure that the outline is not complete. These
measurement, a point (x, y) is extracted. In the end, a set of unexplored areas are saved and will be analysed by the
points relative to the origin can be observed. optimal route determination algorithm. Since the point of the
project was to perform as few measurements as possible, this
Once the points are extracted, a lines compute algorithm is algorithm is a very important one.
applied. The purpose of this algorithm is to take all the points
extracted at the previous step and compress them into lines. A This algorithm takes the available information about an
contour made of polystyrene (Fig. 4) was used for test undiscovered space and computes a route towards the centre
purposes and will serve as the real-world reference to the next of that space (Fig. 9). The size of the robot was measured, and
examples. it is taken into consideration by the algorithm. First, a straight
line is considered an optimal route, then checks are performed
In Fig. 8, a representation of the effects of this algorithm so the robot will not hit the walls and adjustments to the route
on the existing points is presented. The irregular shape of the are done.
contour is due to the measuring accuracy of the sensor (shown
in Fig. 5).
692
The algorithm output is a series of commands that will be Fig. 11. Measurement error due to faulty movement
transmitted to the robot in order to reach the destination. An
example of the output can be: l47 (left 47°), f29 (forward 29 Therefore, the algorithm, takes common parts, and
cm), r75 (right 75°), f20 (forward 20 cm), etc. Once the searches for a match. A match between the two maps means
destination point was reached, a new data acquisition will be that consecutive lines with the same characteristics can be
performed, and previously presented algorithms will be found in both sets of data. After this match is achieved the
applied. required rotation and translation is computed and applied (Fig.
12).
The movement of the mobile platform inside the room is a
key aspect and an error generating source since inertia and
sideslip can’t be controlled and (using only encoders)
sometimes can’t be detected by the application that is running
on the microcontroller.
Since the motor is equipped with an encoder, the
equivalence between the data received from the encoder and Fig. 12. Movement error compensation algorithm
the centimetres moved in the real-world was determined
experimentally. Using the interrupt system of the Raspberry D. Cloud aspects
Pi 3, the direction and the number of pulses received were The acquired data should be available anytime and
determined and stored. Doing several measurements, the anywhere, therefore, Azure Portal was used as a solution to
graph presented in Fig. 10 was obtained and based on this data, this problem. A simple database was created and stored in
one centimetre is the equivalent of 253 pulses received from Cloud, the structure of the tables is presented in Fig. 13.
the encoder. This remark is based also on the linearity of the
obtained graph.
Note that this is valid only for straight moving, for the
rotation movement the whole process was redone, and new
values were found. Also, what should be highlighted is that,
for this type of movement, the number of pulses received from
the left encoder differs from the right one. Therefore, the
encoder that is situated to the interior of the movement records
less pulses than the one that is on the output (55 pulses versus Fig. 13. Database structure
62 pulses).
The structure of the database was kept as simple as
possible. The table RegisterCode is used to register new
clients using a unique activation code. The User table is
designed to help the log in process, as can be seen, some
security measures like using a salt were applied. Each
registered user can have access to its own outlines that are
saved in the Contour table. Here information like the name of
the map or the date are stored, also, the required information
for the drawing process is stored. In order to optimize the data
storage, only representative points are stored (E.g. if the
outline is a square, only four points, the corners, are required
to be stored).
Fig. 10. Experimental determination of encoder behaviour while moving in All the information is handled safely using an API that is
straight line also published in Cloud. Using this solution, the information
required by the PC or smartphone application is available
Using the hardware capabilities of the platform, through internet.
concerning the movement, not all errors were removed,
therefore the existing errors were compensated by an E. Smartphone application
algorithm. The smartphone application has the purpose to offer access
The movement errors compensation algorithm is designed to previously done maps. If can be used to analyse different
to solve the distance measurement errors that are due to faulty aspects of the map such as perimeter or area, also the length
movement of the robotic platform. An example of the existing of the lines is shown. The application was designed using
errors is presented in Fig. 11. It is visible that the second map Xamarin technology and is only available for Android
is rotated and a simple overlap of the two maps will not be operating system (tested for Android 6.0 or above).
enough to obtain a precise result. Also, the compression III. RESULTS
algorithms already presented will be affected by this set of
points. In this chapter the results achieved will be presented and
discussed. All the tests were done in laboratory conditions.
The experimental platform components for this project is
presented in Fig. 4.
There are several scenarios that were created in order to
test and highlight the algorithms used. Real world contours
693
were used as can be seen in Fig. 4. The rooms used for testing imperfect movement or distance measurement and the
are empty (there are no chairs, tables or any other obstacles) compensation that is done can be observed.
since the purpose of the paper is to achieve an outline of the
room. These test scenarios and the results achieved, emphasize
the strengths of the paper such as the fact that the outlines were
The first scenario consists in a simple room which has the achieved in a fully automated way, by performing as least as
shape of a square (Fig. 14a). In this case the mapping was done possible data acquisitions. Also, the principles and algorithms
in a single step and no movement was required. can be taken into consideration in this type of applications,
especially when low-cost and errors generator hardware is
The second scenario consists in measuring a L-shaped involved, assuring the fact that better results will be obtained.
room (in Fig. 4 can be seen the real word scenario and in Fig.
14b are presented the results), in this case, the robot is required The PC application provides an interface through which,
to move once in order to map the whole room. After the first the user can visualize and analyse recorded and stored data
measurement is done, the best point for the next data (Fig. 15). The maps can be visualized in a graphical way and
acquisition is computed (Fig.14b END point). Next, the route downloaded using the PC application.
towards the next point is computed, as can be seen, the shortest
route from A to B is a straight line, the size of the robot is also
taken into consideration, therefore some deviations were
required. When the robot reaches the desired point, data
acquisition is performed. As can be seen in Fig. 14b (on the
right side), the acquired contours can’t be fused immediately
due to movement errors. The compensation algorithm is used
in order to make sure that the output is not affected by these
uncontrolled errors.
For the third scenario a U-shaped (Fig.14c) perimeter was
used, this time the robot had to move twice. The same
principles emphasized in the previous scenario are applied.
The only difference is that, for this outline, there will be found Fig. 15. Data visualisation – PC interface
two undiscovered areas, hence there will be computed two end
points. The robotic platform will move to each end point and The contours data can be accessed by smartphone using
acquire necessary data in order to close the outline. the Android application (Fig. 16). Several information is
available like area, perimeter, the width and height of the
contour (measurement unit is cm, cm2). The user can explore
the map since zoom in or zoom out is supported.
694
the automation engineering area and not only. Also, the Proceedings of the 2018 International Conference on Robotics,
hardware capabilities were exploited in order to achieve a Control and Automation Engineering, Pages 102-106, New York, NY,
USA 2018, ACM. ISBN: 978-1-4503-6102-6
stable and efficient product and where the hardware
[4] Robot cartography: ROS + SLAM, http://www.pirobot.org/blog/0015/
limitations consisted an issue, software was used to (accessed 26.01.2019)
compensate. [5] W. Wang, K. Yamakawa, K. Hiroi, K. Kaji and N. Kawaguchi. A
The presented project can be improved on different levels, Mobile System for 3D Indoor Mapping Using LiDAR and Panoramic
Camera. In Adjunct Proceedings of the 2015 ACM International Joint
starting with the hardware parts. The movement of the robotic Conference on Pervasive and Ubiquitous Computing and Proceedings
platform was a major error generator, therefore adding more of the 2015 ACM International Symposium on Wearable Computers,
sensors like a gyroscope and an accelerometer can provide Pages 337-340, New York, NY, USA 2015. ACM. ISBN: 978-1-4503-
more information about the movement. Also, the Scanse 3575-1
Sweep sensor can be replaced with Scanse Sweep 3D, which [6] S. Pradhan, G. Baig, W. Mao, L. Qiu, G. Chen and B. Yang.
is capable to measure on three axes. Besides reducing the Smartphone-based Acoustic Indoor Space Mapping. In Proceedings of
the ACM on Interactive, Mobile, Wearable and Ubiquitous
movements error by improving the hardware and using a 3D Technologies, Volume 2 Issue 2, June 2018, Article No. 75, New York,
measurement sensor, the software can be improved too. NY, USA 2018. ACM. EISSN: 2474-9567.
Different features can be added like editing the graphs in order [7] G. Pintore, F. Ganovelli, E. Gobbetti and R. Scopigno. Mobile
to correct minor errors or removing different objects like a reconstruction and exploration of indoor structures exploiting
wardrobe or a bed from the map. The functionalities that are omnidirectional images. In Proceeding SA '16 SIGGRAPH ASIA 2016
implemented on the PC can also be ported on the smartphone Mobile Graphics and Interactive Applications, Article No. 1, New
York, NY, USA 2016. ACM. ISBN: 978-1-4503-4551-4
application, in this way the portability of the whole system
[8] TIMMS, https://www.applanix.com/products/timms-indoor-
will increase. mapping.htm (accessed 26.01.2019)
The used algorithm can also be improved in order to [9] NAVVIS M6, https://www.navvis.com/m6 (accessed 31.03.2019)
achieve better performances and to extend the area that can be [10] IMS-5, https://goiguide.com/ims-5-specs (accessed 31.03.2019)
mapped from a single room to a whole floor. [11] P. Biber, S. Fleck, F. Busch, M. Wand, T. Duckett and W. Strasser. 3D
Modelling of Indoor Environments by a Mobile Robot with a Laser
The merit of the project consists in the fact that a large Scanner and Panoramic Camera. In IEEE/RSJ International
variety of knowledge from different domains was used and Conference on Intelligent Robots and Systems (IROS). 4. 3430 - 3435
combined in order to achieve a working product. The tests vol.4. 10.1109/IROS.2004.1389947.
done prove the value and the applicability of the [12] W. Lang, F. Bertsch, D. J. DeWitt and N. Ellis. Microsoft azure SQL
database telemetry. In Proceedings of the Sixth ACM Symposium on
ideas, algorithms and principles implemented in the paper are Cloud Computing, Pages 189-194, New York, NY, USA 2015. ACM.
useful for those who develop building mapping systems, but ISBN: 978-1-4503-3651-2
also in didactic activities. [13] Devastator Tank Mobile Robot Platform,
https://www.dfrobot.com/product-1219.html (accessed 26.01.2019)
REFERENCES [14] Metal DC Geared Motor w/Encoder - 6V 100RPM 6.5Kg.cm,
[1] J. M. Parulian, K. M. Adhinugraha, S. Alamri. Indoor Navigation https://www.dfrobot.com/product-1618.html (accessed 26.01.2019)
Guidance for Mobile Device. In Proceedings of the 20th International [15] 2x7A DC Motor Driver, http://playwithrobots.com/dc-motor-driver-
Conference on Information Integration and Web-based Applications & circuits/ (accessed 26.01.2019)
Services, Pages 345-349, New York, NY, USA 2018, ACM. ISBN:
978-1-4503-6479-9 [16] 6x2 LCD Brick, https://www.robofun.ro/lcd/16-2-LCD-brick-pentru-
raspberry-pi (accessed 26.01.2019)
[2] Low-cost, LIDAR-based navigation for mobile robotics,
https://www.roboticstomorrow.com/article/2015/11/low- cost-lidar- [17] Raspberry Pi 3, https://www.raspberrypi.org/ (accessed 26.01.2019)
based-navigation-for-mobile-robotics/7270 (accessed 26.01.2019) [18] Scanse Sweep sensor,
[3] H. Hong, B. Lee. Map Registration of Lidar-based 2D NDT Map and https://s3.amazonaws.com/scanse/Sweep_user_manual.pdf (accessed
Vision-based 3D NDT Map with Known Initial Robot Poses. In 26.01.2019)
695