Geometry is ubiquitous in robotics. We need it to describe robot’s pose, plan its trajectory, model the environment it is operating in and all of these tasks require a good way of handling rigid transformations, shape representations, data approximations and object registration. While rigid motions are well explored, with rich theory  and coverage in most robotic libraries [2, 3, 4], the shape representation and approximation is mostly treated either in the perspective of computer graphics , regression analysis  or probabilistic robotics . There is nothing bad with either of these approaches, because robotics needs all of them, but there is mostly no simple transition between these views of the same thing  and this was the primary motivation of our research in the field geometric data processing. Computational efficiency was also in the centre of attention, because direct implementation of mathematical formulas often does not lead to an optimal algorithm.
Robotic Template Library (RTL) development started together with our research of the fast vectorization algorithms and is therefore a repository of code we used to illustrate our results in research papers. It is a known fact, that reproducibility of research in robotics is an issue [9, 10] and we would like to help the initiative to fix it. These algorithms are also what make RTL truly unique among other similar projects. RTL provides an implementation of the fast total least squares (FTLS) vectorization  of the ordered point clouds – an optimized algorithm for approximation of ordered data, which provides computational performance similar to the point-eliminating methods , while preserving all the benefits of the TLS regression. An augmentation of the previous approach  for optimization of global error is present in RTL as well.
Robotics is a rapidly evolving domain aggregating a large range of scientific and technical disciplines in the pursuit of autonomous – maybe even intelligent – machines. And indeed, this implies there are already many software libraries for general robotics as well as point cloud processing, linear algebra, computer vision and dozens of other tasks. Why yet another library? The reason stems from the purpose of current state of the art libraries in the field. There are large, well established projects overlapping with RTL, e.g the Robot Operating System , the Point-Cloud Library  and the Mobile Robot Programming Toolkit , but these are more focused on mature methods and algorithms for practical problem solving and tend to be too “high-level” for development of new methods we are interested in. For this reason, we have adopted the mathematical library Eigen  as a base for our research and built on top of it a standalone project, which is easy to adapt and experiment with. As such, RTL classifies as a small, geometry focused library for evaluation of our research and simple integration into other projects.
The content of the library is sorted into several modules according to the functionality they provide. Let us first review the content provided and discuss the technical details later. The modules of the Robotic Template Library are as follows:
The downloadable content of the RTL package also contains two sections with no additional functionality, but still important for the library:
The Robotic template library is designed to be highly efficient in computational tasks. This is achieved using the Eigen  library as a back-end since it provides a very optimized code for general algebra and much more. Usage of templates and static polymorphism saves processing power on run-time and allows stricter type checking during compilation. Default constructors perform no initialization and functions usually do not check validity of their arguments, moving the responsibility on user’s side. Such behaviour is thoroughly documented and allows to omit redundant checks, when the data are guaranteed to be valid by other means. Of course, higher-level code comes with lower emphasis on performance subtleties. Transformation management structures are a good example of a balanced approach to ease of use and performance, because highly optimized transformations are expected to be applied millions of times per second, while modifications of the tree are much less frequent and thus allow some more computational costs. Separate case are the LaTeX output classes, where only the most significant optimizations were carried out, since the bottle necks of this output are outside the RTL.
As any other larger project, RTL also maintains coherent structure over its modules, unified code style and naming convention. This is especially useful in combination with the template nature of the library and allows to create a very general code through meta-programming techniques. To aid programmers with such applications, we provide type traits compatible with those from C++ STL. Table 1 summarizes available traits and also shows a portion of RTL in a new perspective of common features and mutual relationships.
RTL is distributed with a set of tests, which are used to ensure its proper functionality and can be used as a control mechanism, if the user makes some changes within the library. The tests are separated to focus only on a small portion of the code resembling the principles of unit testing. Some more advanced features of the library expect the more basic parts to be functional, e.g. it is recommended to run the test on vector algebra before the point cloud processing one. According to CLion integrated development environment, the code coverage of the tests is greater than 95 percent.
A feedback on proper function of user’s code appears in two ways. In case of unit tests, no output means no errors, otherwise a human readable description of what happened is provided. In case of general programming, compile time assertions are verbose as well and run-time behavior should simply correspond to the specification in the documentation available on-line.
Any operating system capable of compiling and running C++17 code. (Ubuntu 20.04 is tested)
C++17 is mandatory for use of the library. (tested with CMake 3.15 and GCC 10.0)
There are no special requirements. RTL is provided as a header-only library.
The Eigen library  (v3.3.9 is tested) and the Standard Template Library (STL) of the C++ language are mandatory. To compile the library tests, GTest is needed as well, however the library itself works without it (v1.10.0 is tested).
Persistent identifier: https://github.com/Robotics-BUT/Robotic-Template-Library
Publisher: Brno University of Technology
Version published: commit: 5161de846cef2fb253c364c9f14ab80b48153c46
Date published: 05.10.2020
RTL has several modules for different purposes, which all meet in robotic applications. It can be used to build more advanced algorithms such as motion planing, scene interpretation, data fusion, feature extraction, localization, mapping and others, because it contains the base tools for dealing with geometry in space and for processing of point clouds. It is worthy both for development (due to generation of visualizations using the LaTeX export module) as well as for production (because the code is highly optimised).
However there is no restriction on using only a portion of the library for solving a specific task from a different field. Geometry is extensively used in computer graphics, physical modelling or even game development. The point cloud processing can find its usage in 3D scanning applications, signal processing and computer vision. LaTeX export is useful in all applications, where vector graphics needs to be generated directly from a program. Especially if the Eigen library is used for computation, RTL can be employed as a graphics output back-end.
Since RTL contains implementation of separately published algorithms, it can also be used in comparative studies, surveys and benchmarks for independent comparison of our work with results of other researchers.
RTL is published with all source codes available under the MIT licence, which makes it freely modifiable to any degree desired. The library is written with modularity and extensibility in mind so adding new features is possible and even encouraged. The code is hosted on GitHub, where all the feedback, bug reports and issue tracking should take place. We do not provide any official support for users of RTL, but we are open to discussion on features and grateful for bug reports, since quality and reliability of the library is our important goal.
A large portion of work on the Robotic Template Library was carried out on Brno University of Technology, Faculty of Electrical Engineering and Communication, Department of Control and Automation as a part of the PhD. training of the authors. We are grateful for its supportive environment which makes free development of new ideas possible.
The completion of this paper was made possible by the grant No. FEKT-S-20-6205 – “Research in Automation, Cybernetics and Artificial Intelligence within Industry 4.0” financially supported by the Internal science fund of Brno University of Technology.
The authors have no competing interests to declare.
Stanford Artificial Intelligence Laboratory, et al. Robotic operating system. [Online]. Available: https://www.ros.org.
Rusu RB, Cousins S. 3D is here: Point Cloud Library (PCL). In: IEEE International Conference on Robotics and Automation (ICRA), Shanghai, China, May 9–13, 2011. DOI: https://doi.org/10.1109/ICRA.2011.5980567
Claraco, J-LB. Mobile robot programming toolkit. [Online]. Available: https://www.mrpt.org.
Bellocchio F, Borghese NA, Ferrari S, Piuri V. Reconstruction. 3D Surface Reconstruction. New York, NY: Springer New York; 2013. [Online]. Available: http://link.springer.com/10.1007/978-1-4614-5632-2. DOI: https://doi.org/10.1007/978-1-4614-5632-2
Cadena C, Carlone L, Carrillo H, Latif Y, Scaramuzza D, Neira J, Reid I, Leonard JJ. Past, Present, and Future of Simultaneous Localization and Mapping: Toward the Robust-Perception Age. IEEE Transactions on Robotics. dec 2016; 32(6): 1309–1332. [Online]. Available: http://ieeexplore.ieee.org/document/7747236/. DOI: https://doi.org/10.1109/TRO.2016.2624754
Bonsignorio F. A New Kind of Article for Reproducible Research in Intelligent Robotics [From the Field]. IEEE Robotics & Automation Magazine. Sep 2017; 24(3): 178–182. [Online]. Available: http://ieeexplore.ieee.org/document/8036322/. DOI: https://doi.org/10.1109/MRA.2017.2722918
Robotics and the art of science. Nature Machine Intelligence. Jun 2019; 1(6): 259–259. [Online]. Available: http://www.nature.com/articles/s42256-019-0066-8. DOI: https://doi.org/10.1038/s42256-019-0066-8
Jelinek A, Zalud L, Jilek T. Fast total least squares vectorization. Journal of Real-Time Image Processing. apr 2019; 16(2): 459–475. [Online]. Available: http://link.springer.com/10.1007/s11554-016-0562-6. DOI: https://doi.org/10.1007/s11554-016-0562-6
Shi W, Cheung C. Performance Evaluation of Line Simpli_cation Algorithms for Vector Generalization. The Cartographic Journal. Mar 2006; 43(1): 27–44. DOI: https://doi.org/10.1179/000870406X93490
Jelinek A, Zalud L. Augmented Postprocessing of the FTLS Vectorization Algorithm – Approaching to the Globally Optimal Vectorization of the Sorted Point Clouds. In: Proceedings of the 13th International Conference on Informatics in Control, Automation and Robotics. SCITEPRESS – Science and and Technology Publications. 2016; 216–223. [Online]. Available: http://www.scitepress.org/DigitalLibrary/Link.aspx?doi=10.5220/0005962902160223. DOI: https://doi.org/10.5220/0005962902160223
Guennebaud G, Jacob B, et al. Eigen v3. http://eigen.tuxfamily.org, 2010.
Jelinek A, Ligocki A. On registration of vector maps with known correspondences. Advances in Electrical and Electronic Engineering. 09 2019; 17: 330–342. DOI: https://doi.org/10.15598/aeee.v17i3.3451
Jelinek A, Ligocki A. Lines to planes registration. In: Proceedings of the 16th International Conference on Informatics in Control, Automation and Robotics – Volume 1: ICINCO, INSTICC. SciTePress. >2019; 625–632. DOI: https://doi.org/10.5220/0007834906250632
Nguyen V, Gächter S, Martinelli A, Tomatis N, Siegwart R. A comparison of line extraction algorithms using 2D range data for indoor mobile robotics. Autonomous Robots. Jun 2007; 23(2): 97–111. DOI: https://doi.org/10.1007/s10514-007-9034-y
Douglas DH, Peucker TK. Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or its Caricature. Cartographica: The International Journal for Geographic Information and Geovisualization. Oct 1973; 10(2): 112–122. DOI: https://doi.org/10.3138/FM57-6770-U75U-7727