scieee AI-readable full text Open interactive document viewer

Repositorio Institucional de Documentos

Abstract

La idea de equipos de robots actuando con autonomía y de manera cooperativa está cada día más cerca de convertirse en realidad. Los sistemas multi robot pueden ejecutar tareas de gran complejidad con mayor robustez y en menos tiempo que un robot trabajando solo. Por otra parte, la coordinación de un equipo de robots introduce complicaciones que los ingenieros encargados de diseñar estos sistemas deben afrontar. Conseguir que la percepción del entorno sea consistente en todos los robots es uno de los aspectos más importantes requeridos en cualquier tarea cooperativa, lo que implica que las observaciones de cada robot del equipo deben ser transmitidas a todos los otros miembros. Cuando dos o más robots poseen información común del entorno, el equipo debe alcanzar un consenso usando toda la información disponible. Esto se debe hacer considerando las limitaciones de cada robot, teniendo en cuenta que no todos los robots se pueden comunicar unos con otros. Con este objetivo, se aborda la tarea de diseñar algoritmos distribuidos que consigan que un equipo de robots llegue a un consenso acerca de la información percibida por todos los miembros. Específicamente, nos centramos en resolver este problema cuando los robots usan la visión como sensor para percibir el entorno. Las cámaras convencionales son muy útiles a la hora de ejecutar tareas como la navegación y la construcción de mapas, esenciales en el ámbito de la robótica, gracias a la gran cantidad de información que contiene cada imagen. Sin embargo, el uso de estos sensores en un marco distribuido introduce una gran cantidad de complicaciones adicionales que deben ser abordadas si se quiere cumplir el objetivo propuesto. En esta Tesis presentamos un estudio profundo de los algoritmos distribuidos de consenso y cómo estos pueden ser usados por un equipo de robots equipados con cámaras convencionales, resolviendo los aspectos más importantes relacionados con el uso de estos sensores. En la primera parte de la Tesis nos centramos en encontrar correspondencias globales entre las observaciones de todos los robots. De esta manera, los robots son capaces de detectar que observaciones deben ser combinadas para el cálculo del consenso. También lidiamos con el problema de la robustez y la detección distribuida de espurios durante el cálculo del consenso. Para contrarrestar el incremento del tamaño de los mensajes intercambiados por los robots en las etapas anteriores, usamos las propiedades de los polinomios de Chebyshev, reduciendo el número de iteraciones que se requieren para alcanzar el consenso. En la segunda parte de la Tesis, centramos nuestra atención en los problemas de crear un mapa y controlar el movimiento del equipo de robots. Presentamos soluciones para alcanzar un consenso en estos escenarios mediante el uso de técnicas de visión por computador ampliamente conocidas. El uso de algoritmos de estructura y movimiento nos permite obviar restricciones tales como que los robots tengan que observarse unos a otros directamente durante el control o la necesidad de especificar un marco de referencia común. Adicionalmente, nuestros algoritmos tienen un comportamiento robusto cuando la calibración de las cámaras no se conoce. Finalmente, la evaluación de las propuestas se realiza utilizando un data set de un entorno urbano y robots reales con restricciones de movimiento no holónomas. Todos los algoritmos que se presentan en esta Tesis han sido diseñados para ser ejecutados de manera distribuida. En la Tesis demostramos de manera teórica las principales propiedades de los algoritmos que se proponen y evaluamos la calidad de los mismos con datos simulados e imágenes reales. En resumen, las principales contribuciones de esta Tesis son: • Un conjunto de algoritmos distribuidos que permiten a un equipo de robots equipados con cámaras convencionales alcanzar un consenso acerca de la información que perciben. En particular, proponemos tres algoritmos distribuidos con el objetivo de resolver los problemas de encontrar correspondencias globales entre la información de todos los robots, detectar y descartar información espuria, y reducir el número de veces que los robots tienen que comunicarse entre ellos antes de alcanzar el consenso. • La combinación de técnicas de consenso distribuido y estructura y movimiento en tareas de control y percepción. Se ha diseñado un algoritmo para construir un mapa topológico de manera cooperativa usando planos como características del mapa y restricciones de homografía como elementos para relacionar las observaciones de los robots. También se ha propuesto una ley de control distribuida utilizando la geometría epipolar con el objetivo de hacer que el equipo de robots alcance una orientación común sin la necesidad de observarse directamente unos a otros. Montijano Muñoz, Eduardo; Sagüés Blázquiz, Carlos

Full text

2012 42 Eduardo Montijano Muñoz Distributed consensus in multi-robot systems with visual perception Departamento Director/es Informática e Ingeniería de Sistemas Sagüés Blázquiz, Carlos Director/es Tesis Doctoral Autor Repositorio de la Universidad de Zaragoza – Zaguan http://zaguan.unizar.es UNIVERSIDAD DE ZARAGOZA Departamento Director/es Eduardo Montijano Muñoz DISTRIBUTED CONSENSUS IN MULTI-ROBOT SYSTEMS WITH VISUAL PERCEPTION Director/es Informática e Ingeniería de Sistemas Sagüés Blázquiz, Carlos Tesis Doctoral Autor 2012 Repositorio de la Universidad de Zaragoza – Zaguan http://zaguan.unizar.es UNIVERSIDAD DE ZARAGOZA Departamento Director/es Director/es Tesis Doctoral Autor Repositorio de la Universidad de Zaragoza – Zaguan http://zaguan.unizar.es UNIVERSIDAD DE ZARAGOZA PhD Thesis DISTRIBUTED CONSENSUS IN MULTI-ROBOT SYSTEMS WITH VISUAL PERCEPTION Eduardo Montijano Muñoz Director: Carlos Sagüés Blázquiz Departamento de Informática e Ingeniería de Sistemas Escuela de Ingeniería y Arquitectura Universidad de Zaragoza 2 Acknowledgments This Thesis represents the end of the hard work done during several years. It wouldn’t be fair if I didn’t spend at least one page thanking all the people that have contributed somehow in its development. Firstly, I would like to thank Carlos for advising me. I’m aware that I’m not an easy person to work with and yet he has been there the whole time supporting and helping me with everything. I hope this Thesis is not the end of our work together, it is a pleasure to work with you and I believe we still have many things to say together. This work has been done in collaboration with several people that deserve all my gratitude. Rosario Aragüés and Juan I. Montijano from the University of Zaragoza, Sonia Martínez from the University of California San Diego and Xiaoming Hu and Johan Thunberg from the Royal Institute of Technology in Stockholm. I also had the chance to spend some time in U.C. Berkeley, thanks to Mac Schwager and Claire Tomlin. Ana Cris Murillo provided insightful comments regarding Chapter 6 and without the help of Luis Riazuelo and Danilo Tardioli, the real experiments in Chapter 7 wouldn’t have been possible. Finally, thanks to Davinia Vera for all her work and for standing me as her advisor in her PFC. Family has been a constant source of support during these years. I cannot count the times that my parents, Juan and Teresa, have helped me with crazy last minute stuff. They have seen the best and the worst of me, and they still love me with all their heart. The whole Montijanada, always caring for me. I would also like to mention Pedro and Martha, the political family that anybody would like to have. Friends have played an important role in the Thesis as well, keeping me sane and taking me out to party when I needed it the most. The list of people that I should mention here is sooooooooo long that I’m going to... mention everybody, because all of them deserve it! Starting with “los Orcos”, Gordo, Gollum, Huevo, Chorizo and Carachochi, always destroying the Lair. Miguel and Natalia (friki-fotos), the Mata’s family (Quenopoo) and Elena and Raúl, for all the amazing moments we’ve spent together. Javier and Juan Luis, visiting me all over the globe. The Bohemians, always losing at trivia, and Alex, bitting the dusk playing Soul Calibur. Rosario, Ana and Darío, for all the adventures we lived in California and all the Diisasters, conference mode and coffee breaks are not the same without all of you! Nikos (always fighting with the monsters), Marco (german Bro!), Andrew and all the awesome friends I met while I was in San Diego. Corentin, Enrico and Johan, the three Swedish musketeers. Mac, Simone, Pan, Pg, Ryo and Mike, next time we will eat 100$ bucks in sushi each! Lastly, I would like to specially thank the most amazing person I’ve ever met. Without her, this Thesis could have not been possible and she deserves as much credit about it as me. I’m talking about Inés, my girlfriend, who has been there all the time, cheering me up in the dark moments and celebrating with me the good ones. I love you ♥. 3 4 Resumen La idea de equipos de robots actuando con autonomía y de manera cooperativa está cada día más cerca de convertirse en realidad. Los sistemas multi robot pueden ejecutar tareas de gran complejidad con mayor robustez y en menos tiempo que un robot trabajando solo. Por otra parte, la coordinación de un equipo de robots introduce complicaciones que los ingenieros encargados de diseñar estos sistemas deben afrontar. Conseguir que la percepción del entorno sea consistente en todos los robots es uno de los aspectos más importantes requeridos en cualquier tarea cooperativa, lo que implica que las observaciones de cada robot del equipo deben ser transmitidas a todos los otros miembros. Cuando dos o más robots poseen información común del entorno, el equipo debe alcanzar un consenso usando toda la información disponible. Esto se debe hacer considerando las limitaciones de cada robot, teniendo en cuenta que no todos los robots se pueden comunicar unos con otros. Con este objetivo, se aborda la tarea de diseñar algoritmos distribuidos que consigan que un equipo de robots llegue a un consenso acerca de la información percibida por todos los miembros. Específicamente, nos centramos en resolver este problema cuando los robots usan la visión como sensor para percibir el entorno. Las cámaras convencionales son muy útiles a la hora de ejecutar tareas como la navegación y la construcción de mapas, esenciales en el ámbito de la robótica, gracias a la gran cantidad de información que contiene cada imagen. Sin embargo, el uso de estos sensores en un marco distribuido introduce una gran cantidad de complicaciones adicionales que deben ser abordadas si se quiere cumplir el objetivo propuesto. En esta Tesis presentamos un estudio profundo de los algoritmos distribuidos de consenso y cómo estos pueden ser usados por un equipo de robots equipados con cámaras convencionales, resolviendo los aspectos más importantes relacionados con el uso de estos sensores. En la primera parte de la Tesis nos centramos en encontrar correspondencias globales entre las observaciones de todos los robots. De esta manera, los robots son capaces de detectar que observaciones deben ser combinadas para el cálculo del consenso. También lidiamos con el problema de la robustez y la detección distribuida de espurios durante el cálculo del consenso. Para contrarrestar el incremento del tamaño de los mensajes intercambiados por los robots en las etapas anteriores, usamos las propiedades de los polinomios de Chebyshev, reduciendo el número de iteraciones que se requieren para alcanzar el consenso. En la segunda parte de la Tesis, centramos nuestra atención en los problemas de crear un mapa y controlar el movimiento del equipo de robots. Presentamos soluciones para alcanzar un consenso en estos escenarios mediante el uso de técnicas de visión por computador ampliamente conocidas. El uso de algoritmos de estructura y movimiento nos permite obviar restricciones tales como que los robots tengan que observarse unos a otros directamente durante el control o la necesidad de especificar un marco de referencia común. Adicionalmente, nuestros algoritmos tienen un comportamiento robusto cuando la calibración de las cámaras no se conoce. Finalmente, la evaluación de las propuestas se realiza utilizando un data set de un entorno urbano y robots reales con restricciones de movimiento no holónomas. Todos los algoritmos que se presentan en esta Tesis han sido diseñados para ser ejecutados de manera distribuida. En la Tesis demostramos de manera teórica las principales propiedades de los algoritmos que se proponen y evaluamos la calidad de los mismos con datos simulados e imágenes reales. En resumen, las principales contribuciones de esta Tesis son: 5 6 • Un conjunto de algoritmos distribuidos que permiten a un equipo de robots equipados con cámaras convencionales alcanzar un consenso acerca de la información que perciben. En particular, proponemos tres algoritmos distribuidos con el objetivo de resolver los problemas de encontrar correspondencias globales entre la información de todos los robots, detectar y descartar información espuria, y reducir el número de veces que los robots tienen que comunicarse entre ellos antes de alcanzar el consenso. • La combinación de técnicas de consenso distribuido y estructura y movimiento en tareas de control y percepción. Se ha diseñado un algoritmo para construir un mapa topológico de manera cooperativa usando planos como características del mapa y restricciones de homografía como elementos para relacionar las observaciones de los robots. También se ha propuesto una ley de control distribuida utilizando la geometría epipolar con el objetivo de hacer que el equipo de robots alcance una orientación común sin la necesidad de observarse directamente unos a otros. List of Figures 1.1 Individual robots performing different tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.2 Brigade of firemen acting cooperatively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.3 Teamofrobots .......................................... 22 1.4 Centralized versus Distributed Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.5 Emergent behavior in groups of animals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6 Group of aeroplanes moving in the same direction . . . . . . . . . . . . . . . . . . . . . . . . 24 2.1 Singlerobot............................................ 31 2.2 SensorFusionexample...................................... 36 2.3 Rendezvousexample ....................................... 37 2.4 Flockingexample......................................... 37 3.1 Multiple features observed in the same image . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.2 Example of one inconsistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.3 Different association graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.4 Example of propagation and detection of inconsistencies . . . . . . . . . . . . . . . . . . . . 46 3.5 Example of resolution of one inconsistency with the different algorithms . . . . . . . . . . . . 51 3.6 Example with the steps of the Maximum Error Cut algorithm.................. 52 3.7 Decision about which edges should be deleted to solve the inconsistency. . . . . . . . . . . . 52 3.8 Number of matches against number of features . . . . . . . . . . . . . . . . . . . . . . . . . 53 3.9 Number of matches against number of robots . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.10 Number of matches varying the network density . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.11 Performance of different matching functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.12 Quality of the Maximum Error Cut with different errors . . . . . . . . . . . . . . . . . . . . . 55 3.13Percentageoflinksdeleted .................................... 55 3.14 Inconsistency found in the formation control problem . . . . . . . . . . . . . . . . . . . . . . 56 3.15 Formations used in the experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 3.16 Experiment of data association using homography constraints . . . . . . . . . . . . . . . . . . 57 3.17 Matching faces across images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 3.18 Inconsistency matching faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 3.19 Images used to compute the SLAM maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 3.20 Local maps acquired by each robot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.21 Communication graphs between the robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 4.1 Example of spurious data in the consensus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.2 Sensor network deployed in the environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.3 Finite-time consensus about the number of active sensors . . . . . . . . . . . . . . . . . . . . 77 4.4 Consensus in the different steps of De-RANSAC ......................... 78 13 14 4.5 Initial People Association in Camera Networks . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.6 Robust People Association in Camera Networks . . . . . . . . . . . . . . . . . . . . . . . . . 80 4.7 Communication network of the ten robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 4.8 Uncertain observations of the ten robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.9 Evolution of the maximum likelihood using dynamic voting . . . . . . . . . . . . . . . . . . 81 4.10 Evolution of the number of votes using dynamic voting . . . . . . . . . . . . . . . . . . . . . 82 5.1 Divergence of the minimal polynomial for a network with 35 nodes . . . . . . . . . . . . . . 91 5.2 Plot of different polynomials in the interval (-1,1) . . . . . . . . . . . . . . . . . . . . . . . . 95 5.3 Ellipse where all the eigenvalues must be contained in order to achieve the consensus . . . . . 96 5.4 Convergence speed of different algorithms with a switching communication topology. . . . . . 106 5.5 Adaptive consensus with parameter estimation . . . . . . . . . . . . . . . . . . . . . . . . . . 109 5.6 Estimation of the algebraic connectivity under a switching communication network . . . . . . 110 6.1 Scheme of the plane segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 6.2 Map of Zaragoza (Downtown data set) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 6.3 Planar regions extracted from the House data set . . . . . . . . . . . . . . . . . . . . . . . . . 129 6.4 Planar region extracted from one sequence of the Downtown data set . . . . . . . . . . . . . . 130 6.5 Another planar region extracted from one sequence of the Downtown data set . . . . . . . . . 131 6.6 Example of a planar region viewed in three different sequences . . . . . . . . . . . . . . . . . 133 6.7 Consensus process for feature coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 6.8 Consensus process for normalized feature coordinates . . . . . . . . . . . . . . . . . . . . . . 134 7.1 Coordinate system of the robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 7.2 Epipolar constraint between pairs of robots . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 7.3 Distributed consensus using epipoles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 7.4 Control inputs and evolution of the pairs of computed epipoles . . . . . . . . . . . . . . . . . 143 7.5 Evolution of the network with switching topologies . . . . . . . . . . . . . . . . . . . . . . . 144 7.6 Images acquired in the virtual environment and matches between the SIFT descriptors . . . . . 144 7.7 Results of the simulation in the virtual environment . . . . . . . . . . . . . . . . . . . . . . . 145 7.8 Cameras equipped by the robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 7.9 Images captured by each camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 7.10 Experiment with three robots outdoors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 7.11 Experiment with three robots outdoors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 7.12Experimentindoors........................................ 148 7.13 Experiment with different cameras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 List of Tables 1 List of the most important symbols used in the Thesis . . . . . . . . . . . . . . . . . . . . . . 19 3.1 Associations for the different communication graphs . . . . . . . . . . . . . . . . . . . . . . 58 3.2 Results for the data association of stochastic maps . . . . . . . . . . . . . . . . . . . . . . . . 61 4.1 Results of the Event Localization using De-RANSAC . . . . . . . . . . . . . . . . . . . . . . 79 4.2 Comparison of the different algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 5.1 Number of iterations for different algorithms and tolerances . . . . . . . . . . . . . . . . . . . 104 5.2 Number of iterations using sub-optimal parameters . . . . . . . . . . . . . . . . . . . . . . . 105 5.3 Number of iterations with different topology changes . . . . . . . . . . . . . . . . . . . . . . 107 5.4 Results for the standard bisection method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 5.5 Results with direct estimation of λ2............................... 109 6.1 Results for the house sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 6.2 Results for the downtown Zaragoza sequences . . . . . . . . . . . . . . . . . . . . . . . . . . 132 6.3 Evolution of the global map’s size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 6.4 Amount of information transmitted (MB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 15 16 List of Algorithms 1 InconsistencyDetection...................................... 45 2Maximum Error Cut ........................................ 48 3Spanning Trees .......................................... 51 4De-RANSAC scheme ....................................... 72 5 Consensus algorithm using Chebyshev polynomials . . . . . . . . . . . . . . . . . . . . . . . 93 6 Consensus Algorithm with Adaptive Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 101 7 Singlerobottopologicalmap................................... 124 8 Augment local maps - Robot i.................................. 126 9 Data Association and Map Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 10 Choiceofacommonreference.................................. 127 17 18 List of symbols Table 1: List of the most important symbols used in the Thesis Symbol Description AAssociation matrix (Chapter 3, Equation (3.3)) CiAdjacency matrix relating the planes of robot i(Chapter 6, Section 6.2) CNumber of conflictive sets (Chapter 3, Definition 3.4.1) COne conflictive set (Chapter 3, Definition 3.4.1) c, d Parameters of the scaled Chebyshev polynomial (Chapter 5, Equation (5.7)) dij Difference between the epipoles iand j(Chapter 7, Equation (7.5)) dfDiameter of Gdis (Chapter 3, Equation (3.2)) dvDiameter of G(Chapter 2, Definition 2.2.4) E= [ers]Weighted association matrix (Chapter 3, Equation (3.10)) EEdges in the communication graph (Chapter 2, Section 2.2.2) Edis Edges in the association graph (Chapter 3, Equation 3.2) eij, eji Epipoles of the images iand j(Chapter 7, Equation (7.3)) Fdis Nodes of the association graph (Chapter 3, Section 3.2.3) fi rrth feature observed by the ith robot (Chapter 3, Section 3.2) GCommunication graph between all the robots (Chapter 2, Section 2.2.2) Gdis Association graph with limited communications (Chapter 3, Section 3.2.3) Gπ iTopological map of robot i(Chapter 6, Section 6.2) Hm k,k+1 Homography related plane min images kand k+ 1 (Chapter 6, Equation (6.1)) hOne hypothesis (Chapter 4, Equation (4.10)) h∗Hypothesis with the most votes (Chapter 4, Equation (4.11)) KCalibration matrix (Chapter 6, Section 6.2) LSet of the eigenvalues of the time-varying weight matrices (Chapter 5, Equation (5.18)) miNumber of features observed by robot i(Chapter 3, Equation 3.2) ˜miNumber of features of robot iin the conflict (Chapter 3, Definition 3.4.1) msum Total number of features (Chapter 3, Equation (3.2)) NNumber of robots (Chapter 2, Section 2.2.2) NiNeighbors of robot i(Chapter 2, Definition 2.2.2) nDegree of the polynomial and time index (Chapter 5, Equation (5.6))) PiVariable used to compute ML in a distributed manner (Chapter 2, Equation (2.14)) Prs Generic permutation matrix of rows rand s(Chapter 3, Equation (3.11)) PiSet of planes in the map of robot i(Chapter 6, Section 6.2) Pn(x)Shifted scaled Chebyshev polynomial (Chapter 5, Equation (5.7)) pin Probability of one datum of being inlier (Chapter 4, Assumption 4.3.1) Continued on next page 19 20 Table 1 – continued from previous page Symbol Description psuc Probability of success in RANSAC (Chapter 4, Assumption 4.3.1) qiVariable used to compute ML in a distributed manner (Chapter 2, Equation (2.14)) SiSet of features observed by robot i(Chapter 3, Equation 3.2) Tn(x)Chebyshev polynomial of degree nevaluated in x(Chapter 5, Section 5.2) uP iDynamic input for the dynamic voting (Chapter 4, Equation (4.25)) uq iDynamic input for the dynamic voting (Chapter 4, Equation (4.25)) uυ iDynamic input for the dynamic voting (Chapter 4, Equation (4.25)) ui(t)Dynamic input to compute the number of robots (Chapter 4, Equation (4.7)) VThe set of all robots (Chapter 2, Section 2.2.2) Vcon Set of robots that end up voting for the hypothesis (Chapter 4, Proposition 4.5.2) VhSet of robots that use their information in one hypotheses (Chapter 4, Equation (4.13)) Vin Set of robots with inlier information (Chapter 4, Section 4.4.1) Vinc Set of robots that participate in a conflict (Chapter 3, Definition 3.4.1) viith eigenvector of W(Chapter 2, Equation (2.7)) W(t)=[wij]Weight matrix at time t(Chapter 2, Equation (2.3)) wij Geodesic distance of the epipoles (only in Chapter 7, Equation (7.4)) Xij Variable to compute the powers of A(Chapter 3, Equation (3.5)) x(0) Initial conditions stacked [x1(0), . . . , xN(0)] (Chapter 2, Equation (2.3)) xe iHomogeneous coordinates (Chapter 4, Equation (4.1)) xhAverage of the observations in Vh(Chapter 4, Equation (4.13)) ¯xAverage of the initial conditions, ¯x= 1/N Pi∈V xi(0) (Chapter 2, Equation (2.6)) xi(0) Initial conditions of robot i(Chapter 2, Definition 2.3.1) xh iScale coordinate when using homogeneous coordinates (Chapter 4, Section 4.2) yi rVariable to compute the improved powers of A(Chapter 3, Algorithm 1) zrVariables used in Maximum Error Cut to break inconsistencies (Chapter 3, Algorithm 2) αFocal length of the camera (Chapter 7, Section 7.2.2) βCalibration estimation (Chapter 7, Equation (7.5)) βi(t)Vector to compute the number of robots (Chapter 4, Equation (4.4)) γiith coefficient in the base defined by the eigenvectors of W(Chapter 2, Equation (2.7)) θi(t)Maximum likelihood (ML) estimation of robot i(Chapter 4, Equation (4.20)) θML Maximum likelihood (ML) of the initial conditions (Chapter 2, Equation (2.13)) θij Relative orientation between robots iand j(Chapter 7, Equation (7.2)) κn(c)Indicator of the eigenvalues position (Chapter 5, Equation (5.28)) ΛiCovariance associated to xi(0) (Chapter 2, Equation (2.13)) ΛML Covariance of the Maximum likelihood (Chapter 4, Equation (4.20)) λiith eigenvalue of W(Chapter 2, Assumption 2.3.2) λm, λMParameters of the sifted scaled Chebyshev polynomial (Chapter 5, Equation (5.7)) λmin, λmax Lower and upper bound in the estimation of λ2(Chapter 5, Equation (5.30)) ΠiFeatures composing the map of robot i(Chapter 6, Section 6.2) τ(x)Function that defines the direct expression the Tn(x)(Chapter 5, Equation (5.4)) υiVoting vector (Chapter 4, Section 4.4.2) ΦA discrete partition of R(Chapter 4, Definition 4.2) χi(t)Chi-square test to vote one hypothesis (Chapter 4, Equation (4.23)) ψij Bearing angle between robots iand j(Chapter 7, Equation (7.2)) Chapter 1 Introduction 1.1 Multi-Robot Systems, Distributed Consensus and Vision Sensors The idea of autonomous robots helping humans in the execution of different tasks is nowadays a reality. During the last decade, there has been an enormous advance in technology that has made possible for individual robots to perform hard tasks with high precision [135]. From “simple” repetitive tasks like cleaning a house to more sophisticated operations such as mine clearance, or cleanup and recovery of oil spills, robots have become an important element in our lives, see Figure 1.1. However, as happens with humans, cooperative work seems more attractive and produces better results than individual work. Figure 1.1: Robots have become an important element in our lives. A vacuum robot cleaning a house (left) and a robot handling an explosive (right). Right figure reproduced with permission of the authors [119] Let us consider for example a brigade of firemen entering a house on fire, Fig. 1.2. It is obvious that a team of firemen will perform all the tasks faster and better than a single fireman. To success, the team requires a common knowledge about the house, for example, where are the exits of the building, the state of the fire in the different rooms or where are located possible survivors. Figure 1.2: Brigade of firemen acting cooperatively. Figure reproduced with permission of the authors [119] 21 22 If instead of a firemen brigade the team is integrated by robots (Fig. 1.3) the problem of cooperation remains similar. Multi-robot approaches present several advantages over mono-robot solutions [18]. A team of mobile robots, possibly combined with static agents such as surveillance cameras, even cooperating with humans, may allow to perform complex tasks that for a single robot would be very difficult to complete, or not achievable at all. Cooperative work allows to perform the tasks in less time or with the least cost. On the other hand, the coordination of a team of robots (Fig. 1.3) introduces new challenges that designers of these systems must face. Figure 1.3: Team of robots. One way to deal with multiple robots is by using a central computer that receives and processes all the information of all the robots. Centralized approaches use a specific computer, usually called server, which optimally takes the decisions and coordinates the team. These approaches are easier to design and to implement, however, they are hardly scalable and become unsuitable when the number of robots is large enough. Moreover, if the server has a failure, the task will not be accomplished, which makes the system have too little reliability. Distributed approaches [78], on the other hand, are harder to design but in general perform better. These solutions assume that each robot has its own computer onboard and sends the information it has from the scene to a subset of the robots, its neighbors. In this way, the team of robots is able to handle changes in the communication network, usually caused by changes in their positions or failures in their systems. As a consequence, the system is more reliable and independent of individual members, Figure 1.4. Centralized Solution Distributed Solution Figure 1.4: Centralized (left) versus distributed (right) solution. In a centralized setup, one robot gathers the information of the whole network and makes the decision. In a distributed scenario all the robots play the same role and exchange messages with all their neighbors. As a consequence, the system is more reliable and independent of individual members. Chapter 2 Robotic Networks and the Consensus Problem This chapter introduces the necessary concepts to understand the proposals of the Thesis. We provide with the basic definitions to characterize a robotic network. First, we describe the robots we will use and their way to interact with each other and with the world. Then, we define the communications of the network using fixed and time-varying graphs and we give some definitions of interest. After that, in the chapter we review the distributed algorithms based on linear iterations and the application of this kind of algorithms to achieve the consensus using different weights. To conclude the chapter, we show some examples of different consensus applications solved using a linear iteration. 2.1 Introduction The emergence of new sensing, computation and communication technologies has stimulated an intense research activity in multi-robot sensor systems. The integration of multiple robots in complex networks and information systems will enable users to close the loop in new applications for remote observation and actuation. One of the first issues that need to be addressed in these systems is the configuration of the individual robots of the network and the way they interact with the world and with each other. It is clear that the actions of the team of robots will depend on the characteristics of each robot. For example, the behavior of the team will not be the same if the robots have omnidirectional range sensors than if they have cameras with limited field of view and no depth information. Similarly, the algorithms run by the network will be different if the robots have powerful communication devices that allow them to communicate with everybody than if they have limited communication capabilities. Therefore, the first step is to describe the main properties of the multi-robot systems we will study along the Thesis. Once the robotic network is well defined and characterized, the second issue of importance is to give a good description of the problem we want to solve with the team of robots, that is, the consensus problem. Within the control and robotics communities, the problem of achieving consensus is a canonical problem that has received much attention. The goal is to devise a distributed algorithm that allows a group of robots to agree upon some specific information. Distributed linear algorithms and in particular, averaging iterations have a long and rich history, specially during the last decade. Several algorithms have been proposed to achieve consensus under different situations. To name a few, discrete time communications are treated in [61], and continuous time evolution of the system in [107]. Asynchronous communications are studied in [84] and time-varying signals and dynamic consensus in [163]. The convergence time of linear iterations and a finite time solution are proposed in [109, 138] respectively. Solutions to attitude synchronization and consensus on manifolds can be found in [124,146]. Readers interested in a more comprehensive state of the art in this topic are referred to the books [18,125], and the surveys [106,126]. 29 30 In this chapter we address these two issues, explaining the configuration of the robotic network that we will consider along the Thesis and formally describing the consensus problem and solutions to this problem using linear iterations. 2.2 Model of the Robotic Network In this section we introduce the main properties of the multi-robot system we are considering. 2.2.1 Definition of a Robot We start by giving a description of the robots we will consider along the Thesis. We define one robot as an autonomous machine with the following capacities: •Capacity to make its own decisions: We consider that the robots have a computer onboard that allows them to make computations to carry out the desired task. Although we do not impose any restriction on the computation and storage capabilities of the robots, we will pay special attention to design algorithms that do not require complex computations and we will try to use as less storage space as possible. •Capacity to sense the world: In order to perceive the world, we consider that each robot is equipped with a conventional camera. Along the Thesis we consider monocular cameras with limited field of view. In general, we assume that the cameras equipped by all the robots are the same but we do not require an exact knowledge about the intrinsic parameters of the cameras. Moreover, we will see that most of our algorithms are robust to the use of different cameras. •Capacity to move autonomously: We assume that the robots are able to move freely within the environment in order to explore it. Leaving aside Chapter 7, that considers non holonomic motion constraints, in the rest of the thesis we do not impose any particular dynamics on the robots. •Capacity to communicate with other robots: We assume that all the robots are equipped with a communication device that allows them to send and receive messages. As happens with any real communication device, the robots will have limitations to which they can communicate. We do not enter into the details about the specific causes why two robots cannot communicate, they can be, for example, the distance between the robots or interferences in the signal. A more specific definition of the communications is given later in the chapter. An example of a robot is given in Figure 2.1. Since for our purposes there are not significant differences, we will use interchangeably the terms robot, agent and node. 2.2.2 Communication Model We assume that the multi-robot system is composed by Nrobots, each one of them satisfying the properties above mentioned. The robots are labeled by i∈ V ={1, . . . , N}. Assumption 2.2.1 (Identification of the robots).Each robot in the team i∈ V can be univocally identified. This can be satisfied, for example, considering the IP addresses the robots use to communicate. The limited communication capabilities imply that not all the robots will be able to directly exchange information with each other. These limitations can be modeled using a graph G={V,E}, where E ⊂ V ×V contains the pairs of robots that can directly communicate. We say that there is a communication link between iand jwhen they can directly exchange messages, which happens if and only if (i, j)∈ E. 2. Robotic Networks and the Consensus Problem 31 Figure 2.1: Example of a robot Definition 2.2.2 (Neighbors of a robot).We define the neighbors of a robot i∈ V as the set of robots that can directly communicate with i, Ni={j∈ V | (i, j)∈ E}.(2.1) Unless otherwise specified, in the Thesis we will consider undirected communications. That is, (i, j)∈ E ⇔ (j, i)∈ E and j∈ Ni⇔i∈ Nj.Initially, let us assume that the graph Gis fixed over the time. When this is the case, we also require the graph to be connected. Assumption 2.2.3 (Connectedness of the communication graph).The communication graph, G, is connected, i.e., for every pair of robots iand j, there exists a path of communication links starting in iand ending in j. The length of these paths is another important concept in the Thesis. Definition 2.2.4 (Diameter of a graph).Given a fixed communication graph, G, we define its diameter as the maximum length of a path, in communication links, between any two robots in the graph. The diameter of Gis denoted by dvand for a fixed communication topology is always smaller than N. Time-Varying Communication Topology As the robots move in the environment, their relative positions with the other robots change. As a consequence, it can happen that two robots that initially were able to communicate with each other lose their communication link. In this situation the communications between the robots are modeled with with a time-varying undirected graph G(t) = {V,E(t)}. Now the edge set is time dependent and robots iand jcan communicate at time tif and only if (i, j)∈ E(t). The set of neighbors is also time-varying and denoted by Ni(t). Under these circumstances, we make two assumptions about the communications between the robots. Assumption 2.2.5 (Existence of a dwell time).There exists a lower bound, δ > 0,on the time between two consecutive changes in the topology. Denoting tk, k ∈N,the discrete time instants when the topology changes, then tk+1 −tk≥δ, ∀k. Assumption 2.2.6 (Periodic joint connectivity).There exists a positive time period Tsuch that, for any instant of time, t, the collection of communication topologies in the time interval (t, t+T)is jointly connected. That is, the resulting graph from combining all the communication links that are available in the time interval (t, t+T) is connected. Distributed Consensus in Multi-Robot Systems with Visual Perception 32 Note that these assumptions do not impose any specific communication between two particular robots or the assumption of a central computer that manages all the information. The first assumption implies that the changes in the communication topology do not occur infinitely fast, which is reasonable to assume in a real robotic communication network. The second assumption is used to guarantee that the information of each robot is going to reach at some point, upper bounded in time, all the other robots directly or indirectly. 2.3 Distributed Consensus and Linear Iterations We formally define the consensus problem and present solutions to solve it using a distributed linear iteration. Let us consider that the robots are perceiving some quantity of interest with their sensors. The nature of this quantity can be, for example the position of the robot, its velocity or the descriptor of some feature of interest of the environment. For simplicity, to describe the problem we will consider that this quantity is a scalar number. Assume that each robot has some initial value of the quantity of interest, xi(0). Due to sensor noise or different initial configurations, the observations of each robot are most likely going to be different at the beginning. The consensus problem is formally defined as follows: Definition 2.3.1 (The consensus problem).Given initial conditions xi(0), i = 1, . . . , N, we define the consensus problem as the problem of making the state of all the robots regarding the quantity of interest reach the same value, computed as a function, f, of the initial observations: xi=xj=f(xk(0)), k = 1, . . . , N, for all iand jin V. This problem has a great importance in many robotic tasks such as sensor fusion and formation control. In the first case it is required for a proper representation of the environment whereas in the second is relevant to achieve a desired configuration, e.g., to make all the robots move in the same direction or meet at a fixed point. The solutions we are interested in correspond with distributed algorithms that follow a linear iteration scheme. Linear iterations are very easy to implement, as they only require to compute linear combinations of different quantities. This simplicity makes them very interesting to be used in a distributed setup. In addition, they represent an important class of iterative algorithms that find applications in optimization, in the solution of systems of equations and in distributed decision making, see for instance [15,18,78]. A linear iteration computes weighted sums of the different values to achieve this objective. Specifically, each robot updates its value of the quantity of interest computing a weighted sum of its previous value and that of its direct neighbors, xi(t+ 1) = wii(t)xi(t) + X j∈Ni(t) wij(t)xj(t).(2.2) In the previous equation wij is the weight associated to the information given by the neighbor j. In the Thesis we will refer to iteration (2.2) as the standard discrete time distributed consensus algorithm. The extension to quantities of any dimension is straightforward, applying the same iteration rule for each one of the scalar components of the state vector independently. If we consider the update rule of all the robots simultaneously, we can model the update as a N-dimensional discrete-time linear dynamical system with dynamics inherently related to the network structure, x(t+ 1) = W(t)x(t),(2.3) with x(t) = (x1(t), . . . , xN(t))Tthe values of the state of the different robots in vectorial form and W(t) = [wij(t)] ∈RN×N, the weight matrix generated using all the individual weights. The advantages of using a distributed linear iteration like (2.2) are the following: • The algorithm is fully distributed because each robot is only using the information provided by its neighbors in the communication graph. 2. Robotic Networks and the Consensus Problem 33 • The robots do not need to know the topology of the whole network to execute these algorithms, they only require the information about their direct neighbors. Moreover, the algorithm is robust to changes in the communication topology. • The computational requirements of the robots are very low. Each robot is only computing sums and products of the available information. Additionally, the robots only require to store one datum in their computers, instead of as many data as robots in the network. This implies small storage space requirements as well. • Finally, the communication requirements are also small. The robots only send messages containing their local value of the variable of interest. All these reasons make the use of these algorithms very appealing in robotic networks. On the other hand, the use of this kind of iterations assume that the communications between the robots are synchronous and uncorrupted. Nevertheless, some of the most standard issues in communication can be handled by a proper modeling of the communication graph. For example, packet drops and communication failures can be seen as regular changes in the communication topology and asynchronous communications can be modeled by considering a directed communication graph. Therefore, if we design our algorithms in such a way that they can handle these topologies, we can expect them to be robust to these communication issues. In the following we deal with the problems of assigning the appropriate weights to the different elements so that different consensus objectives are achieved and we show examples of different applications where these algorithms can be used. 2.3.1 Max-Consensus and Average Consensus In the Thesis we are mainly interested in two important consensus functions, the maximum (or minimum) and the average of the initial conditions. Max-Consensus The first consensus function we study is the maximum (or minimum) of the initial conditions. In this situation, the consensus is achieved when all the robots information is equal to the largest initial value, xi= max j∈V (xj(0)),∀i∈ V.(2.4) The max-consensus objective has a great importance in leader-election routines. The following distributed iteration can be executed by all the robots to achieve this objective. xi(t+ 1) = max(xi(t), xj(t)),∀j∈ Ni(t).(2.5) Although this is not strictly a weighted combination of the states, it follows the principles of a linear iteration, where each robot assigns wij = 1 to the largest element of those it has access to and wij = 0 to all the rest. The update rule (2.5) is well known to converge in a finite number of rounds to the maximum of all the initial conditions [78]. Distributed Averaging The second consensus function we study is the average of the initial conditions. This a good consensus function for situations in which the observations of all the robots have the same importance because the average weights all of them equally, ¯x=1 NX i∈V xi(0).(2.6) Distributed Consensus in Multi-Robot Systems with Visual Perception 34 The average of the initial information of the robots can be achieved very easily using a linear iteration. Let us consider that the communication graph remains fixed during the execution of the whole iteration, i.e., W(t) = Wfor all tin equation (2.3). Then we impose following assumption on the weight matrix: Assumption 2.3.2 (Fixed doubly stochastic weights).Wis symmetric, row stochastic and compatible with the underlying graph, G, i.e., it is such that wii >0, wij = 0 if (i, j)6∈ E, wij >0only if (i, j)∈ E and W1 =1. Since the communication graph is connected, any matrix Wthat fulfills assumption 2.3.2, will have one eigenvalue λ1= 1,with associated right eigenvector 1,and algebraic multiplicity equal to one. The rest of the eigenvalues, sorted in decreasing order, satisfy 1> λ2≥. . . ≥λN>−1. Without loss of generality, let us suppose that all the eigenvalues are simple. Any initial conditions x(0) can be expressed as a sum of eigenvectors of W, x(0) = γ1v1+. . . +γNvN,(2.7) where viis the right eigenvector associated to the eigenvalue λiand γia real coefficient, with the special case of γ1, which in this case is equal to the average of the initial conditions, γ1= ¯x. It is clear that x(t) = Wtx(0) = γ1v1+λt 2γ2v2+. . . +λt NγNvN,(2.8) and since |λi|<1, i 6= 1, then lim t→∞ x(t) = γ1v1= ¯x1,(2.9) and the average consensus is asymptotically reached by all the robots in the network. The asymptotic convergence implies that the exact consensus value will not be achieved in a finite number of iterations. In practice, the consensus is said to be achieved when |xi(t)−xj(t)<tol|for all i and j, and a prefixed error tolerance tol. The convergence speed of (2.3) depends on max(|λ2|,|λN|).This parameter is usually denoted as the algebraic connectivity of the network because it contains relevant information about the connectivity of the network. Without loss of generality, in the Thesis we assume that the algebraic connectivity of the network is characterized by λ2,i.e., |λ2| ≥ |λN|. When the communication topology varies at different iterations, we need to restrict a bit more the assumption on the weights. Assumption 2.3.3 (Time varying non degenerate weights).W(t)has the property of being double stochastic and non degenerate ∀t. In other words:      wij(t)∈ {0}∪[α, 1] ∀j, t wii(t) = 1 −Pj6=iwij(t)≥α, 1TW(t) = 1T,W(t)1=1, being αa positive constant and 1= [1,...,1]T∈RN. Although this case is more tricky, convergence to the average can also be proved. For brevity, we refer the reader to [18] for the proof of convergence in this case. 2.3.2 Definition of the Matrix Weights The only problem that remains to be solved is the specific selection of the weights that makes the matrix doubly stochastic and non degenerated. Both the convergence to the desired value and the speed which the consensus is achieved depend on these weights, which makes the selection of the weights one of the most important tasks to define a good linear iteration. 2. Robotic Networks and the Consensus Problem 35 There are several to assign the weights in order to satisfy Assumption 2.3.3. A simple way to address this issue is by assigning the same weight, , to all the elements, wij =, and wii = 1 −|Ni|. (2.10) In this case, the parameter αin Assumption 2.3.3 is equal to . For a fixed communication topology, the range of values that this parameter can take is directly related with the largest eigenvalue of the Laplacian matrix, L, associated to the communication graph. The Laplacian matrix, L,is defined in such a way that the diagonal elements are equal to the number of neighbors of each robot, lii =|Ni|and the rest of the elements, lij, are equal to 1 if robots iand jare direct neighbors and zero otherwise. The values that can take are in the interval (0,2/λ1(L)) [153], being λ1(L)the largest eigenvalue of the Laplacian matrix. Among all these values, the fastest one to achieve the consensus is [153] wij(t) = 2 λ1(L) + λN−1(L).(2.11) In the Thesis we will denote this weights by the Best Constant Weights. Unfortunately, as we can see, assigning a constant value implicitly requires for the robots to have some global knowledge of the network. An easy way of satisfying Assumption 2.3.3 using only local information are the Metropolis Weights, where the different weights are computed as a function of information provided only by direct neighbors in the communication graph, wij(t) =          1 max(|Ni(t)|,|Nj(t)|)+1,if (i, j)∈ E(t) 1−X j∈Ni(t) wij(t),if i=j 0,otherwise .(2.12) In this definition, the parameter αin Assumption 2.3.3 is in the worst case equal to 1/N and the rest of conditions are satisfied as well because the same of the weights in one row is always equal to one and the matrix is symmetric. We will also refer to these weights as the Local Degree Weights [153]. Note that in this case, in order to compute the weights, the robots only need to attach to their messages the information about the number of neighbors they have. 2.4 Application of Linear Iterations to Different Consensus Problems To end this chapter, we present different robotic problems where the average consensus can be used as a distributed solution. Sensor Fusion One of the most interesting problems where the distributed averaging can be used is the sensor fusion of the measurements of all the robots. The problem of how to fuse several observations in a centralized manner has received considerable attention in the robotics literature. For example, [44], [53] study the integration of different sensor measurements taken by a single robot. In multi-robot systems, [55] investigates how to perform data fusion of several SLAM maps by a central unit. Distributed averaging techniques allow to solve this problem in a distributed fashion in a simple way. For example, let us consider that the robots are measuring the temperature of the environment, which has a value around five Celsius degrees. Let us say that there are 25 robots deployed in the environment taking measurements. Each robot is equipped with a thermometer that gives an estimation of the temperature between 4.5 and 5.5 degrees. The communication network is depicted in the left image of Figure 2.2 inside a room. The Distributed Consensus in Multi-Robot Systems with Visual Perception 36 right image of Figure 2.2 shows the evolution of all the robots’ estates when executing (2.2). We can see that all the robots eventually achieve the same temperature value, i.e., the consensus, which is exactly the average of the initial values of all the robots. 0 50 100 150 4.5 4.6 4.7 4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 Communication Rounds Consensus Value Figure 2.2: Example of distributed consensus for sensor fusion. The communication network is depicted on the left, where each blue dot represents one robot of the network and each black line represents a direct communication between a pair of robots. On the right we show the evolution of the consensus, with each line representing the different values of the state of each robot. We can see that as the robots execute the linear iteration, the value of all the robots tends to the same value, which is exactly the average of the initial conditions. Sensor Fusion with Uncertainties If the observations of the robots include a measure of their uncertainty, given by the covariance matrices Λi, the problem changes from the computation of the average to the computation of the maximum likelihood (ML). The ML is estimated using a weighted least-squares approximation from the robot measurements as θML = N X i=1 Λ−1 i!−1N X i=1 Λ−1 ixi(0).(2.13) An averaging linear iteration can be used to compute the ML [155]. At the beginning, each robot initializes two state variables, Pi(0) = Λ−1 iand qi(0) = Λ−1 ixi(0).If the averaging linear iteration is applied to these variables, then lim t→∞ Pi(t) = 1 NX j∈V Pj(0),and lim t→∞ qi(t) = 1 NX j∈V qj(0),(2.14) and lim t→∞ P−1 i(t)qi(t) = θML,(2.15) This distributed solution can be very helpful, for example, in the cooperative simultaneous localization and mapping of the environment by a team of robots, the SLAM problem [5]. Rendezvous of a team of robots Another problem of high interest in multi-robot systems is the rendezvous of the team [32,37]. The rendezvous of a team of robots is achieved when all the robots gather at a fixed point in the environment. Solutions based on distributed averaging can also be of high interest for this problem. Figure 2.3 shows the trajectories of a team of 10 robots with linear dynamics and using averaging to control their motion. The individual control law of each robot is computed by averaging the positions of the robots that are neighbors in the communication graph. At the end, all the robots come together at the same point, which is the centroid of the initial positions of the ten robots. 2. Robotic Networks and the Consensus Problem 37 −4 −3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3 4 5 Figure 2.3: Example of a team of robots using a linear iteration to rendezvous in the centroid of their initial positions. Flocking of a team of robots Finally, a very important problem in cooperative control and formation control is the flocking of the team of robots [105]. This problem consists on making all the robots to move in the same direction and with the same velocity. The name comes from the analogy with the behavior of flocks of birds moving in formation (Fig. 1.5). As in the previous motivating examples, distributed averaging and linear iterations represent a powerful tool to achieve this behavior. A simple example of this phenomenon is shown in Figure 2.4. This example assumes a team of robots moving on the plane with non holonomic motion constraints. At each step, the robots turn in the average direction of the headings of their neighbors. As a consequence, all the robots end up moving in the same direction. If the initial velocities of the robots were different, the same solution could be used to make them converge to the same value. −10 −5 0 5 −30 −25 −20 −15 −10 −5 0 5 Figure 2.4: Example of a distributed control law that makes the team of robots move in the same direction by averaging their orientations. Distributed Consensus in Multi-Robot Systems with Visual Perception 38 2.5 Discussion This chapter has introduced the robotic network that will be the focus of study along the Thesis. We have defined the main properties of the individual robots and their sensing and communication capabilities to interact with the environment. Graph theory presents itself as a very useful tool to formalize the interactions between the robots. Modeling the network with graphs we can describe the important concepts. The chapter has also served to present the main problem we are interested in studying, the consensus problem. We have reviewed the solutions of this problem based on linear iterations and their interest in distributed systems with limited communication capabilities. Finally, we have introduced some of the most interesting multi-robot problems that can be solved using linear iterations and distributed averaging. We have presented some basic simulations to show how these problems find a simple solution with distributed averaging. In the examples we have presented the most basic version of these problems, omitting important aspects of real life that should be taken into account. For example, in the sensor fusion scenario we have assumed that the robots were only measuring a good value of a single data, the temperature. However, in perception tasks with vision sensors each robot will observe many features, and some of them erroneously. Therefore, additional mechanisms are required to achieve a proper consensus. In the flocking scenario we have not considered visibility issues, what happens if the robots do not see each other or do not know how to measure their relative positions. In the rest of the Thesis we present our contributions in this field, considering more realistic versions of some of these problems. 3. The Data Association Problem 45 Algorithm 1 Inconsistency Detection - Robot i Ensure: All the inconsistencies are found 1: repeat 2: Send yi r(t), r ∈ Sito all j∈ Ni 3: Receive all yj s(t), j ∈ Ni, s ∈ Sj 4: for all r∈ Sido 5: for all j∈ Ni, s ∈ Sj|[Aij]r,s = 1 do 6: yi r(t+ 1) = yi r(t)∨yj s(t) 7: end for 8: for all r0∈ Sisatisfying that ∃u∈ {1, . . . , msum}such that [yi r(t)]u= [yi r0(t)]u= 1 do 9: yi r(t+ 1) = yi r(t)∨yi r0(t) 10: end for 11: end for 12: until yi r(t+ 1) = yi r(t),∀r∈ Si When one robot jat time tdoes not receive the information yi r(t), r = 1, . . . , mifrom robot ithen it can simply avoid the execution of line 6 because it already has all the information from yi r(t−1), which is exactly equal to yi r(t). The modified algorithm reduces the complexity of the operations with respect to the powers of the adjacency matrix by replacing the products of matrices by logical operations between rows. This reduction allows to avoid the large numbers that may appear when computing powers of the adjacency matrix and also allows us to reduce the amount of transmitted data. In the following we describe the main properties of the algorithm. Proposition 3.3.2 (Limited Communications).The amount of information exchanged by the network during the whole execution of Algorithm 1 can be upper bounded by 2m2 sum. Proposition 3.3.3 (Correctness).After execution of Algorithm 1 all the paths between features have been found and they are available to all the robots with features involved in them. Theorem 3.3.4 (Limited Iterations).All the robots end the execution of the Algorithm 1 in at most min(df,2N) iterations. Before illustrating the behavior of the algorithm with an example, we discuss some aspects of the decentralized inconsistency detection algorithm. Remark 3.3.5 (Conservative Bounds).The bounds provided in Proposition 3.3.2 and Theorem 3.3.4 are conservative. In practice we should expect a better performance of the algorithm. In order to send 2m2 sum data, it is required for the association graph to be strongly connected, i.e., for any pair of features there is a path of arbitrary length connecting them. This situation is unlikely to happen, since it would mean that all the features are associated with each other. Regarding the number of iterations, the bound does not take into account the simultaneous exchange of data by the robots. In practice we have observed that in less than N iterations the algorithm always finishes. Remark 3.3.6 (Higher Level Matches).With the presence of additional images, it is possible to find better matches using higher level constraints, e.g., the trifocal tensor with triplets of images. Our algorithms are compatible with other multi-camera matches, as long as the communications allow the computation of these matches and the Assumptions 3.2.1 to 3.2.3 are satisfied between pairs of cameras. However, in order to keep the communication graph free of constraints, we have only considered matching functions using pairs of images. Remark 3.3.7 (Multiple Matches).In the literature, when dealing with two images, it is common to consider multiple hypotheses when associating the features [102]. Although this possibility would be of high interest Distributed Consensus in Multi-Robot Systems with Visual Perception 46 here, this is not affordable by now. By considering multiple associations, the problem grows exponentially with the number of cameras and features, whereas with a one-to-one association grows linearly. Moreover, the match of one feature with two or more features observed by other camera is directly an inconsistency, which requires further processing to solve it in a second step. Remark 3.3.8 (Detectable Spurious).The existence of one inconsistency implies the existence of at least one spurious match in the local matching process. However, the opposite is not necessarily true. There might be local matches which are spurious but that do not lead to one inconsistency, e.g., one match between only two robots. These spurious matches cannot be detected with our algorithm, and therefore cannot be corrected during the data association. A more detailed treatment of spurious and outliers is given in the next chapter. Example of execution Figure 3.4 shows an example of how the algorithm is applied. The example shows the execution of the algorithm for the associations shown in Fig. 3.3 (c). Each robot has only the information about the rows corresponding to the features it has observed. In Fig. 3.4 (a) the matrix with the local matches found by all the cameras can be seen. The zeros have been omitted in the figure for a better representation. For simplicity here we will only explain the process for the robot A. After the first round of communications and the execution of lines 5-7 of Algorithm 1 the rows have the form of Fig. 3.4 (b). The components with green background are the new paths found by the algorithm. For the case of the camera A, the first feature, fA 1,is matched with the first feature of robot D, which is a direct neighbor of A, thus, yA 1(2) = yA 1(1) ∨yD 1(1).The second feature, fA 2,is matched with fB 1and fD 2so yA 2(2) = yA 2(1) ∨yB 1(1) ∨yD 2(1).Finally yA 3(2) = yA 3(1) ∨yB 3(1).After that, robot A detects that fA 1and fA 2share a common match with fC 1. Therefore it executes lines 8-10 of the algorithm with these two features, as shown in Fig. 3.4 (c). Now the process is repeated, obtaining the matrix in Fig. 3.4 (d). The algorithm has found all associations using only 3< df= 7 iterations. At this point the robot A knows that fA 1and fA 2belong to one inconsistent association with features fB 1, fB 2, fC 1, fC 2, fD 1and fD 2. 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Cam. ACam. B Cam. C Cam. D 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Cam. ACam. B Cam. C Cam. D (a) (b) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Cam. ACam. B Cam. C Cam. D 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Cam. ACam. B Cam. C Cam. D (c) (d) Figure 3.4: Example of execution of the propagation algorithm and the detection of inconsistencies. Figures (a)-(d) show the four steps that the algorithm requires to propagate all the correspondences. 3. The Data Association Problem 47 3.4 Decentralized Resolution of Inconsistent Associations The existence of one inconsistency implies the existence of at least one spurious match in the local matching process. Therefore, the resolution of inconsistent associations is carried out by deleting edges from Gdis,ideally the spurious matches, so that the resulting graph is conflict-free. Definition 3.4.1 (Conflict Free Graph).Let Cdenote the number of conflictive sets in Gdis. The robots that detect a conflictive set Cis Vinc ⊆ V. The number of features from each robot i∈ Vinc involved in Cis ˜miand the number of total features involved in Cis denoted as c. We say Gdis is conflict-free if C= 0. All the edges whose deletion transforms Gdis into a conflict-free graph, belong to any of the Cconflictive sets of Gdis. Since the conflictive sets are disjoint, they can be considered separately. From now on, we focus on the resolution of one of the conflictive sets C. The other conflictive sets are managed in the same way. The resolution problem consists of partitioning Cinto a set of disjoint conflict-free components Cqsuch that ∪ qCq=C,and Cq∩Cq0=∅, q 6=q0. Note that, even with the full knowledge of the association graph that generates C, finding the optimal partition that solves the inconsistency is an NP-Hard problem. If there were only two inconsistent features fi r,fi r0, it could be approached as a max-flow min-cut problem [115]. However, in general there will be more inconsistent features, ˜mi≥2, within Cassociated to each robot. The application of [115] separately to any pair of inconsistent features does not necessarily produce an optimal partition. It may happen that a single edge deletion simultaneously resolves more than one inconsistent association. Therefore, an optimal solution should consider multiple combinations of edge deletions, what makes the problem computationally intractable, and imposes a centralized scheme. For that reason we focus on proposing heuristic methods such that the communication constraints are respected. The number of conflict-free components is a priori unknown but can be lower bounded with the following proposition: Proposition 3.4.2 (Number of Partitions).Let Vinc be the set of robots that detect Cand i?be the robot with the most features in C, i?= arg max i∈Vinc ˜mi.(3.9) The number of conflict-free components in which Ccan be decomposed is lower bounded by ˜mi?. In the rest of the section we provide two different distributed algorithms to solve the inconsistencies in Gdis. The first one, the Maximum Error Cut, considers the weights in the association graph in order to find the edge with the largest error that breaks a given inconsistency. The second method is based on a greedy deletion of edges to construct different Spanning Trees free of inconsistencies. 3.4.1 Resolution using the Maximum Error Cut Most of the matching functions in the literature are based on errors between the matched features, e.g., the Sampson distance for the epipolar constraint, or the sum of the absolute differences for template matching. These errors can be used to find a partition of C.Let Ebe the weighted symmetric association matrix [E]r,s =ers if [A]r,s = 1, −1 otherwise,(3.10) with ers the error of the match between rand s. Assumption 3.4.3 (Properties of the Errors).The error between matches satisfies: Distributed Consensus in Multi-Robot Systems with Visual Perception 48 •err = 0,∀r; • Errors are non negative, ers ≥0,∀r, s; • Errors are symmetric, ers =esr,∀r, s; • Errors of different matches are different, ers =er0s0⇔[r=r0∧s=s0]∨[r=s0∧s=r0]. Since the inconsistency is already known there is no need to use the whole matrix but just the sub-matrix related with the inconsistency, EC.Although all the errors in ECare small enough to pass the matching between pairs of images, we can assume that the largest error in the path between two conflictive features is, with most probability, related to the spurious match. Definition 3.4.4 (Bridges and Cuts).Given a conflictive set, a bridge is an edge whose deletion divides the set in two connected components, i.e., it does not belong to a cycle. Given two conflictive features, we define a cut as a bridge that, if it is deleted, then the conflict between the features is solved. Note that not all the bridges in one inconsistency are cuts. There are bridges that, if deleted, will not break the inconsistency because they do not belong to the path between the features to separate. Our goal is, for each pair of conflictive features, find and delete the cut with the maximum error. Algorithm 2 shows the solution we propose to find the cuts using local interactions. We explain in detail how it works. As we did in the detection algorithm, let each robot initialize its own ˜mirows of elements as Algorithm 2 Maximum Error Cut - Robot i Require: Set of Cdifferent conflictive sets Ensure: Gdis is conflict free 1: for all Cdo 2: –Error transmission 3: zr(0) = {[EC]r,1,...,[EC]r,c}, r = 1,..., ˜mi 4: repeat 5: zr(t+ 1) = maxs∈C,[EC]r,s≥0(zr(t),zs(t)Prs) 6: until zr(t+ 1) = zr(t),∀r∈˜mi 7: –Edge Deletion 8: while robot ihas conflictive features rand r0do 9: Find the cuts (s, s0) : 10: (a) [zr]s= [zr0]s0, s 6=s0, 11: (b) For all s00 6=s, [zr]s6= [zr]s00 , 12: (c) For all s00 6=s0,[zr0]s06= [zr0]s00 13: Select the cut with largest error 14: Send message to break it 15: end while 16: end for zr(0) = {[EC]r,1,...,[EC]r,c}.The update rule executed by every robot and every feature is zr(t+ 1) = max s∈C,[EC]r,s≥0(zr(t),zs(t)Prs),(3.11) where the maximum is done element-wise and Prs is the permutation matrix of the columns rand s. We have dropped the super indices corresponding to robots because the limited communications are implicit in the error 3. The Data Association Problem 49 caused by direct associations, eq. (3.10). Equivalently, for a given feature r, we can put eq. (3.11) as a function of its elements. The uth component, [zr(t+ 1)]u,is updated as follows: [zr(t+ 1)]u=     max([zr(t)]u,[zs(t)]s)if [EC]r,s ≥0∧u=r max([zr(t)]u,[zs(t)]r)if [EC]r,s ≥0∧u=s max([zr(t)]u,[zs(t)]u)if [EC]r,s ≥0∧r6=u6=s. (3.12) As the following results state, the presented method converges in finite time. We also show the convergence values of the different elements. For clarity, we separate the analysis in two parts: the first result gives the values reached by the components that belong to bridges in the graph; the second result consider the features that form part of a cycle in the association graph. Proposition 3.4.5 (Convergence).The dynamic system defined in (3.11) converges in a finite number of iterations and for any r, s ∈ C such that [EC]r,s ≥0the final value of zris the same than zsPrs.In addition, for any r∈ C,[zr(t)]r= 0,∀t≥0. Theorem 3.4.6 (Values for Bridges).Let us consider one bridge, (s, u).Let d(r, s)be the minimal distance in edges to reach node sstarting from node r, then for all rsuch that d(r, s)< d(r, u) [zr(t)]u→[EC]s,u =esu.(3.13) Equivalently, for all rsuch that d(r, s)> d(r, u) [zr(t)]s→[EC]u,s =eus =esu.(3.14) Theorem 3.4.7 (Values for Cycles).Let us suppose the inconsistency has a cycle involving `features. Let C` be the subset of features that belong to the cycle. For a given feature r [zr(t)]s→max u,u0∈C` euu0,∀s∈ C`\arg min s0∈C` d(r, s0).(3.15) Corollary 3.4.8. If there is a cycle C`in the association graph, after the execution of Algorithm 2, for every feature rthere exist at least two features s, s0in C`as in (3.15) for which the elements [zr]s,[zr]s0reach the same value. At this point we are ready to define the cuts in terms of the variables zrand to propose a criterion to select the best cut to delete. The cuts, (s, s0),for any pair of conflictive features rand r0satisfy (a) [zr]s= [zr0]s0, s 6=s0, (b) for all u6=s, [zr]s6= [zr]u, (c) for all u6=s0,[zr0]s06= [zr0]u. The first condition comes from Theorem 3.4.6 and the other two come from Theorem 3.4.7. For any cut, the error of the cut is the same as the value of [zr]s,[zr]s= [zr0]s0=ess0.Therefore, each robot can look in a local way at its own rows and choose the best cut that breaks the conflict, the one with the largest error. Let us note that, by the definition of a cut, the algorithm considers single-edge deletions, attempting to minimize the number of broken links. Also with this approach, cycles in the association graph are not broken, which is another good property. These cycles are sets of features strongly associated, and therefore, it is better not to delete edges there. In case one robot has more than two features in the same conflict, the algorithm chooses two of the ˜mi inconsistent features and selects the best cut for them. The cut separates all the ˜mifeatures in two disconnected subsets. The process is repeated with each of the subsets until the inconsistencies are solved. This is a simple Distributed Consensus in Multi-Robot Systems with Visual Perception 50 way to proceed that satisfies the resolution of complex inconsistencies, with the payoff of the probable deletion of more edges than necessary. It is possible that two robots decide to delete two different links, when breaking only one of them would be enough to break both inconsistencies, as happens in the example in Fig. 3.5 (b). Nevertheless, recall that finding the optimal partition is NP-Hard and requires the full knowledge of the graph, which implies expensive communications and computations, whereas this approach is fully distributed and easy to compute. The main limitation of the algorithm appears when two conflictive features belong to one cycle in the association graph. In this case there are no cuts and the proposed algorithm cannot solve the inconsistency. However, since the algorithm is able to detect this situation, a different approach can be used to solve it. 3.4.2 Resolution based on Spanning Trees We propose an alternative algorithm to deal with the situations that the Maximum Error Cut does not solve. The method is based on the computation of different spanning trees in each conflictive set and, although the cuts done in the association graph are arbitrary, it has the property that it is able to solve all the inconsistencies. The algorithm constructs ˜mi?spanning trees free of inconsistencies. Initially, each robot idetects the conflictive sets for which it is the root using its local information yi r, r = 1, . . . , mi. The root robot for a conflictive set is the one with the most inconsistent features involved, eq. (3.9). In case two robots have the same number of inconsistent features, the one with the lowest identifier is selected. The root robot creates ˜mi?components and initializes each component Cqwith one of its features fi?∈ C. Then, it tries to add to each component Cqthe features directly associated to fi?∈ Cq. Let us consider that fj s has been assigned to Cq. For all fi rsuch that [Aji]s,r = 1, robot jsends a component request message to robot i. When robot ireceives it, it may happen that (a) fi ris already assigned to Cq; (b) fi ris assigned to a different component; (c) other feature fi r0is already assigned to Cq; (d) fi ris unassigned and no feature in iis assigned to Cq. In case (a),fi ralready belongs to the component Cqand robot idoes nothing. In cases (b)and (c),fi rcannot be added to Cq; robot ideletes the edge [Aij]r,s and replies with a reject message to robot j; when jreceives the reject message, it deletes the equivalent edge [Aji]s,r. In case (d), robot iassigns its feature fi rto the component Cqand the process is repeated. The process is summarized in Algorithm 3. Theorem 3.4.9 (Properties of the Spanning Trees resolution).Let us consider that each robot executes Algorithm 3 on one conflict C, (i) after Niterations no new features are added to any component Cqand the algorithm finishes; (ii) each obtained Cqis a connected component; (iii) Cqis conflict free; (iv) Cqcontains at least two features; for all q∈ {1,..., ˜mi?}. The algorithm ends its execution after no more than Ncommunication rounds. When the algorithm finishes, each original conflictive set Chas been partitioned into ˜mi?disjoint, conflict-free components. It may happen that a subset of features remains unassigned. These features may still be conflictive. The detection and resolution algorithms can be executed on the subgraph defined by this smaller subset of features obtaining in the end an association graph free of all the inconsistencies. Empirical comparisons between the two methods are provided in section 3.5. 3. The Data Association Problem 51 Algorithm 3 Spanning Trees - Robot i Require: Set of Cdifferent conflictive sets Ensure: Gdis is conflict free 1: –Initialization 2: for all Csuch that iis root (i=i?)do 3: create ˜mi?components 4: assign each inconsistent feature fi? r∈ C to a different component Cq 5: send component request to all its neighboring features 6: end for 7: –Algorithm 8: for each component request from fj sto fi rdo 9: if (b) or (c) then 10: [Aij]r,s = 0 11: send reject message to j 12: else if (d) then 13: assign fi rto the component 14: send component request to all its neighboring features 15: end if 16: end for 17: for each component reject from fj sto fi rdo 18: [Aij]r,s = 0 19: end for Example of execution Let us consider one inconsistency as the one depicted in Fig. 3.5 (a) where the communication graph is a ring with an additional edge between robots C and E. Camera A Camera F Camera C Camera D Camera B Camera E 8 2 3 Errors 4 6 9 1 7 Camera A Camera F Camera C Camera D Camera B Camera E 8 2 3 4 6 9 1 7 Camera A Camera F Camera C Camera D Camera B Camera E (a) Inconsistency (b) Maximum Error Cut (c) Spanning Trees Figure 3.5: Example of execution of the resolution of one inconsistency using the two approaches. (a) Inconsistency. (b) Solution obtained using the Maximum Error Cut approach. (c) Solution obtained using the Spanning Trees algorithm. A detailed explanation can be found in section 4.3. Figure 3.5 (b) shows the solution obtained using the Maximum Error Cut algorithm. The evolution of the zrvectors is shown in Figure 3.6. Each one of the figures 3.6 (a)-(f) represents a new iteration of the algorithm in (3.11). The -1 values are omitted for clarity. As an example of how it works, the third row in figure 3.6 (b), corresponding to fB 1is obtained as follows. fB 1executes (3.11) and updates its row in Fig. 3.6 (a) with the 1st and 5th rows in Fig. 3.6 (a), sent by robots A and C because of features fA 1and fC 1.Robot B permutes the first and third element of the vector sent by robot A and the third and fifth element of vector sent by robot C and chooses the maximum (element to element) of the three vectors. As a result the sixth and seventh position Distributed Consensus in Multi-Robot Systems with Visual Perception 52 in Fig. 3.6 (b) (features fD 1and fE 1) change their values. It is interesting to observe how for the cycle all the elements in the different vectors are receiving the value “8”, corresponding to the largest value within the cycle. Once rule (3.11) has finished, robots A and B look for the cuts to break their inconsistencies (Fig. 3.7). For robot B the best cut is the one matching features fA 2and fB 2.For the robot A the largest error is in the column associated to fB 2. However, this is not a cut because both features have the same value in the same element. The next largest value is also discarded because it belongs to a cycle. Finally, the bridge with error 7 is selected because it is a cut and the match between fB 1and fC 1is deleted. 0 1 0 9 6 1 0 7 9 0 7 0 8 2 8 0 4 2 4 0 3 6 3 0 0 1 7 0 9 3 6 1 0 7 8 2 9 0 6 1 7 0 8 4 3 7 8 0 4 3 6 7 8 8 0 3 6 9 2 4 3 0 0 1 7 8 2 0 9 2 4 3 6 1 0 7 8 4 3 9 0 3 6 1 6 7 0 8 8 3 1 6 7 8 0 8 3 1 6 7 9 8 8 0 3 6 7 9 8 8 3 0 0 1 7 8 4 3 0 7 9 8 8 3 6 1 6 0 7 8 8 3 9 0 2 4 3 6 1 6 7 9 0 8 8 3 1 6 7 9 8 0 8 3 1 6 7 9 8 8 0 3 1 6 7 9 8 8 3 0 0 6 1 7 8 8 3 1 0 7 9 8 8 3 6 1 6 0 9 7 8 8 3 9 7 0 8 8 3 6 1 6 7 9 0 8 8 3 1 6 7 9 8 0 8 3 1 6 7 9 8 8 0 3 1 6 7 9 8 8 3 0 0 6 1 9 7 8 8 3 1 0 7 9 8 8 3 6 1 6 0 9 7 8 8 3 1 9 7 0 8 8 3 6 1 6 7 9 0 8 8 3 1 6 7 9 8 0 8 3 1 6 7 9 8 8 0 3 1 6 7 9 8 8 3 0 (a) (b) (c) (d) (e) (f) Figure 3.6: Example of execution of (3.11) for the inconsistency in Fig. 3.5 (a). Each subfigure (a)-(f) represents a new step of the algorithm. In 6 steps the robots with inconsistent features are able to decide which edges should be deleted to solve them. For more details see Section 4.3. 0 6 1 9 7 8 8 3 1 0 7 9 8 8 3 6 1 6 0 9 7 8 8 3 1 9 7 0 8 8 3 6 0 6 1 9 7 8 8 3 1 0 7 9 8 8 3 6 1 6 0 9 7 8 8 3 1 9 7 0 8 8 3 6 Figure 3.7: Decision about which edges should be deleted to solve the inconsistency. Robot B chooses the edge (fA 2, fB 2). Robot A discards the elements with values 8 and 9 because they belong to a cycle and to an edge that does not solve its inconsistency respectively. The match between fB 1and fC 1solves the inconsistency and has the largest error. The Spanning Trees solution is shown in Fig. 3.5 (c). In this case the root camera to manage the inconsistency is the camera A. For each feature, camera A instantiates a different spanning tree. After 2 communications rounds, robots C and E send a request to D and also among them. fD 1gets attached to fC 1and the other edges are broken. After this point the algorithm has ended its execution and the new association graph is conflict free. 3.5 Experiments 3.5.1 Simulations We have designed a simulation environment using MatLab to evaluate the performance of the proposed algorithms. The environment considers a set of Nrobots observing the same mfeatures. To find the local matches, we start from the perfect association graph. After that, we randomly remove a percentage of the perfect associations (pmMissing Edges) and add a percentage of spurious matches (psSpurious Edges). The errors for the good matches are randomly assigned between 0 and 10. For the spurious matches we use a parameter, , so that the error is randomly generated between 0 and (1 + )10. By varying the three parameters, pm, psand , we can model different types of matching without committing to a specific feature or function. For example, matching templates using the intensity of the pixels returns many spurious associations, but the errors are quite discriminative. Therefore, this matching function is characterized by a small value of pmand large values of psand . Other example, the epipolar constraint returns a very robust 3. The Data Association Problem 53 match, at the price of missing many good matches. The threshold to filter the outliers makes all the errors very similar. In this case we have a big value of pmand small values of psand . At each trial, we assume the local matching to be deterministic, i.e., for the same matching function and pair of images, the local matching is always the same. In this way we can repeat the experiment considering different network topologies. The networks are generated as random graphs, where each communication link has independent probability of exist, δ. We call this parameter the network density, because values close to 1 create networks with many links whereas small values of δimply very sparse networks. Since all the robots are observing all the features, we can define a quantitative metric to measure the quality of the global matching. We define a full match as an association set in which the Nrobots of the network match the same feature. The optimal solution is found when the network finds the mfull matches. In Fig. 3.8, 3.9 and 3.10 we show the percentage of full matches using two different matching functions, F1=[pm, ps, ] = [0.1,0.1,0.2],and F2=[pm, ps, ] = [0.5,0.05,0.05],simulating the two examples above mentioned and varying the number of features, of robots and the density of the network. Influence of the number of features: Fig. 3.8 shows the percentage of full matches after the propagation (P), and after executing the Maximum Error Cut (MEC) and the Spanning Trees (ST) resolution methods for different values of m. The number of robots is fixed and equal to N= 8 and the density of the network is δ= 0.5. For each number of features we have repeated the experiment 100 times with different initial configurations. Independently of the matcher used, the number of features is a parameter without much influence on the obtained results. This makes sense because each association set is treated independently, and in general, with more features there are more sets, but not more complex inconsistencies. Therefore, the increase on the number of features only implies the communication of larger messages and more computational demands. We can also see that there is a difference in the values depending on the local matcher, but we leave this analysis for later in the section. 10 20 30 40 50 60 70 80 90 100 0 20 40 60 80 100 NUMBER OF FEATURES (m) FULL MATCHES (%) F1−P F1−ST F1−MEC F2−P F2−ST F2−MEC Figure 3.8: Number of matches against number of features. Influence of the number of robots: In Fig. 3.9 we show the results for the same experiment fixing mto 15 features and varying the number of robots N. As the number of robots is increased, the percentage of full matches after the propagation step is decreased because there are more outliers (and more inconsistencies). On the other hand, using any of the resolution algorithms, the percentage is kept at good values. Influence of the density of the network: In Fig. 3.10 we show the results considering different densities of the network and fixed number of robots, N= 8,and features, m= 50.With more communication links between robots our algorithms have a better performance. With few communication links it is more probable for a spurious match to pass undetected, whereas with more links, it will be easier to detect inconsistencies. This detection allows us to improve the results by deleting more spurious edges. Influence of the local matching: The quality of the function used for the local matching is a parameter that plays a fundamental role in our algorithm. In Figs. 3.8, 3.9 and 3.10 we can see that two different matchers can return very different results. In Fig. 3.11 we have considered 9 different matchers and evaluate their performance with N= 8, m = 50, δ = 0.5and = 0.2. The matchers have different values Distributed Consensus in Multi-Robot Systems with Visual Perception 54 4 6 8 10 12 14 16 0 20 40 60 80 100 NUMBER OF CAMERAS (n) FULL MATCHES (%) Figure 3.9: Number of matches against number of robots. 0 0.2 0.4 0.6 0.8 1 0 20 40 60 80 100 DENSITY OF THE NETWORK (δ) FULL MATCHES (%) Figure 3.10: Number of matches varying the network density. of ps,[S1, S2, S3] = [0.05,0.15,0.25], and different values of pm,[M1, M2, M3] = [0.1,0.25,0.5]. As expected, the performance is decreased when the number of missing links or the number of spurious links is increased. This makes sense, because if the local matching is poor, so will be the global association. It is interesting to note how the method is more sensitive to missing links than spurious links. This happens because with fewer links, and taking into account that we are only able to delete links, it is harder to obtain a full match, whereas with more links, even if there are several spurious, cutting the appropriate links the full matches are recovered. Nevertheless, in all the cases, using the resolution methods we obtain better results than just considering the matching given by the propagation of the local matches. S1M1 S1M2 S1M3 S2M1 S2M2 S2M3 S3M1 S3M2 S3M3 0 20 40 60 80 100 DIFFERENT MATCHING FUNCTIONS FULL MATCHES (%) P ST MEC Figure 3.11: Performance of different matching functions. In Fig. 3.12 we have repeated the same experiment but considering different values of , to see how the MEC is affected by this parameter. In this case we only show the performance obtained using the MEC method, because the propagation and the ST are not affected by this parameter. As expected, increasing the percentage of full matches is increased, because it is easier to recognize the spurious matches. However, this increase is very small, which introduces the question of why the MEC has a better performance than the ST, when the quality of the links does not seem to be an important factor in the final result. The answer to this question is 3. The Data Association Problem 61 Table 3.2: Results for the data association of stochastic maps Comm. graph (a) (b) (c) AFTER PROPAGATION Total Features 194 194 194 Total Links 82 93 111 Inconsistencies 2 6 8 Incons. feats. 8 35 49 Incons. Links 6 33 53 Full Matches 55 49 46 Partial Matches 4 3 2 Wrong Matches 10 7 6 SPANNING TREES Deleted Links 2 10 16 Full Matches 55 53 50 Partial Matches 6 5 6 Wrong Matches 12 13 15 MAXIMUM ERROR CUT Incons. Not Solved 0 0 1 Deleted Links 2 7 14 Full Matches 55 55 52 Partial Matches 4 3 3 Wrong Matches 12 11 11 Proofs Proof of Proposition 3.3.2 (Limited Communications) By the definition of the operations in lines 6 and 9 of Algorithm 1 we can see that the components of yi rchange their value at most once during the whole execution, for all i∈ V, r ∈ Si.This means that it is not necessary for the robots to send the whole blocks yi rto their neighbors but just the indices of the components that have changed their value from false to true. Each element can be identified by two data, the row and the column and there are a total of m2 sum elements. Therefore, in the worst case, the amount of transmitted information through the network during the whole execution of the algorithm now is 2m2 sum. Proof of Proposition 3.3.3 (Correctness) Let yi r(t)be the number of components in yi r(t),such that [yi r(t−1)]u= 0 and [yi r(t)]u= 1, u = 1, . . . , msum. This number represents the number of new paths found in Gdis at time instant tthat includes the features r. These new paths come either from the execution of line 6, or the execution of line 9. Let tibe the first time instant such that yi r(ti) = yi r(ti−1) ∀rand yi r(ti) = 0 because no component has changed its value from zero to one for any of the features. This means that, for any feature in Si,there are no new paths with other features. By the physical properties of a path, it is obvious that if there are no new features at minimum distance ti,it will be impossible that a new feature is at minimum distance ti+ 1.In addition, if no new paths at distance ti+ 1 can be found, line 9 of Algorithm 1 will not find new paths either. At this point the condition of line 12 is true and the algorithm ends. Since the solution of the algorithm is equivalent to the computation of the powers of the adjacency matrix, conditions (3.7)-(3.8) can be applied to [yi r]uto detect conflictive features. Distributed Consensus in Multi-Robot Systems with Visual Perception 62 Proof of Theorem 3.3.4 (Limited Iterations) We already know that the algorithm finishes in at most dfiterations. In the case that the matching does not contain any inconsistency df≤2Nand the result is valid. Now let us suppose that there is one inconsistency. This implies that the communication graph, G,contains one cycle of arbitrary length, `. We divide the number of iterations in three parts. First N−`iterations are required to ensure that the information of all the features belonging to the robots outside the cycle reaches at least one robot in the cycle. The second part requires 3 4`+ 1 iterations. In the worst case, the diameter of the subgraph defined by the cycle is `/2and only `+ 1 features in the cycle form the inconsistency, which means that only one robot will execute, at some point, lines 8-10 of Algorithm 1. It is clear that after `/2+1 iterations there will be at least two robots in the cycle, at maximum distance from each other (`/2), with all the information. One of the robots, the one with the inconsistency, will obtain the information from the execution of 8-10 in Algorithm 1. The other robot is the one with the common feature, detected in lines 8-10 of the algorithm by the first one. After this point `/4iterations are required to share this information with the rest of the robots in the cycle and we can ensure that all the robots in the cycle have all the information about the inconsistency. If there are more than `+ 1 features inside the cycle forming the inconsistency the result is still valid. With all the robots in the cycle knowing all the features that form the inconsistency, the number of additional iterations required to transmit the information to the rest of the network is upper bounded again by N−`. If we sum all the iterations we obtain 2N−5 4`+ 1.Since the minimum length of a cycle is 3the above quantity is always lower than 2N. Proof of Proposition 3.4.2 (Number of Partitions) Each conflict-free component can contain, at most, one feature observed by each robot i∈ Vinc. Then there must be, at least, maxi∈Vinc ˜mi= ˜mi?components. Proof of Proposition 3.4.5 (Convergence) The features involved in the inconsistency form a strongly connected graph. For a given graph, the max consensus update is proved to converge in a finite number of iterations [18]. For any r, s ∈ C such that [EC]r,s ≥0, by eq. (3.11) and the symmetry of EC,the final consensus values of zrand zssatisfy, element to element, that zr≥zsPrs and zs≥zrPsr.(3.16) Using the properties of the permutation matrices, Prs =Psr =P−1 sr ,we see that zsPrs ≥zr,which combined with eq. (3.16) yields to zr=zsPrs. For any feature, r, taking into account eq. (3.12), the update of the rth element of zr,[zr(t+ 1)]r,is [zr(t+ 1)]r= max s∈C,[EC]r,s≥0([zr(t)]r,[zs(t)]s).(3.17) Recalling the first point in assumption 3.4.3, the initial value of [zr(0)]r=err = 0,for all r, then [zr(t)]r= 0,∀t≥0. Proof of Theorem 3.4.6 (Values for Bridges) First note that (s, u)is a bridge, therefore it creates a partition of Cin two strongly connected, disjoint subsets Cs={r∈ C | d(r, s)< d(r, u)}, 3. The Data Association Problem 63 Cu={r∈ C | d(r, u)< d(r, s)}.(3.18) In the above equations it is clear that s∈ Csand u∈ Cu. We will focus now on the values of the sth element of the state vector for the nodes in Cuand the uth element for the nodes in Cs, [zr(t)]u, r ∈ Cs,and [zr(t)]s, r ∈ Cu. In the first case, for any r∈ Cs\s, update rule (3.12) is equal to [zr(t+ 1)]u= max r0∈Cs,[EC]r,r0≥0([zr(t)]u,[zr0(t)]u),(3.19) because r6=u6=r0.The nodes in Cuare not taken into account because that would mean that (u, s)belongs to a cycle and it is not a bridge. The special case of feature shas an update rule equal to [zs(t+ 1)]u= max r0∈Cs,[EC]s,r0≥0([zs(t)]u,[zr0(t)]u,[zu(t)]s).(3.20) In a similar way the updates for features in Cuare [zr(t+ 1)]s= max r0∈Cu,[EC]r,r0≥0([zr(t)]s,[zr0(t)]s), [zu(t+ 1)]s= max r0∈Cu,[EC]u,r0≥0([zu(t)]s,[zr0(t)]s,[zs(t)]u). Considering together all the equations and the connectedness of Cuand Cs, all these elements form a connected component and they will converge to [zr(t)]u,[zr0(t)]s→max r∈Cs, r0∈Cu ([zr(0)]u,[zr0(0)]s).(3.21) Since all the features r∈ Cs\sare not associated with u, [zr(0)]u=−1.Analogously, for all the features r∈ Cu\u, [zr(0)]s=−1.Finally, for the features uand s, by the second and third point of assumption 3.4.3, [zu(0)]s=eus =esu = [zs(0)]u≥0>−1.Therefore this subset of elements of the state vectors converge to the error of the edge (u, s), eus. Proof of Theorem 3.4.7 (Values for Cycles) We will use the following lemma to proof the result Lemma 3.6.1. Let us consider a feature u, such that it is an articulation vertex, defined as a node in Cwhose deletion increases the number of connected components of C. Denote Cuand Cu0the two partitions generated by its deletion. For any r∈ Cu, s ∈ Cu0,[zr(t)]swill converge to the same value as [zu(t)]sand [zs(t)]rwill converge to the same value as [zu(t)]r.Moreover [zr(t)]uwill converge to a different value than [zs(t)]u. Proof. Considering the fact that uis the only feature that connects Cuand Cu0,the permutations in (3.12) for elements in Cumatched with uwill not change the value of the components related to elements in Cu0and viceversa. On the other hand the permutations will affect the value of the [zr(t)]uand [zs(t)]ufor features matched to u, shifting it to different positions in the two partitions. Then using Proposition 3.4.5 the result holds. Distributed Consensus in Multi-Robot Systems with Visual Perception 64 Proof of Theorem 3.4.7 Let ¯ C`=C \C`be the rest of the features in the inconsistency. Given a feature r∈¯ C`there exists a unique s∈ C`such that there is at least one path of features in ¯ C`that ends in s. The uniqueness of scomes from the fact that if there were another feature s0∈ C`,reachable from rwithout passing through s, that would mean that ris also part of the cycle. Note that this does not discard the possibility that rand sbelong to another cycle different than C`.Also note that s= arg mins0∈C`d(r, s0). Since sis the only connection with C`, then it is an articulation vertex and, by Lemma 3.6.1, for any s0∈ C`\s, [zr]s0will have final value equal to [zs]s0.Therefore, if we show that (3.15) is true for the features belonging to the cycle then the theorem is proved. Let us see what happens to features inside the cycle. First note that r= arg mins∈C`d(r, s),∀r∈ C`, and therefore, by Proposition 3.4.5, this element is always zero. Now, for any r∈ C`,if we consider another element s∈ C`,such that ris not directly matched to it, the update rule (3.12) is [zr(t+ 1)]s= max u∈C`,[EC]r,u≥0([zr(t)]s,[zu(t)]s).(3.22) We have omitted other possible features that are directly matched to rand that do not belong to C`because they cannot be matched to s, otherwise they would belong to C`, and then, because of Lemma 3.6.1, they do not affect to the final value of [zr]s. The special case of features in the cycle, s0,directly matched to shas update rule equal to [zs0(t+ 1)]s= max u∈C`\s,[EC]s0,u≥0([zs0(t)]s,[zs(t)]s0,[zu(t)]s). Due to the permutation, [zs0]sdepends on the value of [zs]s0.Then, by Proposition 3.4.5 and the connectedness of the cycle, in the end [zr]swill have the same value for all r∈ C`\s, and equal to the final value of [zs]s0,for any s0in the cycle directly associated to s. By applying the same argument for any other element corresponding to a feature in C`we conclude that after the execution of enough iterations of (3.12), for any r∈ C`,[zr]s= [zr]s0,∀s, s0∈ C`\r. Thus, each feature inside the cycle will end with `−1elements in its state vector with the same value, the maximum of all the considered edges, and (3.15) is true. Proof of Theorem 3.4.9 (Properties of the Spanning Trees resolution) (i)The maximal depth of a conflict-free component is Nsince, if there were more features, at least two of them would belong to the same robot. Then, after at most Niterations of this algorithm, no more features are added to any component Cqand the algorithm finishes. (ii)There is a path between any two features belonging to a conflictive set C. Therefore, there is also a path in Gabetween any two features assigned to the same component Cq. Since the algorithm does not delete edges from Gawithin a component (case (a)), then Cqit is also connected in the new partition. (iii)By construction, two features from the same robot are never assigned to the same component Cq(case (c)). Therefore, each component is conflict-free. (iv)Each conflictive set has more than one feature. Because of Assumption 3.2.1, each feature and its neighbors are conflict free. Therefore, each component Cqcontains, at least, its originating feature, and a neighboring feature. Thus, it has at least two features. Chapter 4 De-RANSAC: Distributed Robust Consensus “Robustness is the ability of a system to cope with errors during the execution.” This property is essential in any robotic system. A reliable robotic network must be able to fuse its perception of the world in a robust way. Data association mistakes and measurement errors are some of the factors that can contribute to an incorrect consensus value. In this chapter, we present a distributed scheme for robust consensus in autonomous robotic networks. The method is inspired by the RANSAC (RANdom SAmple Consensus) algorithm. We propose a distributed version of this algorithm that enables the robots to detect and discard the outlier observations during the computation of the consensus. The basic idea is to generate different hypotheses and vote for them using a dynamic consensus algorithm. Assuming that at least one hypothesis is initialized with only inliers, we show theoretically and with simulations that our method converges to the consensus of the inlier observations. 4.1 Introduction In the previous chapter we provided the network with an algorithm able to find correspondences between all the observations of the robots. In a perfect setup, this would be enough to compute the consensus. Unfortunately, in a real scenario there is still the possibility that the given data association contains spurious correspondences. This can be due to inconsistencies wrongly solved in our previous algorithm or by mistakes caused by the local matcher and undetected by our method, as mentioned in Remark 3.3.8. One of the most important properties that any robotic system requires is robustness against different types of failures. A major drawback of the standard distributed averaging algorithm is the lack of robustness to erroneous values. That is, the consensus value can be severely affected by wrong sensor measurements or outliers. Without proper mechanisms that ensure the rejection of the spurious information while fusing the data, the final consensus estimate can be highly unreliable. An example of this problem is illustrated in Fig. 4.1. Five robots are looking for an exit door Door 1 Door 2 Window Limited communications Spurious Information Good Information Figure 4.1: Five robots are looking for the exit door of a room. Two of the robots have wrong estimates that must be discarded in the fusion algorithm. The proposed algorithm solves this problem in a decentralized way. 65 66 of a room. Due to perception or data association mistakes, two of the robots have measurements of another door and a window. If the information is fused together without additional control mechanisms, the identified exit door location will be biased and unreliable. This chapter focuses precisely on this aspect and aims to find a distributed algorithm that can solve this problem. Different approaches have been proposed to cope with noisy information in distributed consensus algorithms. The works in [59, 72, 118] are focused on the optimal mix of the measures minimizing some error function, but do not consider situations in which some of the measurements are spurious and must be discarded from the fusion. Similarly, channel noise is addressed in [73, 154]. These works assume that each message introduces additive noise in the estimations of the nodes and propose solutions to guarantee convergence to the desired result. Faulty nodes or malicious agents are treated in [45, 46, 116, 139, 140]. The main idea of these approaches is that the faulty nodes’ actions depart from the expected behavior and the good nodes are able to detect them. Compared to all these approaches, we assume that the communication protocol used by the robots guarantees the reception of the sent information without noise. The robots in the network are cooperative and behave as expected; however, some of them have outlier information. We deal with the problem of identifying the robots with outlier information and discarding their contributions to the final consensus value. In computer vision, RANSAC (RANdom SAmple Consensus) [43] is a widely used algorithm for robust matching between pairs of images. In the last few years, new variations to the basic algorithm have been presented [26, 28, 104]. However, none of these algorithms are implementable over distributed networks. The closest approach to a distributed scenario can be found in [156]. There, the information to be fitted is separated in several non-overlapping subsets and the hypotheses are generated choosing data from them. However, the whole process is still centralized. The main contribution of this chapter is a new robust distributed consensus method, De-RANSAC, in which the outlier observations are identified and the consensus is achieved discarding their information. Our approach extends RANSAC to a distributed setup. Briefly, the RANSAC steps can be summarized as follows: • Create random hypotheses with subsets of observations. • Choose the best hypothesis using a voting process. • Compute a better model considering only the observations that voted the best hypothesis as good. Our algorithm executes the same three steps in a fully decentralized fashion, computing a robust consensus. Moreover, in our approach robots are allowed to change their opinion, making the voting process dynamic and executing the three steps simultaneously. The algorithm expands the utility of RANSAC by adding a new set of applications where it can be used in the field of sensor networks, such as robust localization of events of interest [131], face recognition [145], distributed labeling [69] or collaborative sensor-bias calibration [19]. As such, our algorithm can be seen as a contribution to this body of literature. Additionally, the chapter presents two other contributions: • Two extensions of the averaging rule to allow robots without an observation to participate in the consensus process and to guarantee convergence in finite time when the consensus value has finite precision. • A distributed averaging primitive to compute the number of active robots in a network. Since De-RANSAC makes use of these extensions, we start the chapter by explaining them in detail and then focus on the outlier detection problem. The work presented here has been discussed in [87–89] 4.2 Distributed Averaging using homogeneous coordinates As we have seen in the previous chapter, using our data association algorithm there might be elements for which not all the robots have an observation. The general averaging algorithm requires all the robots to have some 4. De-RANSAC: Distributed Robust Consensus 67 initial value to introduce in the algorithm. We propose a modification of the algorithm to obtain an average of the measurements of a subset of the robots without excluding from the linear iteration any of the participating robots. The modification makes use of another classic concept in computer vision, homogeneous coordinates. The homogeneous coordinates of a d1-dimensional vector are defined as a (d1+ 1)-dimensional vector where the additional coordinate is used as a scaling factor [57]. In this way all the vectors with the form (x,1) ≡(ρx, ρ),are equivalent in the projective space for any ρ6= 0. Let xh i(t)be the scale coordinate of the robot iat time instant t. We will define the extended measurements of the robots, xe i(t) = [xi(t), xh i(t)], as the measurements expressed in homogeneous coordinates. Let Vh∈ V be the set of robots that have some initial information to fuse in the consensus process. Each robot initializes its extended measurement with the following rule: xe i(0) = ([xi(0)T,1]Tif i∈ Vh 0Totherwise (4.1) Since the robots know if they belong to Vh,there is no synchronization required for this. Theorem 4.2.1 (Consensus with homogeneous coordinates).If Vh6=∅,then the iteration rule (2.2), applied to xe i(t)with the initial conditions defined in (4.1) converges, in normalized coordinates, to xe i(t)→[1 |Vh|X j∈Vh xj(0)T,1]Tas t→ ∞ ∀i∈ V. Let us note that this idea can also be used in situations in which one robot has lost its sensor due to any kind of failure but its communication capabilities remain intact or, as we will see, when there is one or more robots with information that we do not want to mix in the consensus. 4.2.1 Averaging in Finite-Time For general graph-switching sequences, the asymptotic convergence of (2.2) does not achieve convergence in a finite number of steps. However, when consensus involves integers or real numbers with a finite precision this is possible. Definition 4.2.2. We will say that Φ⊆Rd2is a ϕ-set, ϕ∈R, d2∈Nif ∀x,x0∈Φ |xk−x0 k| ϕ∈N,∀k= 1, . . . , d2,(4.2) with xk, x0 kbeing the kth component of x,x0respectively. Considering the examples above mentioned, the set of integers, Z,is defined as a 1-set and the set of reals with sdecimal digits as a 10−s-set. We introduce next a modification of the standard consensus algorithm when dealing with elements in a ϕ-set. The idea of the new rule is to keep the distributed update in (2.2) and combine it with a rounding rule that returns the closest element in Φ.If the average, or the value of some function evaluated in the average, belongs to Φ,then the algorithm will reach the exact consensus value for all the robots in finite time. Theorem 4.2.3 (Distributed Averaging in Finite-Time).Let g(x)be a continuous function, g:Rd1→Rd2 and xi(0) ∈Rd1be initial conditions with ¯ x=1 NPi∈V xi(0) their average. Given Φas a known ϕ-set, if g(¯ x)∈Φ,then the iteration      xi(t+ 1) = wii(t)xi(t) + X j∈Ni(t) wij(t)xj(t), ˆ ¯ x(t+ 1) = arg min x∈Φkx−g(xi(t))k2, (4.3) Distributed Consensus in Multi-Robot Systems with Visual Perception 68 leads to the finite-time convergence of the variables ˆ ¯ xto the consensus value g(¯ x).That is, ∃t∗>0| ∀t>t∗,ˆ ¯x(t) = ˆ ¯x(t∗) = g(¯x),∀i∈ V. The proposed rule converges in finite time to the same value for all the robots. The additional required information is the value of ϕ, which is easy to know before running the application. Examples of different functions that can be used within this algorithm are provided ahead in the chapter. 4.2.2 A Distributed Primitive for Robot Counting The number of robots participating in the consensus is another information that in many situations will be useful for the team, but that may not always be available. We propose a distributed algorithm that allows a network to compute the number of robots participating in the consensus process. The algorithm is based on distributed averaging combined with a max-consensus rule. The idea of the algorithm is to make the network evolve in such a way that the sum of the initial conditions is equal to one. Since the average value is divided by the total number of robots involved in the computation, the system will tend to 1/N and every robot will be able to know how many robots are participating. Let Ni(t), i ∈ V, be the estimated value of Nthat robot ihas at time instant t. In order to make Ni(t)→N the robot exchange a 2-dimensional vector, β,initialized as βi(0) = (IDi,1)T,(4.4) where IDiis the identifier of robot iin the network, which by Assumption 2.2.1 is different to all the others identifiers. At each time step the robots update their values βi1(t+ 1) = max(βi1(t), βj1(t)), j ∈ Ni(t),(4.5) βi2(t+ 1) = wii(t)βi2(t) + X j∈Ni(t) wij(t)βj2(t) + ui(t+ 1),(4.6) denoting βi1(t)and βi2(t)as the first and second component of β(t)that robot ihas at time instant tand wij(t) as defined in Assumption 2.3.3. In eq. (4.6), the initial input is set to zero, ui(0) = 0,and for the rest of time instants is defined as ui(t+ 1) = (−1,if βi1(t)6= IDiand Pt s=0 ui(s)=0 0,otherwise (4.7) Theorem 4.2.4 (Distributed Robot Counting).If all the robots have initial values, β,defined in (4.4) and update their states using (4.5) and (4.6), then, for all i∈ V, 1. βi1(t)→maxi∈V IDi,in finite time. 2. βi2(t)→1 Nas t→ ∞. 3. The iteration rule Ni(t) = arg min n∈N|n−1 βi2(t)|,(4.8) converges to Nin finite time. 4. De-RANSAC: Distributed Robust Consensus 69 4.3 Outlier Detection with RANSAC Before proposing our robust distributed algorithm, let us first consider the problem of robust estimation and outlier detection in a centralized setup. In this case a central computer has access to the samples of all the robots, X={xi(0)}, i ∈ V.In centralized scenarios, a widely used algorithm for robust estimation and outlier detection is the RANSAC algorithm [43]. This algorithm was proposed to estimate the parameters of a model that can be used to explain a set of sampled data in the presence of spurious information. The basic idea of RANSAC is to generate a limited number, K > 0,of hypothetical models, also called hypotheses, using random subsets of samples, and then select one of the models using a voting system. The algorithm makes the following assumption, which we keep in our distributed version of the method. Assumption 4.3.1. RANSAC assumes that: • Each sample has independent probability, 0< pin ≤1,of being inlier information. • There exists a procedure to estimate a hypothetical model to fit the data using at least csamples. • If a model is generated using cinlier samples, then the model fits all the inliers. In order to decide how many hypotheses generate, RANSAC uses a stochastic approach. Each hypotheses is generated by randomly choosing csamples from Xand computing the model that fits this subset. Considering Assumption 4.3.1, the probability of one hypothesis to be composed only by inliers is (pin)c. Therefore, the probability that one hypothesis contains at least one outlier is 1−(pin)c. Defining psuc as the desired probability to generate one hypothesis using only inlier samples, then Kmust be K=log(1 −psuc) log(1 −(pin)c).(4.9) The larger psuc is chosen, the better the algorithm will work but at the cost of having a larger K, which will imply more computations. After that, the algorithm uses a voting system to rank all the hypotheses. Given a threshold τ > 0, and an error function, we say that x∈Xis an inlier with respect to one hypothesis, h, if e(x, h)≤τ, and then votes for it vote(x, h) = (1, e(x, h)≤τ, 0, e(x, h)> τ. (4.10) The selection of τdepends on Xand the model to fit. Small values of τwill return more accurate results but they might discard some possible inliers. With all the hypotheses voted, RANSAC chooses the one with the most votes, h∗= arg max k=1,...,K(X x∈X vote(x, h`)) (4.11) and determines a better model using the subset of inliers for h∗; i.e., Xh∗={x∈X|e(x, h∗)≤τ}. Considering again the distributed scenario, note that, even if all the robots had access to all the samples, RANSAC could not be used independently by each robot to detect the outliers because it is a non deterministic algorithm. Two different executions of the algorithm can return different results and therefore, additional mechanisms are required to ensure that all the robots achieve the same result. Distributed Consensus in Multi-Robot Systems with Visual Perception 70 4.4 De-RANSAC: Robust Consensus Algorithm In this section we provide a distributed solution to detect the outliers and compute the robust consensus. The process is inspired by the RANSAC algorithm. In order to make it distributed, several issues need to be addressed: • The first problem is the generation of the hypotheses by the network. • The second issue to consider is how these hypotheses are voted for by all the robots. • The last problem, once the best hypothesis has already been selected, is the computation of the final solution using only inlier information. Along the section we explain how these issues are handled in our algorithm. 4.4.1 Distributed Generation of Random Hypotheses The number of hypotheses required to have a probability of success equal to psuc is the same as in the centralized case, eq. (4.9). However, each robot initially has only one sample, its own information, xi(0). We will denote by Vin ⊂ V the subset of robots with inlier information. Following the RANSAC principles, we assume that each observation has equal probability of being a good observation pin independent from the probability of the rest of observations. Therefore, the number of hypotheses, K, is exactly the same as in the centralized case, eq. (4.9). The value of Kdepends on the number of samples required to generate one hypothesis. Since we are considering the average as our consensus objective function, we define one hypothesis as the average of a subset of the observations. Then, the number of samples, c, can be chosen arbitrarily. We discuss the selection of this parameter in the simulations. For one hypothesis, h, let ∅6=Vh⊆ V be the subset of crobots whose observations generate the hypothesis. Given a fixed c, to build one hypothesis hwe require crobots to belong to Vh,|Vh|=c. We use a max consensus algorithm with random initial conditions to decide which crobots form the subset. Initially, each robot generates a random number hi>0and the hypothesis set hi(0) = {hi},which is updated using hi(t+ 1) = maxc(hi(t)[ j∈Ni(t) hj(t)),(4.12) where maxcselects the cmaximum elements of the set. After the execution of (4.12), hiwill converge to the cmaximum values of the network for all i. Assuming that each robot generates a different random number the subset Vhis established as Vh={i∈ V |hi∈hi(dv)}.(4.13) Let us note that each robot knows if it belongs to Vhin a local way. The process can also be executed for all the hypotheses in parallel. Once the robots know if they should contribute with their observations to generate a specific hypothesis, they can initialize their value for that hypothesis using eq. (4.1). The hypotheses are computed by the whole network using distributed averaging. We denote by xhthe average of the observations of the robots in Vh. By Theorem 4.2.1, we can assure that all the robots will eventually have the value of each hypothesis. 4.4.2 Distributed Voting of the hypotheses With all the hypotheses created, the robots must vote for them in order to select the best one. We propose a general procedure to vote the hypotheses based on distributed averaging. 4. De-RANSAC: Distributed Robust Consensus 77 −100 −80 −60 −40 −20 0 20 40 60 80 100 −100 −80 −60 −40 −20 0 20 40 60 80 100 Figure 4.2: Sensor network deployed in the environment to detect events of interest. There are 20 sensors that measure the first event (black circles and black star), 16 sensors that measure the second event (white circles and white star) and 4 sensors that measure a random value (grey circles). event (black circles and black star), 16 sensors that measure the second event (white circles and white star) and 4 sensors that measure a random value (grey circles). If all the measurements are mixed using distributed averaging, then the mean position of the event is placed at (3.72,−13.85), which is a wrong estimation. Next we show how our algorithm can overcome this problem. Initially the nodes do not know how many other sensors are active due to failures, initialization, etc. Figure 4.3 shows the evolution on the consensus about the number of active nodes using the finite-time rule. The final value is 40, the exact number of active sensors, for all the nodes in the network. 100 200 300 400 500 600 700 20 25 30 35 40 45 50 55 60 Consensus on the number of agents (Ni) Steps Number of agents Figure 4.3: Finite-time consensus about the number of active sensors. The hypotheses are defined as possible locations of the event of interest. We generate the hypotheses computing the average location of sets of two samples, i.e., c= 2.We have run two simulations considering two different values of the probability of a sensor having inlier information, pin. In the first one we have set pin to 0.8and in the second to 0.3. The probability chosen to decide the total number of hypotheses, eq. (4.9), in order to be successful in creating one good hypothesis has been taken to be psuc = 0.99. The threshold for voting one hypothesis considers the Euclidean distance between the location of the hypothetical event and the Distributed Consensus in Multi-Robot Systems with Visual Perception 78 sensor observation of the event the hypothesis has been set to 2meters. The first column of Figure 4.4 shows the evolution of the number of votes of the best hypothesis using the finite-time consensus rule and the achievement of the final consensus value (X and Y coordinates). The best hypothesis gets a total of 20 positive votes, which is exactly the number of sensors perceiving the event located in (−40,40). Regarding the final consensus value, considering only the 20 inliers, we observe that using the homogeneous coordinates all the 40 sensors reach the same value, the correct location of the event. 0 50 100 150 200 250 300 0 5 10 15 20 25 30 35 40 Consensus on the number of votes Steps Number of votes 0 50 100 150 200 250 300 0 5 10 15 20 25 30 35 40 Consensus on the number of votes Steps Number of votes 0 100 200 300 400 500 600 −42 −41 −40 −39 −38 −37 Final Consensus Value X Steps Consensus value 0 100 200 300 400 500 600 67 68 69 70 71 72 73 Final Consensus Value X Steps Consensus value 0 100 200 300 400 500 600 −43 −42 −41 −40 −39 −38 −37 Final Consensus Value Y Steps Consensus value 0 100 200 300 400 500 600 28 28.5 29 29.5 30 30.5 31 31.5 32 Final Consensus Value Y Steps Consensus value a b Figure 4.4: Consensus in the different steps of De-RANSAC for the robust event localization. The first column (a) shows, from top to bottom, the finite-time consensus on the number of votes of the best hypothesis (20 votes) and the final consensus value (X and Y coordinates) mixing only the inlier measurements, using the normalized coordinates. The second column (b) shows the same values for the next best hypothesis. In this case the number of votes is 16 and the final consensus value is the location of the second event of interest. More detailed results of the two simulations are in Table 4.1. The Avrg column shows the location of the event mixing the information of all the sensors, which is equal and wrong in both cases because of the influence of the outliers. Rob_Av represents the value of the most voted hypotheses. Since De-RANSAC is 4. De-RANSAC: Distributed Robust Consensus 79 non deterministic, this value differs for different executions. Nevertheless, let us notice that in both cases the distance with respect to the real value (−40,−40) is smaller than the tolerance fixed. Fin_Av shows the consensus value considering only the inlier nodes. In this case both experiments return the same result (the average of the inliers) because all the inliers have been identified and they are computing the average of the same set of measurements. Kis the number of hypotheses created. By choosing a bigger value of pin we can reduce the total number of hypotheses, and therefore, of required communications. Table 4.1: Results of the Event Localization using De-RANSAC Case pin Avrg Rob_Av Fin_Av Votes K 1 0.8 (3.72, -13.85) (-40.36, -38.66) (-40.12, -40.3) 21 7 2 0.3 (3.72, -13.85) (-39.27, -39.91) (-40.12, -40.3) 21 74 Another advantage of the evaluation of multiple hypotheses with De-RANSAC is that without additional computations we can identify the position of the second event of interest, located in (70,−30). Once the best hypothesis has been identified, the sensors select the next most voted hypothesis such that: • They did not vote for it if they were inliers. • They voted for it if they were outliers. The number of votes and the average of the positive votes for this hypothesis are shown in the second column of Figure 4.4. We can see that in this case the number of votes is 16 and the average of the positive votes for this hypothesis reaches the correct value. 4.6.2 People Identification in Camera Networks We reintroduce the problem of face recognition in multiple images first discussed in the previous chapter. We show how De-RANSAC can be applied as a second step in the procedure to improve the initial data association. Figure 4.5 shows the initial correspondences of the network found using our data association distributed algorithm. In this example there are no inconsistencies and all the cameras are able to assign one face to each association set. However, there are some outlier matches, e.g., faces 2 and 4 have been wrongly matched in cameras A and B. We can use De-RANSAC to discard mismatches and improve the data association. A 3 124 B 1 243 C 3 1 24 D 42 3 1 E 3 14 2 F 34 2 1 Figure 4.5: Initial People Association in Camera Networks. Since De-RANSAC considers only one datum per node, the algorithm is executed in parallel for each of the association sets given by the data association, represented with different colors in Fig. 4.5. We define one Distributed Consensus in Multi-Robot Systems with Visual Perception 80 hypothesis as a weighted average of two patches. Assuming the initial data association is relatively good, we set pin to 0.9, which implies that each camera only generates one hypothesis. The error function to detect outliers is the same function used to match the faces (absolute differences between pairs of patches) and the threshold has been empirically set considering the errors obtained comparing patches in the data association step. The result of applying De-RANSAC is shown in Fig. 4.6. The algorithm has been able to detect that faces 2 and 4 were outliers in cameras A and B and has removed these matches. Also, in faces 1 and 3 the algorithm has not removed any match. On the other hand, the algorithm has also considered as an outlier face 4 in camera C, which was not. This happens because of choosing a restrictive threshold for the voting. A possible way to improve this could be to use a smaller threshold in the error function to vote for the hypotheses. However, in a real application the lack of spurious matches prevails over missing some good correspondences. A 3 124 B 1 243C 3 1 24 D 42 3 1 E 3 14 2 F 34 2 1 Figure 4.6: Robust People Association in Camera Networks. 4.6.3 Maximum Likelihood Estimation using Dynamic Voting We have also tested the dynamic version of the algorithm for the computation of the maximum likelihood in a simulated environment. In this case we have considered a robotic network composed by ten robots with communications as described in Fig. 4.7. Figure 4.7: Communication network of the ten robots. Blue circles represent the robots with inlier information and red squares the outliers. In Fig. 4.8, we show the observations of a two-dimensional feature by the ten robots. We have chosen a two-dimensional feature in order to have a good visualization of the results, however, the algorithm is not restricted to this case and can be used with descriptors of any dimension. Seven robots have good observations of the feature (blue crosses and solid ellipses) and 3 robots have outlier information (red crosses and dashed 4. De-RANSAC: Distributed Robust Consensus 81 ellipses). If all the measurements are considered in the computation of the Maximum Likelihood, the obtained result is the black cross and dash-dotted ellipse with the ML mark at value (−0.21,4.60) while the ML of the inlier robots is (3.08,5.19) (MLin). −8 −6 −4 −2 0 2 4 −5 0 5 10 ML MLin Observations of the robots X(m) Y(m) 0 1 2 3 4 5 2 3 4 5 6 7 8 9 ML MLin Observations of the robots X(m) Y(m) (a) Observations of the robots (b) Observations of the inliers (zoom) Figure 4.8: Robust sensor fusion of a bi-dimensional feature observed by ten robots. (a) Observations of the ten robots. Seven robots have a good observation of the feature (blue crosses and solid ellipses) whereas three robots have observed another features (red crosses and dashed ellipses). If all the measurements are considered in the computation of the Maximum Likelihood, the obtained result is the black cross and dash-dot ellipse with the ML mark. The good maximum likelihood is the one in the middle of the inlier observations (MLin). (b) Zoom of the inlier observations and both ML. In the first step, the robots generate the different subsets Vhthat will initialize the hypotheses. In the experiment we have set the probability of being an inlier to 0.6and the probability of success in RANSAC to 0.99.As we mentioned in Section 4.4.1, the value of ccan be arbitrarily chosen. Larger values of cmake many robots to plug their observations at the beginning, which is good if the number of inliers is large. However, the larger the c, the more hypotheses will be required to succeed, and for each additional hypothesis the amount of information to be communicated among robots grows linearly. For this reason we have set c= 1 resulting in a total of 6 hypotheses generated by the algorithm. In this example, the conditions stated in section 4.5 are also satisfied, ensuring convergence to the ML of the inliers if one hypothesis is instantiated by robots in Vin. In Fig. 4.9, we show the evolution of the two coordinates of θi(t)for the most voted hypothesis. The values of the different robots converge to the value of the ML of all the inliers (depicted in black dashed line in the graphics). In Fig. 4.10, the evolution of υi(t)for the same hypothesis is depicted. Eventually all the robots 0 10 20 30 40 50 60 70 2.6 2.8 3 3.2 3.4 3.6 Evolution of X (ML of most voted h) Iterations X(m) 0 10 20 30 40 50 60 70 4.6 4.8 5 5.2 5.4 5.6 5.8 Evolution of Y (ML of most voted h) Iterations Y(m) (a) (b) Figure 4.9: Evolution of the Maximum Likelihood, θi(t),for the hypothesis that has obtained the most number of votes in the end. The dashed black line is the value of the ML of the robots with inlier information. It is observed that in both coordinates the values of θi(t)asymptotically converge to it. Distributed Consensus in Multi-Robot Systems with Visual Perception 82 reach the value 0.7,which is exactly the fraction of robots with inlier information. It is also remarkable that the number of iterations in which the robots change their opinion is considerably small. In less than 10 iterations, the graphics do not have discontinuities due to the inputs (4.22). After that point, the algorithm behaves as a static consensus algorithm. 0 10 20 30 40 50 60 70 0 0.2 0.4 0.6 0.8 1 1.2 Evolution of V (Most voted h) Iterations V Figure 4.10: Evolution of υh∗ i.It converges to 0.7for all the robots, which is exactly the fraction of robots with inlier information. We have also run a Monte Carlo simulations considering more general situations where the conditions of Section 4.5 do not always hold. We have compared the results of the new algorithm with the robust consensus based on static voting and with the distributed consensus algorithm proposed in [155] to compute the ML of all the observations. We have run 1000 trials in which 20 robots have been considered. The probability for each robot to have inlier information has been set to 0.8,and only 3 hypotheses were generated in each trial. The inlier robots have measurements of the feature with gaussian error of zero mean and standard deviation of 2 meters. For the outlier robots we have assigned a deviation of 10 meters. The covariance matrices have also been randomly generated with eigenvalues of mean 0.5and standard deviation 0.5. Regarding the communication topology we have changed it at each iteration of each trial. The results obtained in the simulation can be seen in Table 4.2. The results using the non robust algorithm [155] are in the first column. In this case all the outliers participate in the different trials (a total of 4015). As a consequence, the average error in the estimation of the ML is large (2.06 meters). If the static voting method is used, the results are clearly improved. Only 375 false positive votes appear and the average error is reduced to 0.444 meters, with only 472 inliers thinking they have outlier information. Finally, if the proposed algorithm is used, 355 false positive votes are counted and the average error is of 0.438 meters. Moreover, since the robots are voting a dynamic observation which tends to the good ML, a fewer number of false negatives is registered (192). Although the results are similar to those of the static voting, the dynamic algorithm is much faster because it requires one third of communication rounds. The dynamic voting algorithm condenses the three steps of RANSAC in only one, requiring 100 iterations per trial. The only drawback of the robust algorithms with respect to [155] is that the size of the messages grows linearly with the number of hypotheses. However, this limitation is also found in the centralized version of RANSAC, where for each hypothesis a different solution must be computed and voted for. 4.7 Discussion Throughout this chapter we have analyzed in detail the problem of robustness in the computation of the consensus. We have proposed a new algorithm, De-RANSAC, able to detect and discard outlier measurements during the computation of the average consensus. The algorithm follows the philosophy of the RANSAC algorithm, a very common algorithm for robust matching between pairs of images. However, our algorithm is designed to be fully distributed, and then suitable for teams of robots with limited communications. 4. De-RANSAC: Distributed Robust Consensus 83 Table 4.2: Comparison of the different algorithms Method ML [155] Static Voting Dynamic Voting Trials 1000 1000 1000 False Positive Votes 4015 375 355 False Negative Votes 0 472 192 Avrg. norm of error 2.063 0.444 0.438 Std. deviation of error 2.502 1.275 1.256 Iterations per trial 100 300 100 Another good property of the proposed algorithm is its modularity. The use of distributed averaging techniques to detect the outliers allows to introduce variations of the standard algorithm able to handle, e.g., asynchronous communications [84] or robustness against malicious agents [45]. In this way, our method can handle other communication problems. This is actually what we have done to using the finite-time averaging to count the number of votes or the number of active robots. In addition, we have seen that homogeneous coordinates can be very helpful to compute the average when some of the robots do not have information, or when we do not want to introduce it in the fusion. We have also used dynamic consensus techniques to allow the robots to change their opinion during the voting. As a consequence, we have seen that the three steps of RANSAC can be executed in a single step with our algorithm. This reduces the number of communication rounds the robots need to exchange information. On the other hand, the robustness in the consensus implies the counterpart of communicating more information. Each hypothesis that the network generates increases the size of the messages exchanged by the robots. This can be a bit problematic when using visual information, since the amount of data required to exchange in such cases is generally big. Then, the next issue to analyze in our system is the reduction of the number of messages exchanged required to compute the average and the choice of a good representation of the information, so that it takes up a small amount of space. Proofs Proof of Theorem 4.2.1 (Consensus with homogeneous coordinates) The scale coordinate converges to xh i(t)→1 NX j∈Vh 1 = |Vh| N,(4.32) and the regular coordinates converge to xi(t)→1 NX j∈Vh xj(0).(4.33) The normalized coordinates of an homogeneous vector are its coordinates divided by the scale coordinate, xe i(t)/xh i(t), hence xe i(t) xh i(t)→[1 |Vh|X j∈Vh xj(0)T,1]T∀i∈ V.(4.34) Distributed Consensus in Multi-Robot Systems with Visual Perception 84 Proof of Theorem 4.2.3 (Distributed Averaging in Finite-Time) Taking into account Assumptions 2.2.6 and 2.3.3, we know that xi(t)in (4.3) will asymptotically converge to ¯ x for all the robots. Given ε > 0,the asymptotic convergence allows us to find t∗such that ∀t>t∗k¯ x−xi(t)||2< ε, ∀i∈ V. In addition, the continuity of gin ximplies that ∀ψ > 0,∃ε > 0|k¯ x−xi(t)k2< ε ⇒⇒ kg(¯ x)−g(xi(t))k2< ψ. Considering again the definition of the ϕ-set and that g(¯ x)∈Φ,by choosing ψ < ϕ 2, there exists t∗ depending on ε, and thus on ψ, such that for all t>t∗ kg(¯ x)−g(xi(t))k2<ϕ 2, and therefore arg min x∈Φkx−g(xi(t))k2<ϕ 2. Now, let us suppose that there exists some x∈Φ,x6=g(¯ x),such that for some t>t∗ kx−g(xi(t))k2<kg(¯ x)−g(xi(t))k2. This would imply kx−g(¯ x)k2≤ kx−g(xi(t))k2+kg(xi(t)) −g(¯ x)k2< ϕ, which by definition of Φis not possible. Then g(¯ x) = arg min x∈∆kx−g(xi(t))k2. Proof of Theorem 4.2.4 (Distributed Robot Counting) 1) The rule in (4.5) is a max consensus update rule. Under Assumption 2.2.6, the max consensus algorithm is proved to converge in a finite number of iterations for all the robots in the network [78]. 2) The sum of the initial conditions is Piβi2(0) = N. In order to compute the sum of the inputs, taking into account 1) and Assumption 2.2.1, we have that after some time instant t∗<∞,βi16= IDi,∀i\maxi∈V IDi. Since the initial input is equal to zero for all the robots, then, by (4.7), every robot but the leader (the one with ID equal to the max consensus) will have an input ui(t) = −1for some twithin the interval [2, t∗].After that, the sum of the previous inputs will be different from zero and, therefore, the future inputs will also be equal to zero. Thus t∗ X t=0 X i∈V ui(t) = −N+ 1 (4.35) Then, Piβi2(t∗)=1and ui(t)=0,∀i∈ V, t > t∗,which means that (4.6) behaves like (2.2) and βi2(t)→ 1 Nas t→ ∞. 3) Choosing g(x) = 1 x,which is continuous for any x6= 0 and satisfies that g(¯x) = N∈N,by direct application of Theorem 4.2.3 the result is proved. 4. De-RANSAC: Distributed Robust Consensus 85 Proof of Proposition 4.4.1 (Distributed Voting in Finite Time) First let us notice that υh i(0) is in the 1-set, υh i(0) ∈N,∀i∈ V,∀h. In this way, Pi∈V υh i(0) ∈N.We also know that Pi∈V υi(0) = N¯ υ=g(¯ υ).The function satisfies all the conditions of Theorem 4.2.3 and then convergence in finite time follows. Proof of Proposition 4.5.1 (Distributed Computation of a Partial ML) As stated in [155], Pi(t)and qi(t)converge to the average of the initial values of all the Pj(t)and qj(t), j ∈ V. However, the initial values for any robot j6∈ Vhare zero by eq. (4.20), therefore, for all i∈ V, it holds that lim t→∞ θi(t) = lim t→∞(Pi(t))−1qi(t) = = ( 1 NX j∈V Λ−1 j)−11 N(X j∈V Λ−1 jxi) = = ( 1 NX j∈Vh Λ−1 j)−11 N(X j∈Vh Λ−1 jxi) = θh ML Proof of Proposition 4.5.2 (Convergence of the Dynamic Voting Consensus) The sets T+ iand T− iare finite. This means that there is some time instant, tmax,that upper bounds T+ iand T− i,∀i∈ V.Moreover, ∀t>tmax and i∈ V,the value of χi(t)remains constant, which means that the robots do not change their opinion after tmax. Let us analyze the evolution of Pi(t).After tmax,the iteration rule (4.22) behaves like (2.2) because uP i(t) = 0for all iand t, and therefore, Pi(t)will converge to 1 NPi∈V Pi(tmax). The sum of the values of Pi(tmax)can be written as X i∈V Pi(tmax) = X i∈Vh Λ−1 i+X i∈V tmax X t=0 uP i(t),(4.36) where the sum of the inputs for each robot is tmax X t=0 uP i(t) = X t∈T + i Λ−1 i−X t∈T − i Λ−1 i= (|T+ i|−|T− i|)Λ−1 i.(4.37) By the eq. (4.24), for any robot i, −1≤ |T+ i|−|T− i| ≤ 1.At the beginning, for the robots in Vh,it holds that χi(0) = 1,because θi(0) = xi.Therefore, for any i∈ Vh, tmax X t=0 uP i(t) = (−Λ−1 iif χi(tmax)=0, 0otherwise,(4.38) The robots that do not belong to Vhcannot compute the distance because the inverse of Pi(0) is not defined; but this situation in our algorithm is equivalent to χi(0) = 0. Then we have that for any i6∈ Vh, tmax X t=0 uP i(t) = (Λ−1 iif χi(tmax)=1, 0otherwise,(4.39) Distributed Consensus in Multi-Robot Systems with Visual Perception 86 Putting together (4.36), (4.38) and (4.39), in the limit we have lim t→∞ Pi(t) = 1 NX i∈V Pi(tmax) = 1 NX i∈Vcon Λ−1 i,(4.40) Applying the same argument to qi(t),we obtain lim t→∞ qi(t) = 1 NX i∈V qi(tmax) = 1 NX i∈Vcon Λ−1 ixi,(4.41) and then eq. (4.26) holds. Finally, following the same reasoning with υi(t)eq. (4.27) is obtained and the proof is complete. Proof of Lemma 4.5.3 (Bounded Distances in the Convex Hull) Let us note that xi∈CH(Vin)for all i. For any point in the convex hull, the maximum distance to points inside the hull is achieved at one of the corner points. Since these points are observations that belong to Vin q(xi−x)TΛ−1 i(xi−x)≤max xj∈Vin q(xi−xj)TΛ−1 i(xi−xj)≤χ2 d1,p, and then χ(xi,x,Λi) = 1. Computation of the derivative in eq. (4.28) (Local maxima of the derivative) Let di(w) = q(xi−θi(w))TΛ−1 i(xi−θi(w)) (4.42) The distance function can be rewritten as di(w) = pd2(w), d2(w) = (xi−θi(w))TΛ−1 i(xi−θi(w)), θi(w) = P−1 i(w)qi(w). (4.43) We compute the partial derivative applying the chain rule. The partial derivative of θi(w)with respect to wjis a function of Pi(w)and qi(w),whose partial derivatives are ∂Pi(w) ∂wj =Λ−1 j,∂qi(w) ∂wj =Λ−1 jxj.(4.44) By passing the inverse matrix to the left member we have ∂Pi(w) ∂wj θi(w) + Pi(w)∂θi(w) ∂wj =∂qi(w) ∂wj .(4.45) Clearing ∂θi(w)/∂wjin (4.45) and plugging (4.44) yields ∂θi(w) ∂wj =P−1 i(w)Λ−1 j(xj−θi(w)).(4.46) 5. Fast Consensus with Chebyshev Polynomials 93 to be executed in blocks of kiterations, for some fixed k. In addition, when the topology of the network changes, the recurrent evaluation of Chebyshev polynomials (5.10) can still be used. The time-varying version of the algorithm is equivalent to (5.9) replacing the constant weight matrix Wby the weight matrix at each step W(n).Although this is no longer equivalent to the distributed evaluation of a Chebyshev polynomial, a theoretical analysis about its convergence is still possible. In addition, compared to (2.2), we can see that the iteration (5.10) transmits exactly the same information, xi(n−1). In terms of space requirements the robots only need to store one extra datum, xi(n−2), and the computation demands are also very similar because Tn(c−d)can be computed locally by each robot using (5.2). To design the algorithm we have assumed that the eigenvalues of Wwere in the interval [λm, λM]. However, in practice we do not know if these assumption is going to be true. In the next two sections we analyze the main properties of the algorithm as a function of the parameters and the eigenvalues of W, for fixed and switching communication topologies. Algorithm 5 Consensus algorithm using Chebyshev polynomials - Robot i Require: xi(0),MaxIt ∈N, λm, λM, 1: –Initialization 2: c= 2/(λM−λm); d= (λM+λm)/(λM−λm); 3: T(0) = 1; T(1) = c−d; 4: –First Communication Round xi(1) = 1 T(1)(cX j∈Ni(n) wijxj(0) + (c wii −d)xi(0)); 5: for n= 2,...,MaxIt do 6: T(n) = 2(c−d)T(n−1) −T(n−2); 7: –Communication Between Neighbors xi(n)=2T(n−1) T(n)(cX j∈Ni(n) wijxj(n−1) + (c wii −d)xi(n−1)) −T(n−2) T(n)xi(n−2); 8: end for 5.4 Analysis of the algorithm with Fixed Topologies In this section we analyze the main properties of the proposed algorithm when the network topology is fixed. In particular we first study the convergence conditions of the algorithm. Next, we find the parameters that maximize the convergence speed and we give bounds on the selection of these parameters to achieve the consensus faster than (2.2). Finally, we analyze the convergence for directed graphs and the parameters to assign in regular graphs and spanning trees. Theorem 5.4.1 (Convergence of the algorithm).For any Wfulfilling Assumption 2.3.2 and parameters λm and λMsuch that 1> λM> λm>−1and λN> λm+λM−1,the recurrence in eq. (5.9) converges asymptotically to the average of the initial conditions, with convergence rate kx(n)−γ1v1k2≤max λi6=1 |Tn(cλi−d)| Tn(c−d)kx(0) −γ1v1k2.(5.11) Note that the conditions in Theorem 5.4.1 are easy to fulfill without the necessity of knowing the eigenvalues of the matrix W.A symmetric selection of the parameters, i.e., −λm=λM,0< λM<1,always satisfies the Distributed Consensus in Multi-Robot Systems with Visual Perception 94 condition in Theorem 5.4.1. However, it is interesting to know the optimal selection of λmand λMto maximize the convergence speed. From Theorem 5.4.1 we know that the convergence rate is given by the factor max λi6=1 |Tn(cλi−d)| Tn(c−d)≤max |Tn(cλN−d)| Tn(c−d),|Tn(cλ2−d)| Tn(c−d),1 Tn(c−d).(5.12) The first two terms consider the case when either λ2or λNlay outside of the interval [λm, λM],because in such case |Tn(cλ −d)|is monotonically increasing with |λ|. When all the eigenvalues are contained in the interval [λm, λM],then |Tn(cλi−d)| ≤ 1for all i6= 1 and the convergence rate is given by the third term of (5.12). A simple calculation using eq. (5.5) leads to |Tn(cλ −d)| Tn(c−d)=τ(c−d) |τ(cλ −d)|n1 + τ(cλ −d)2n 1 + τ(c−d)2n,for all λ∈R.(5.13) It is clear that when n→ ∞, the second fraction in the right side of (5.13) goes to 1 for |λ| 6∈ [λm, λM]. Therefore, the convergence rate is determined by ν(c, d) =      τ(c−d),if [λN, λ2]⊆[λm, λM] max τ(c−d) |τ(cλN−d)|,τ(c−d) |τ(cλ2−d)|,otherwise. (5.14) The optimum values of λmand λMwill be those that lead to the minimum value of ν(c, d). Theorem 5.4.2 (Optimal parameters).The convergence rate ν(c, d)attains its minimum value for the parameters c, d such that λM=λ2and λm=λN This implies that in order to achieve the maximum convergence speed, instead of requiring to know the whole matrix, only the maximum and minimum eigenvalues, λ2and λN, of the weight matrix are necessary. Note that using the optimal parameters, the conditions of Theorem 5.4.1 are almost always satisfied. The only situation where this does not hold is when λ2=. . . =λN,because that would imply λm=λM. This happens for example for a complete graph. However, in this case we can choose λm=λN+and λM=λ2−with ≃0and achieve very good convergence rates. Finally, we provide bounds for the symmetric assignation of parameters, λM=−λm,to achieve faster convergence than (2.3). Theorem 5.4.3 (Faster convergence than Wn).For any matrix Wsatisfying Assumption 2.3.2, let λ= max(|λ2|,|λN|)be the convergence rate in (2.3). For any 0< λM<2λ λ2+ 1,and λm=−λM,(5.15) Pn(λ)goes to zero faster than λnwhen ngoes to infinity. Therefore the algorithm in eq. (5.9) converges to the consensus faster than the one in eq. (2.3). Remark 5.4.4 (Fast convergence with the optimal parameters).The above result shows that there always exist parameters that make the proposed algorithm faster than (2.3). Therefore, if the algorithm is executed using the optimal parameters, it will also converge to the average faster than (2.3). Finally, a graphical comparison of xn, Tn(x)and Pn(x)using λm=−0.95 and λM= 0.95 is depicted in Fig. 5.2 for n= 4,in the interval [−1,1].Note that Tn(x)cannot be used in the consensus process because at some points it would not reduce the error. On the other hand, as we have shown along the section, Pn(x) satisfies the conditions required to achieve consensus. Also notice that Pn(x)has closer values to zero than xn in points close to −1and 1,which supports the theory that the error associated to eigenvalues in that regions will be reduced faster. 5. Fast Consensus with Chebyshev Polynomials 95 −1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1 x w4(x), T4(x), p4(x) x4 T4(x) p4(x) 1/T4(c−d) λmλM Figure 5.2: Plot of the polynomials xn, Tn(x)and Pn(x). In the figure n= 4, λm=−0.95 and λM= 0.95. 5.4.1 Special Topologies We consider an extension of the algorithm to directed communication graphs. We also analyze the selection of the parameters λMand λmfor some common topologies. Directed graphs If the communication graph is directed, then the weight matrix is not symmetric anymore. This implies that the matrix might no longer be diagonalizable and its eigenvalues could be in the complex plane. We analyze the implications of these facts in the convergence of the algorithm. Chebyshev polynomials, Tn(z), z ∈C, on the complex plane can also be expressed by (5.5), where τ(z)is defined now by τ(z) = z−√z2−1,if |z−√z2−1|<1 z+√z2−1,otherwise .(5.16) In this case |τ(z)| ≤ 1and |τ(z)|−1≥1for all z, which implies that Tn(z)go always to infinity with nfor z6∈ R. Proposition 5.4.5 (Convergence for directed graphs).Let Wbe diagonalizable and row stochastic, and parameters λmand λMsuch that 1> λM> λm>−1. If the minimum real eigenvalue of Wsatisfies λN> λm+λM−1and the complex eigenvalues, λz,of Wsatisfy |τ(cλz−d)|> τ(c−d),then the recurrence in eq. (5.9) converges to the consensus state. The condition on the complex eigenvalues has some geometrical meaning [83]. Imposing that |τ(cλz− d)|> τ(c−d)is equivalent to require that λzis inside an ellipse in the complex plane centered at (d/c, 0), or equivalently ((λM+λm)/2,0),and with semi-axis e1= (c−d)/c and e2= (p(c−d)2−1)/c (see Fig 5.3). The condition of the weight matrix being diagonalizable is required to factorize Win the proof of the Proposition. Although there is no direct way of knowing if Wis diagonalizable without the knowledge of the whole matrix, in our simulations we have not found any convergence trouble. Spanning trees In order to give bounds on the parameters λmand λMfor topologies with a spanning tree configuration, we will consider the best and the worst cases and study the eigenvalues of their weight matrices using the local degree weights [153]. The topology with the best connectivity is the star topology, in which there is one robot connected to all the others. For a star graph of Nrobots it can be proved that Whas eigenvalues 1 = λ1>(N−1)/N =λ2= . . . =λN−1> λN= 0. Distributed Consensus in Multi-Robot Systems with Visual Perception 96 Figure 5.3: Ellipse where all the eigenvalues must be contained in order to achieve the consensus. In this particular example we have chosen λM= 0.9and λm=−0.5.Note that when the imaginary part of the eigenvalues is zero convergence is achieved if λM+λm−1>λ>1as stated in Theorem 5.4.1. The worst possible spanning tree configuration is a chain. For a chain graph of Nrobots, using the local degree weights, the eigenvalues of Wsatisfy [18] λi=1−2 cos(iπ N) 3, i = 1, . . . , N. Combining the constraints on the two graphs we conclude that, for N≥3, the eigenvalues λ2and λNmust satisfy N−1 N≤λ2≤1−2 cos((N−1)π N) 3<1and −1 3<1−2 cos( π N) 3≤λN≤0. And then by choosing λm=−1/3and λM=1−2 cos( (N−1)π N) 3convergence is ensured. Regular graphs A regular graph of degree ris a graph in which all the robots have exactly rneighbors. For this kind of graphs, the worst connectivity appears when r= 2, which is only possible if the network forms a ring. For the ring topology, the eigenvalues are [18] λi=1 + 2 cos(2iπ N) 3, i = 1, . . . , N. The best topology occurs when r=N−1, which implies a fully connected graph. In this case λ2= . . . =λN= 0. However, this is a trivial scenario in which the consensus is achieved in one iteration and only serves us to find the upper bound of λm. Instead of considering the weight matrix, let us consider the adjacency matrix. In [17] it is shown that, for r≥3,the second largest eigenvalue of the adjacency matrix is contained in the interval centered in r3/4with radius r1/2. Then, a lower bound for this eigenvalue is r3/4−r1/2. Using the local degree weights we find the relation W= (I+A)/(r+ 1).All this together yields to the bounds on λ2and λNfor regular graphs, 1 + r3/4−r1/2 d+ 1 ≤λ2≤max i 1 + 2 cos(2iπ N) 3<1,and −1 3<min i 1 + 2 cos(2iπ N) 3≤λN≤0, which provides values for the parameters λmand λM. 5. Fast Consensus with Chebyshev Polynomials 97 5.5 Analysis of the algorithm with Switching Topologies We study now the recursive evaluation of (5.9) when the topology of the network, and therefore the matrix W, changes at different iterations. Given initial conditions x(0),the distributed recurrence now is: x(1) = 1 T1(c−d)(cW(1) −dI)x(0), x(n) = 2Tn−1(c−d) Tn(c−d)(cW(n)−dI)x(n−1) −Tn−2(c−d) Tn(c−d)x(n−2), n ≥2. (5.17) Note that this recurrence is suitable for switching weight matrices. However, the evaluation of the recurrence is no longer equivalent to Pn(W)x(0),for some matrix W. This means that we are not exactly evaluating the transformed Chebyshev polynomials at the eigenvalues of some matrix anymore. Nevertheless, a theoretical analysis is still possible. Recall that the evaluation of Pn(W)x(0) can be separated into the evaluation of its eigenvalues and eigenvectors, eq. (5.6), Pn(λi)vi=Tn(cλi−d)/Tn(c−d)vi. In the switching case we must take into account that both λiand vichange at each iteration. Moreover, since the eigenvectors of different matrices are related we must also consider these relations. For the moment, as a first simplification of the problem, let us forget about the changes in viand the parameters cand dand let us study the scalar evaluation of the Chebyshev recurrence (5.2) with different λiat each iteration. That is, T0(L)=1, T1(L) = λ(1), Tn(L) = 2λ(n)Tn−1(L)−Tn−2(L),(5.18) where L={λ(n)}, n ∈Nis a sequence of arbitrary real numbers, with λ(n)∈Rthe nth term in the sequence. Specifically, we are interested in the behavior of |Tn(L)|. Proposition 5.5.1 (Upper bound for the time-varying Chebyshev recurrence).Suppose there exists values δmin and δmax such that λ(n)∈[δmin, δmax],∀n∈N, δmin <0< δmax and |δmin| ≤ δmax. Then |Tn(L)| ≤ |Tn(L∗)|(5.19) where L∗={λ∗(n)}is a succession defined by λ∗(n) = (δmax if nodd, δmin if neven, (5.20) Corollary 5.5.2. If |δmin|> δmax then the bound in eq. (5.19) is true taking L∗={λ∗(n)}with λ∗(n) = (δmax if neven, δmin if nodd, (5.21) The previous proposition reveals that the Chebyshev recurrence evaluated in a succession of different real numbers does not keep the behavior shown when it is evaluated with a constant value. The next Lemma provides a bound for the direct expression of this behavior. Lemma 5.5.3 (Direct expression for the bounded time-varying Chebyshev recurrence).Let us suppose that the conditions of Proposition 5.5.1 are true. Then |Tn(L∗)| ≤ κ1(δmax)n,where κ1(δmax) = δmax +pδ2 max + 1 (5.22) Distributed Consensus in Multi-Robot Systems with Visual Perception 98 This direct expression (5.22) will be helpful in the development of the convergence analysis dealing with changing matrices and the parameters cand d. We provide now the main result, showing the convergence of the algorithm for the switching case. Theorem 5.5.4 (Convergence with time-varying topologies).Allow the communication graph, G(n),to arbitrarily change in such a way that it is connected for all n, with the weight matrices, W(n),designed according to Assumption 2.3.3. Let us denote λi(n), i = 1, . . . , N, the eigenvalues of W(n)and λmax = max nmax i=2,...,N λi(n),and λmin = min nmin i=2,...,N λi(n).(5.23) Given fixed parameters cand d, a sufficient condition to guarantee convergence to consensus of iteration (5.17) is κ1(max{|cλmax −d|,|cλmin −d|})τ(c−d)<1.(5.24) The next corollaries give more specific values of λMand λm,and therefore on cand d, that satisfy the condition in the theorem to achieve convergence. Corollary 5.5.5 (Convergence with symmetric parameters).Assume |cλmax −d|>|cλmin −d|and a symmetric assignation, −λm=λM=λ, of the parameters. Then if λ2<(1 −λ2 max),(5.25) the algorithm converges. If we prefer to assign non-symmetric values to the parameters, the following corollary provides a possible assignation that satisfies Theorem 5.5.4. Corollary 5.5.6 (Convergence with non symmetric parameters).Assume now that the values of λmax and λmin,or some bounds, are known. If λMand λmsatisfy that λM+λm=λmax +λmin,(5.26) and λM−λm<p4(1 −λmax)(1 −λmin),(5.27) then the algorithm achieves the consensus. We discuss now in detail the meaning of the theorem and its implications. Remark 5.5.7 (Sufficient condition).Note that the theorem provides just a sufficient condition to ensure convergence. This means that although the given bounds seem very restrictive, in practice, even if we choose large values of λMand λm,there can be convergence. Moreover, an important consequence of corollaries 5.5.5 and 5.5.6 is that, independently on the changes of the network topology, there are always parameters such that the method converges to the consensus. Remark 5.5.8 (Comparison with the fixed case).It is also interesting to note the different behavior of the algorithm when the topology changes with respect to the fixed case. In the latter case, in general it is better to select the parameters λMand λmwith large modulus to ensure that all the eigenvalues of the weight matrix are included in the interval [λm, λM]. However, in the switching case, it is necessary to choose them small so that c−dis large enough to guarantee convergence. This happens because the more variation on the eigenvalues of the weight matrices, the larger κ1(max{|cλmax −d|,|cλmin −d|})is. Therefore, the larger N, the smaller (in modulus) λMand λmshould be chosen. 5. Fast Consensus with Chebyshev Polynomials 99 Remark 5.5.9 (Application to general recurrences).The analysis followed to prove convergence of our algorithm is also interesting because it can be applied to more general consensus algorithms based on recurrences of order greater than one. Given a recurrence similar to (5.17), if a scalar difference equation is found such that its solution bounds the original one in the worst case, a convergence result using the behavior of this recurrence can be obtained. Finally, we provide a discussion about the assumptions we have made to proof convergence. •Extension to directed graphs: If the weight matrices are not symmetric, then we cannot ensure that the norm of the matrices used to change the base of eigenvectors is equal to 1. In such a case the convergence condition in Theorem 5.5.4 would be ζκ1(max{|cλmax −d|,|cλmin −d|})τ(c−d)<1,with ζ≥1some positive constant. It is also important to remark that, in this situation, the left eigenvector associated to λ1(n)is not constant anymore for different matrices. This makes the theoretical analysis of the behavior more tedious because at each iteration it is affected by these eigenvectors. •Connectivity of the graphs: The assumption about the connectivity of each graph is more restrictive than in other approaches, e.g., [61], where only joint connectivity is imposed. In our analysis, if one graph is disconnected, then λmax = 1 and the sufficient condition (5.24) is never satisfied. This, of course, is caused because we are considering the worst case scenario, so that we can model the behavior of the Chebyshev recurrence as the nth power of some quantity. However, even though we have not been able to prove convergence when some graphs are disconnected, we show in section 5.7 through simulations that in practice the algorithm turns out to be convergent. 5.6 Adaptive Parameters and Algebraic Connectivity Estimation In this section we present the adaptive consensus algorithm using the Chebyshev Polynomials that leads to the estimation of the algebraic connectivity. The proposed algorithm is based on the bisection method. We describe the process considering a symmetric choice of the parameters, −λm=λM=λ, and therefore, c= 1/λ and d= 0.The algorithm uses control data to adapt the parameter. For simplicity we explain the algorithm assuming that x(0) are exactly these control data. The execution of the algorithm with regular initial conditions can be executed in parallel. Each robot randomly initializes xi(0) ∈ {0,1}.We require the following assumption: Assumption 5.6.1 (Non-null Fiedler eigenvector).The initial conditions x(0) expressed as a sum of eigenvectors of W,x(0) = Pi=1,...,N γivi,satisfy v26=0. Let us suppose we run the algorithm (5.9) for a fixed number, n, of iterations choosing c= 1/λ, with λ∈(0,1).Let us define κn(c) = Tn(c)kx(n)−v1k∞ kx(0) −v1k∞ (5.28) as an indicator of the position of the eigenvalues with respect to the parameter c. The vector v1is the eigenvector associated to λ1,i.e., the average of the initial values and kx(0) −v1k∞and kx(n)−v1k∞are the initial and current error in the averaging process. The distributed computation of these data is explained later in the text. Proposition 5.6.2 (Eigenvalues position indicator).Given λand c= 1/λ as the parameter for the iteration (5.9), if λi∈[−λ, λ],∀i= 2, . . . , N, then κn(c)is bounded by κn(c)≤PN i=2 kvik∞ kPN i=2 vik∞ ,∀n. (5.29) Otherwise, at least λ26∈ [−λ, λ]and limn→∞ κn(c) = ∞. Distributed Consensus in Multi-Robot Systems with Visual Perception 100 Taking this into account, for a sufficiently large nwe are able to discern when all the eigenvalues of Ware contained in the interval [−λ, λ]and when they are not. We can now propose the adaptive algorithm to iteratively choose λand cusing κn(c)and a bisection method. The algorithm starts with an interval defined by the two extremes, λmin and λmax,such that λi∈[−λmax, λmax],∀i= 2, . . . , N, at least λ26∈ [−λmin, λmin].(5.30) If there is no knowledge about the network, the initial values of these parameters can be λmin = 0 and λmax = 1. Following the bisection approach, the first parameter to run the consensus algorithm (5.9) is λ= (λmin + λmax)/2=0.5, c = 1/λ. At each consensus round, eq. (5.9) is run for niterations using c. This number, n, must be chosen in such a way that κn(c)has time to diverge when there is some eigenvalue outside the range [−λ, λ].The bound in eq. (5.29) is unknown so an estimation, κis used in the algorithm. If κn(c)≤κ, we know that all the eigenvalues are contained in the interval [−λ, λ].On the other hand, if κn(c)> κ, it means that there is some eigenvalue outside the range. Once we have detected which of the two situations is happening, the bisection parameters are updated according to it, λmax =λ, if κn(c)≤κ λmin =λ, if κn(c)> κ. (5.31) After that the consensus process is repeated, computing at each round a new estimation of the parameter λ= (λmin +λmax)/2. Proposition 5.6.3 (Convergence of the bisection method).Assuming nis large enough, the algorithm (5.31) is convergent to λ2, that is (λmax +λmin)/2→λ2. Therefore, the adaptive consensus algorithm updates the parameter cof eq. (5.9) to optimize the convergence speed of the method. Moreover, as new values of λare computed, a better estimation of the algebraic connectivity is available. Remark 5.6.4 (Computation of λN).Once a good approximation of λ2is available the same process can be applied to estimate λN.We need to consider again the standard parametrization of (5.9) with two parameters. The last estimation, λ, of λ2such that λ>λ2is assigned to λMand the new parameter to adaptively tune is λm.The iterative use of (5.31) to update λmwill eventually assign the value of λNto this parameter. We have not discussed the problem of computing the initial, kx(0)−v1k∞, and final, kx(n)−v1k∞,errors or the exact value of v1yet. It is also convenient to discuss the selection of κand nto have convergence guarantee. The use of control data, composed by integers, allows us to use the ideas presented in Chapter 4 to reach the consensus in finite-time. Let us recall that each robot has initial value of xi(0) ∈ {0,1}.Therefore the average will be j/N, for some j= 0,1, . . . , N, and v1=j/N1.Let us assume the number of robots has been computed as explained in Chapter 4.2.2. By using Theorem 4.2.3, the approximation yi(n) = 1 N[Nxi(n)] ,(5.32) with [·]a rounding operator to the closest integer, will provide us the exact value of v1,for all nsuch that kx(n)−v1k∞≤1/N. Since during the first iterations the exact value of v1is not available, the errors cannot be computed either. Nevertheless, we can get a good approximation of the infinity norm by kx(n)−v1k∞≃max i{|xi(n)−yi(n)|+|yi(n)−yi(n−1)|}, kx(0) −v1k∞≃max i{|xi(0) −yi(n)|+|yi(n)−yi(n−1)|}, 5. Fast Consensus with Chebyshev Polynomials 101 which can be easily computed using a max consensus algorithm in a fixed number of iterations equal to the diameter of G. Since |xi(n)−yi(n)|is upper bounded by 1/N for all nand i, during the first iterations it will not provide a real estimation of the errors. For that reason the term |yi(n)−yi(n−1)|is introduced in the estimation. Also note that, after a finite number of iterations, y(n) = y(n−1) = v1, and the above estimation of the error will be exact whereas using |xi(n)−xi(n−1)|it would never be. The only parameter that cannot be exactly computed is κ, but we can give some more accurate bounds of the value of κn(c)that can be used by the algorithm as values of κ. Lemma 5.6.5 (Bound of the estimator).When cλi<1, κn(c)is bounded by κn(c)≤√N Therefore, assigning κ=√Nwill assure that the algorithm will not overestimate the value of λ2. On the other hand, by choosing a conservative value of κwill require to choose bigger values of nto make κn(c) diverge. In this way the algorithm also has time to have a good estimation of yi(n),and therefore of the errors. The whole process is synthesized in Algorithm 6. Algorithm 6 Consensus Algorithm with Adaptive Parameters Require: κ, n and x(0),s.t. xi(0) ∈ {0,1} 1: Initialize λmin = 0,λmax = 1 2: while λmax −λmin >tolerance do 3: λ= (λmin +λmax)/2, c = 1/λ 4: for it= 1, . . . , n do 5: Compute x(it) using (5.9) 6: end for 7: Use max consensus to estimate the errors 8: Compute κn(c) 9: if κn(c)≤κthen λmin =λ 10: else λmax =λ 11: end if 12: end while 5.6.1 Variants of the Estimator We also provide three different variants of the basic algorithm that can be used to improve its behavior. The first two variants can be used to improve the convergence rate to the algebraic connectivity and the third one can be used to detect changes in the communication topology, making the algorithm to converge at each step to the current best parameter. Direct estimation of λ2 The first variation we present makes use of κn(c)to provide a direct estimation of λ2when cλ2>1.Let us recall that in this situation, κn(c)→ ∞ with speed determined by Tn(cλ2).The direct expression of Tn(cλ2) is characterized [83] by Tn(cλ2) = 1 + τ2n 2τn, τ =cλ2−p(cλ2)2−1.(5.33) Therefore, the value of λ2can be estimated as follows: 1. Compute κn(c)and assume κn(c)≃Tn(cλ2) Distributed Consensus in Multi-Robot Systems with Visual Perception 102 2. Using (5.33) compute the value of τfrom the second degree equation 2κn(c)τn= 1 + τ2n, τ=κn(c)−pκ2 n(c)−11/n (5.34) 3. Finally, clear λ2from (5.33) using (5.34) λ2≃λτ2+ 1 2τ.(5.35) Note that the value obtained is still an approximation of the real value of λ2. Therefore, the bisection iteration still needs to be executed. Whenever a direct estimation of λ2is available, the interval is updated by λmax =λ2+ min(λmax −λ2, λ2−λmin), λmin =λ2−min(λmax −λ2, λ2−λmin), λ=λ2, (5.36) where λ2here is the estimation obtained in (5.35). In this way the interval to look for the algebraic connectivity is significantly reduced and so is the number of iterations and consensus rounds. In order to have a good direct estimation of λ2, it is desirable to have Tn(cλi)vi/Tn(c)≃0, i = 3, . . . , N, or at least |Tn(cλ2)v2||Tn(cλi)vi|.To make this happen, at each new consensus round we update the initial conditions by x(0) = x(n).With this update the average, v1,is preserved, but the initial conditions are closer to it, which is the same as to say that viis closer to zero. In addition, the estimations of the errors are also improved by the update because yi(n)will be closer to the average. Therefore, we are also obtaining a more exact value of κn(c),improving even more the estimation. However, we only do the update when cλ2>1.The reason is that the convergence to zero is faster for the eigenvalues contained within [−λ, λ]than for those outside the interval. Since λ2is not contained in the interval, v2is not reduced as much as the other eigenvectors and v2vi.If we update the initial conditions when cλ2<1,it is possible that the component associated to v2is reduced by a larger factor than for other eigenvectors. Speed up using k-section method The bisection method has the property of reducing the estimation error, |λ−λ2|,by a constant factor of 0.5. In robotic networks, the cost of sending several small messages is usually bigger than the cost of sending a unique message with more information. Taking this into account our method can execute several copies of the consensus algorithm in parallel with different parameters. In this way, the bounds of λ2are delimited with more accuracy and the optimal convergence rate is reached sooner. Specifically, given λmin and λmax,the k-section method executes k−1consensus in parallel with parameters λj=j(λmin +λmax)/k, cj= 1/λj, j = 1, . . . , k −1.(5.37) Once all the different estimations of κn(cj)have been computed, the interval to consider in the next consensus iteration is defined by λmin = max jλjs.t. κn(cj)≤κ, λmax = min jλjs.t. κn(cj)> κ. (5.38) With this algorithm, the size of the messages exchanged by the nodes will increase in k−1additional elements instead of the one sent by the bisection method. However, the error in the estimation of λ2will be reduced by a factor of 1/k after each update in the estimation. 5. Fast Consensus with Chebyshev Polynomials 109 because the choice of ndoes not depend on the size of the network but on the connectivity. Therefore, for large networks, the bottleneck of the algorithm, in terms of communications, is the diameter of G. Figure 5.5 depicts three executions of the adaptive consensus in a network of 100 nodes using real initial conditions. The three pictures consider the same initial conditions, the same number of iterations and different input parameters, estimated using bisection. It can be seen that as new estimations of λare computed, the consensus is reached faster. 0 5 10 15 20 25 30 35 −100 −50 0 50 100 Iterations x(n) Consensus using lambda = 0.500 0 5 10 15 20 25 30 35 −100 −50 0 50 100 Iterations x(n) Consensus using lambda = 0.875 0 5 10 15 20 25 30 35 −100 −50 0 50 100 Iterations x(n) Consensus using lambda = 0.984 (a) Round 1 (b) Round 3 (c) Round 6 Figure 5.5: Adaptive consensus with parameter estimation. Evolution of x(n)using the same initial conditions and number of iterations but different parameters estimated using pure bisection. The algebraic connectivity of the network is 0.987.As new estimations of λare computed, the consensus is reached faster. Table 5.5: Results with direct estimation of λ2 N λ2Diam Rounds Iter n λ 10 0.910 4.68 4.40 86.62 66.20 0.915 50 0.982 10.52 4.02 118.68 76.60 0.979 100 0.985 13.62 4.45 155.02 94.36 0.982 250 0.992 18.64 5.23 215.66 118.31 0.994 500 0.991 43.00 5.10 322.00 129.72 0.994 In Table 5.5 we show the results for the same experiment but using the direct estimation of λ2presented in section 5.6.1. In this case the number of rounds depends on the computed values of λ2.Note that this number is smaller than the number of rounds required by the standard bisection to obtain the same tolerance error. As a consequence the number of iterations is also reduced. Finally, it is worth noticing that the estimation of λ2is also very precise. Estimation with a switching topology To end, we show an experiment where we allow the communication graph to change, showing that our method tracks the algebraic connectivity using the k-section method. We have considered a random network composed by 50 nodes. Since during the computation of x(n)the network must be static, we have only modified the network during the estimation of the errors. The evolution of the estimations is depicted in Fig. 5.6. We can see that the algorithm detects the changes in the topology and adjust the intervals in consequence. If the topology remains fixed for enough iterations, the method estimates the value of the algebraic connectivity. When the algebraic connectivity is reduced, instead of assigning λmin = 0 we have used λmin =λmax −0.1.Although sometimes, e.g., just before iteration 200, more than one consensus Distributed Consensus in Multi-Robot Systems with Visual Perception 110 round is required to adapt the interval, with this assignment, the convergence is in general faster to the real value of λ2. 0 200 400 600 800 1000 1200 0.5 0.6 0.7 0.8 0.9 1 Iterations Values of λ Algebraic Connectivity Estimation with Switching Topology λmax λmin λ λ2 Figure 5.6: Estimation of the algebraic connectivity under a switching communication network. The algorithm detects the changes and adapts the interval to estimate at each round the algebraic connectivity. 5.8 Discussion Summing up, we have proposed a linear iteration using Chebyshev polynomials of first kind that requires a small number of iterations to reach the consensus. In this way, we can compensate the extra communication load that visual information usually requires, or the voting for multiple hypotheses to reach a robust consensus using De-RANSAC. The proposed algorithm has the same characteristics of a standard linear iteration. The robots need to send the same amount of data and only need to compute sums and products of the variables. The main difference is the use of a second order recurrence iteration, which has small additional space requirements in the memory of the robots but significantly accelerates the convergence rate compared to existing approaches. In the chapter we have characterized the speed up with theoretical results and extensive simulations considering fixed and switching communication topologies. Our algorithm requires two additional input parameters that define the convergence speed of the method. We have analyzed the influence of these parameters in the convergence speed, showing that the fastest version of our algorithm is achieved when they correspond with the smallest and the second largest eigenvalues of the weight matrix. For some specific topologies like trees or regular graphs we have given direct expressions to assign these parameters. For general topologies, the exact value of the parameters requires the knowledge of the whole network topology. For that reason we have also proposed a distributed solution to estimate the parameters using a bisection technique. The result is an adaptive distributed linear iteration able to reach the maximum convergence speed. With this chapter we conclude the first part of the Thesis, where we have focused on modifying the standard consensus algorithm so that it can be used with visual information of any type. It is clear that the choice of the appropriate representation of the information is another important factor to achieve a good consensus. For example, in perception tasks, the use of line descriptors extracted from the images will have different implications in the computation of the consensus than the use of SURF descriptors. In the rest of the Thesis we will study how the consensus computation can be simplified in perception and control tasks by using well known computer vision methods. 5. Fast Consensus with Chebyshev Polynomials 111 Proofs Proof of Theorem 5.4.1 (Convergence of the Algorithm) We introduce an auxiliary result to prove the convergence. Lemma 5.8.1. Given x1>1,for any x2such that |x2|< x1it holds that lim n→∞ Tn(x2) Tn(x1)= 0.(5.39) Proof. For |x2| ≤ 1,|Tn(x2)| ≤ 1,∀n, and since Tn(x1)→ ∞ with n, eq. (5.39) is true. Now, if 1<|x2|< x1,then using (5.5) we have Tn(x2) Tn(x1)=τ(x1)n τ(x2)n 1 + τ(x2)2n 1 + τ(x1)2n.(5.40) But in this case, 1>|τ(x2)|> τ(x1)>0and the result holds immediately. Proof of Theorem 5.4.1. Let Q=W−1 N11T, whose eigenvalues are λ1= 0,with v1=1its corresponding eigenvector, and λ2, . . . , λNwith the same eigenvectors as W. Considering that γ1= 1/N1Tx(0),then 1 N11T(x(0) −γ1v1) = 0.Taking this into account it is easy to see that Wk(x(0) −γ1v1) = Qk(x(0) −γ1v1),∀k∈N,(5.41) and therefore Pn(W)(x(0)−γ1v1) = Pn k=0 αkWk(x(0)−γ1v1) = Pn k=0 αkQk(x(0)−γ1v1) = Pn(Q)(x(0)− γ1v1),with αkthe coefficients of Pn. Also Wv1=v1and Pn(1) = 1, then Pn(W)v1=v1and kx(n)−γ1v1k2=kPn(W)(x(0) −γ1v1)k2=kPn(Q)(x(0) −γ1v1)k2≤ kPn(Q)k2kx(0) −γ1v1k2.(5.42) In addition, Qis symmetric, and so is Pn(Q),which implies that its spectral norm coincides with the spectral radius, kPn(Q)k2=ρ(Pn(Q)) = max i6=1 |Pn(λi)|= max i6=1 |Tn(cλi−d)| Tn(c−d).(5.43) For any x∈(λM+λm−1,1) we have that |cx −d|< c −d, then for all the eigenvalues of Wbut λ1, |cλi−d|< c −d. Finally, noting that c−dis strictly larger than 1, by Lemma 5.8.1 Pn(λi)→0for all i6= 1, which proves the convergence of the algorithm. Proof of Theorem 5.4.2 (Optimal Parameters) In order to prove Theorem 5.4.2 we will use the following auxiliary results. Lemma 5.8.2. Let λm, λMsuch that [λN, λ2]6⊆ [λm, λM]and |cλN−d|< cλ2−d. Then, for fixed c,ν(c, d) is a decreasing function of d. Proof. Let us see that ∂ν(c, d)/∂d < 0. ν(c, d) = τ(c−d) |τ(cλ2−d)|=τ(c−d) τ(cλ2−d)>0 Then ∂ν ∂d =−τ0(c−d)τ(cλ2−d) + τ(c−d)τ0(cλ2−d) τ(cλ2−d)2. Distributed Consensus in Multi-Robot Systems with Visual Perception 112 But since for x > 0,τ0(x) = −τ(x)/√x2−1,then ∂ν ∂d =τ(c−d) τ(cλ2−d)"1 p(c−d)2−1−1 p(cλ2−d)2−1# which is negative because 1<(cλ2−d)2<(c−d)2. Lemma 5.8.3. Let λm, λMsuch that [λN, λ2]6⊆ [λm, λM]and |cλN−d|>|cλ2−d|with cλN−d < 0. Then, for fixed c,ν(c, d)is an increasing function of d. Proof. The proof is very similar to that of Lemma 5.8.2 and is omitted. Proposition 5.8.4. Let λm, λMsuch that λM−λm= 2/c is fixed and [λN, λ2]6⊆ [λm, λM]. Then i) If λ2−λN> λM−λm,ν(c, d)≥ν(c, d∗),d∗being the value such that λM+λm=λ2+λN, that is, for a fixed c,ν(c, d)is minimum when λm, λMare symmetrically placed with respect to λN, λ2. ii) If λ2−λN≤λM−λmand λM< λ2then ν(c, d)≥ν(c, d∗),d∗being such that λM=λ2, and in this case [λN, λ2]⊆[λm, λM] iii) If λ2−λN≤λM−λmand λm> λNthen ν(c, d)≥ν(c, d∗),d∗being such that λm=λN, and in this case [λN, λ2]⊆[λm, λM] Proof. i) The result follows from Lemmas 5.8.2 and 5.8.3. If λ2> λM, then cλ2−d > |cλN−d|and ν(c, d)is a decreasing function of d= (λM+λm)c/2which means that it decreases as λMincreases. The maximum value of λMfor which these conditions hold is λM= 1/c + (λ2+λN)/2for which cλ2−d= |cλN−d|. If λN< λm, then cλ2−d < |cλN−d|and ν(c, d)is an increasing function of d= (λM+λm)c/2which means that it increases when λMincreaseses. The minimum value of λMfor which these conditions hold is λM= 1/c + (λ2+λN)/2for which cλ2−d=|cλN−d|. ii) In this case cλ2−d > |cλN−d|, and ν(c, d)is a decreasing function of d= (λM+λm)c/2which means that it decreases when λMincreases. The maximum value of λMfor which these conditions hold is λM=λ2. iii) In this case cλ2−d < |cλN−d|, and ν(c, d)is an increasing function of d= (λM+λm)c/2which means that it increases when λmincreases. The minimum value of λmfor which these conditions hold is λm=λN. Proof of Theorem 5.4.2. If [λ2, λN]⊆[λm, λM]the result was proved in [91]. Let us suppose then that [λ2, λN]6⊆ [λm, λM]. If λ2−λN≤λM−λm, it has been shown in Proposition 1.1 that ν(c, d)has smaller values for c, d such that [λN, λ2]⊆[λm, λM], and in this case λ2=λMand λN=λmyields to the minimum ν(c, d). If λ2−λN> λM−λm, we have seen in Proposition 1.1 that ν(c, d)is smaller for c, d such that λm, λM are symmetrically placed with respect to λN, λ2, that is, λM=λ2−αand λm=λN+α,α≥0. Let us see that ν(c, d)is minimum for α= 0. First, note that c=2 λM−λm =2 λ2−λN−2α,and d=λM+λm λM−λm =λ2+λN λ2−λN−2α. Thus ν(c, d) = τ(c−d) τ(cλ2−d)=τ(c−d) −τ(cλN−d) and taking into account that ∂ ∂α(cλ −d)=2 2λ−λ2−λN (λ2−λN−2α)2= 2 cλ −d (λ2−λN−2α), 5. Fast Consensus with Chebyshev Polynomials 113 ∂ν(c, d) ∂α =−2τ(c−d) τ(cλ2−d)(λ2−λN−2α)"c−d p(c−d)2−1−cλ2−d p(cλ2−d)2−1#>0. Then ν(c, d)is increasing with αand the minimum value is obtained for α= 0. Proof of Theorem 5.4.3 (Faster convergence than Wn) By eq. (5.7) we have that c−d= 1/λM, cλ −d=λ/λM. To prove the faster convergence of our algorithm we show that the quotient between λnand Pn(λ)goes to infinity with n. That is lim n→∞  λn Pn(λ) = lim n→∞  λnTn(c−d) Tn(cλ −d) =∞.(5.44) If λ∈[λm, λM], then cλ −d∈(−1,1) and |Tn(cλ −d)| ≤ 1.Using (5.5)  λnTn(c−d) Tn(cλ −d)≥ |λnTn(c−d)|= λn1 + τ(c−d)2n 2τ(c−d)n ,(5.45) where τis the function in eq. (5.5), which at c−dis smaller than one. Then, in order to fulfill (5.44) it must hold that lim n→∞ λ τ(c−d)n =∞ ⇔ λ>τ(c−d)⇔λMλ > 1−q1−λ2 M,(5.46) which is satisfied if (5.15) holds. On the other hand, if λ6∈ [λm, λM], using again (5.5) we substitute the value of Tn(c−d)and Tn(cλ −d) λn Pn(λ)=λnτ(cλ −d)n τ(c−d)n 1 + τ(c−d)2n 1 + τ(cλ −d)2n.(5.47) The second term of (5.47) goes to one as ngoes to infinity. This means that, in order to fulfill (5.44) it must hold that lim n→∞ λτ(cλ −d) τ(c−d)n =∞ ⇔  λτ(cλ −d) τ(c−d) >1.(5.48) Replacing τfor its value and doing some calculations using the radical conjugates we obtain λτ(cλ −d) τ(c−d)=λ1 + q1−λ2 M λ+qλ2−λ2 M .(5.49) Using (5.49) we obtain that (5.48) is equivalent to λM(−1−λ2)+2λ > 0,which by (5.15) is always true, and therefore, the proof is complete. Proof of Proposition 5.4.5 (Convergence for directed graphs) Lemma 5.8.5. Given x > 1, for any complex number z, such that |τ(z)|= min{|z+√z2−1|,|z− √z2−1|} > τ(x),then limn→∞ Tn(z)/Tn(x)=0. Proof. It is a straightforward consequence of (5.40). Distributed Consensus in Multi-Robot Systems with Visual Perception 114 Proof of Proposition 5.4.5. Let Q=W−1wT 1/wT 11, with w1the left eigenvector associated to λ1. Proceeding as in the Proof of Theorem 5.4.1, using γ1=wT 1x(0)/wT 11, we arrive at kx(n)−γ1v1k2≤ kPn(Q)k2kx(0) −γ1v1k2.(5.50) Since Wis diagonalizable, so is Q,which implies that Qcan be decomposed, Q=RDR−1,with D=diag(0, λ2, . . . , λN). Using that Qn=RDnR−1,we get that Pn(Q) = RPn(D)R−1, and then kPn(Q)k2≤ kRk2ρ(Pn(Q)) kR−1k2=Kmax i6=1 |Pn(λi)|=Kmax i6=1 |Tn(cλi−d)| Tn(c−d),(5.51) with Kthe condition number of P. For any x∈(λM+λm−1,1) we have that |cx −d|< c −d, then for all the real eigenvalues of Wbut λ1,|cλi−d|< c −d. Noting that c−dis strictly larger than 1 and τ(c−d)< τ(cλz−d),for any complex eigenvalue λz, by Lemmas 5.8.1 and 5.8.5, Pn(λi)→0for all i6= 1, which proves the convergence of the algorithm. Proof of Proposition 5.5.1 (Upper bound for the time-varying Chebyshev recurrence) For abbreviation, in the proof we will denote the sign of Tn(Λ) by s(Tn). Let us note that, if s(Tn−1) = s(Tn−2), by choosing λ(n)<0,then |Tn(Λ)|=|2λ(n)Tn−1(Λ) −Tn−2(Λ)|=|2λ(n)Tn−1(Λ)|+|Tn−2(Λ)|,(5.52) independently of n. The choice of λ(n)>0when s(Tn−1) = s(Tn−2)implies that |Tn(Λ)|=|2λ(n)Tn−1(Λ) −Tn−2(Λ)|<|2λ(n)Tn−1(Λ)|+|Tn−2(Λ)|.(5.53) Taking these two facts into account we can see that s(Tn−1) = s(Tn−2)⇒arg max λ(n)|Tn(Λ)|=δmin.(5.54) Besides, in this situation, choosing λ(n)<0yields s(Tn)6=s(Tn−1). Now, if s(Tn−1)6=s(Tn−2)and λ(n)>0,then eq. (5.52) is again true. On the other hand, choosing λ(n)<0in this situation implies (5.53). Thus, s(Tn−1)6=s(Tn−2)⇒arg max λ(n)|Tn(Λ)|=δmax.(5.55) Also, if s(Tn−1)6=s(Tn−2)and λ(n)>0,then s(Tn) = s(Tn−1). Finally, noting that inequality (5.19) holds for n= 0 and 1,and s(T0(Λ∗)) = s(T1(Λ∗)),then using (5.54) and (5.55) the succession (5.20) is obtained and the result is proved. Proof of Lemma 5.5.3 (Direct expression for the bounded time-varying Chebyshev recurrence) Let us define the recurrence T∗ 0(λ) = 1, T∗ 1(λ) = λ, T∗ n(λ)=2λT∗ n−1(λ) + T∗ n−2(λ),(5.56) which satisfies that |Tn(Λ∗)| ≤ T∗ n(δmax).(5.57) 5. Fast Consensus with Chebyshev Polynomials 115 According to recurrence (5.56), the succession {T∗ n(δmax), n = 0,1, . . .}satisfies the homogeneous difference equation T∗ n(δmax)−2δmaxT∗ n−1(δmax)−T∗ n−2(δmax)=0. By the theory of difference equations [2], the solution to this equation is determined by the roots κ1and κ2of the characteristic polynomial. In this case κ1(δmax) = δmax +pδ2 max + 1 >1,and κ2(δmax) = δmax −pδ2 max + 1 = −1/κ1(δmax).(5.58) Since κ1(δmax)6=κ2(δmax),the direct expression of T∗ n(δmax)is T∗ n(δmax) = Aκ1(δmax)n+Bκ2(δmax)n(5.59) where Aand Bdepend on the initial conditions T∗ 0(δmax)and T∗ 1(δmax). In our case A=B= 1/2and |Tn(Λ∗)| ≤ T∗ n(δmax) = 1 2(κ1(δmax)n+ (−1/κ1(δmax))n)≤κ1(δmax)n.(5.60) Proof of Theorem 5.5.4 (Convergence with time-varying topologies) First of all, let us state the notation we will follow along the proof. For any weight matrix W(n)we denote its eigenvectors by vi(n), i = 1, . . . , N. Let us denote V(n) = [v1(n),...,vN(n)] the matrix with all the eigenvectors of W(n). Since W(n)is symmetric, it is diagonalizable and we can choose the base of eigenvectors in such a way that V(n)is orthogonal. Therefore, v1(n)Tvi(n) = 0,∀i= 2, . . . , N, and v1(n) = 1/√N=v1, for all n. We define ¯ xas the vector containing the average of the initial conditions in all its components, ¯ x=1Tx(0)1/N. Let Q(n) = W(n)−1 N11T, whose eigenvalues are 0,with v1(n) = 1/√Nits corresponding eigenvector, and λ2(n), . . . , λN(n),with the same eigenvectors as W(n). Thus, Q(n)V(n) = V(n)D(n),with D(n) = diag(0, λ2(n), . . . , λN(n)).Taking all of this into account it is easy to see that 11T(x(0) −¯ x) = 0, and W(n)(x(n)−¯ x) = Q(n)(x(n)−¯ x). Given two consecutive matrices, Q(n)and Q(n−1),let P(n)be the matrix such that V(n−1) = V(n)P(n), that is, the matrix that changes from the base of eigenvectors of Q(n−1) to the base of eigenvectors of Q(n).In a similar way, R(n)will be such that V(n−2) = V(n)R(n).The orthogonality of V(n), implies that the matrices P(n) = V(n)−1V(n−1) and R(n) = V(n)−1V(n−2) are also orthogonal, and kP(n)k2=kR(n)k2= 1. We define the scaled error at the nth iteration by e(n) = Tn(c−d)(x(n)−¯ x).Using the Chebyshev recurrence (5.17), and the equivalence ¯ x= 2 Tn(c−d) Tn+1(c−d)(cW(n)−dI)¯ x−Tn−1(c−d) Tn+1(c−d)¯ x,(5.61) e(n)satisfies the recurrence e(0) = (x(0) −¯ x),e(1) = (cQ(1) −dI)e(0),e(n) = 2(cQ(n)−dI)e(n−1) −e(n−2).(5.62) Each vector e(n)can be expressed as a linear combination of the eigenvectors of Q(n), e(n) = N X i=1 αi(n)vi(n) = V(n)α(n).(5.63) We will next prove that kα(n)k2/Tn(c−d)goes to zero with n. Replacing e(n)by (5.63) in (5.62), e(n) = 2(cQ(n)−dI)V(n−1)α(n−1) −V(n−2)α(n−1) = 2(cQ(n)−dI)V(n)P(n)α(n−1) −V(n)R(n)α(n−2) = 2V(n)(cD(n)−dI)P(n)α(n−1) −V(n)R(n)α(n−2) =V(n)[2(cD(n)−dI)P(n)α(n−1) −R(n)α(n−2)] = V(n)α(n). (5.64) Distributed Consensus in Multi-Robot Systems with Visual Perception 116 Therefore, the vectors α(n)satisfy the recurrence α(0) = α(1),α(n) = 2(cD(n)−dI)P(n)α(n−1) −R(n)α(n−2).(5.65) Taking spectral norms, kα(n)k2=k2(cD(n)−dI)P(n)α(n−1) −R(n)α(n−2)k2≤ ≤2k(cD(n)−dI)k2kP(n)k2kα(n−1)k2+kR(n)k2kα(n−2)k2≤ ≤(2 max i|cλi(n)−d|kα(n−1)k2+kα(n−2)k2). (5.66) By Lemma 5.5.3 we can bound the norm of α(n)by κ1(xmax)nkα(0)k2, where the parameter xmax in this case is xmax = max nmax i=2,...,N |cλi(n)−d|= max n{|cλ2(n)−d|,|cλN(n)−d|} = = max{|cλmax −d|,|cλmin −d|}. (5.67) Therefore, in order to make the error go to zero we require that lim n→∞ κ1(xmax)n Tn(c−d)= 0.(5.68) Using (5.5) κ1(xmax)n Tn(c−d)=κ1(xmax)nτ(c−d)n 1 + τ(c−d)2n,(5.69) which goes to zero if κ1(xmax)τ(c−d)<1.When this happens limn→∞ x(n) = ¯ x,and the consensus is achieved. Proof of Corollary 5.5.5 (Convergence with symmetric parameters) Recall that with this assignation c= 1/λ and d= 0. Substituting κ1and τby their values in eq. (5.24) and doing some simplifications eq. (5.25) is obtained. Proof of Corollary 5.5.6 (Convergence with non symmetric parameters) If we know the values of λmax and λmin,the choice of λmand λMcan be done in such a way that |cλmin −d|=|cλmax −d|.(5.70) With this assignation we are minimizing the value of max{|cλmax −d|,|cλmin −d|} and therefore, the convergence condition is easier to fulfill. Clearing (5.70) yields (5.26). With this first condition, doing some calculations in eq. (5.24) the second condition (5.27) is obtained. Proof of Proposition 5.6.2 (Eigenvalues position indicator) The initial error is kx(0) −v1k∞=k N X i=2 vik∞.(5.71) 5. Fast Consensus with Chebyshev Polynomials 117 The error after niterations is equal to kx(n)−v1k∞=k N X i=2 Tn(cλi) Tn(c)vik∞(5.72) Using these two expressions we get κn(c) = Tn(c)kx(n)−v1k∞ kx(0) −v1k∞ =kPN i=2 Tn(cλi)vik∞ kPN i=2 vik∞ (5.73) If λi∈[−λ, λ],it means that cλi≤1.In this case, the evaluation of the Chebyshev polynomial is upperbounded (in norm) by 1, therefore, κn(c) = kPN i=2 Tn(cλi)vik∞ kPN i=2 vik∞≤PN i=2 kvik∞ kPN i=2 vik∞ ,∀n. (5.74) On the other hand, when cλi>1,for some λi, Tn(cλi)goes to infinity as ngrows and lim n→∞ κn(c) = lim n→∞ kPN i=2 Tn(cλi)vik∞ kPN i=2 vik∞ =∞(5.75) Proof of Proposition 5.6.3 (Convergence of the bisection method) By Proposition 5.6.2, we know that for a sufficiently large n, κn(c)correctly discriminates if λi∈[λ, λ],∀i= 2, . . . , N. The algorithm in (5.31) is based on bisection and is convergent because of the use of κn(c).The value of convergence is the border between the two limit situations, and it is λ= (λmax +λmin)/2→maxi6=1 λi= λ2. Proof of Proposition 5.6.5 (Bound of the estimator) The bound is obtained from the following inequality: kx(n)−v1k∞≤ kx(n)−v1k2= =kTn(cW)/Tn(c)(x(0) −v1)k2≤ ≤max i6=1 Tn(cλi)/Tn(c)kx(0) −v1k2≤ ≤max i6=1 Tn(cλi)/Tn(c)kx(0) −v1k∞√N. Regrouping terms and considering that Tn(cλi)≤1yields κn(c)≤√N. Distributed Consensus in Multi-Robot Systems with Visual Perception 118 6. Distributed Consensus in Perception using Homographies 125 P∗ i=P∗ jand |Π∗ i|=|Π∗ j|,∀i, j ∈ V. The ordering of the planes is done by univocal identification of both, the robots and the planes. By Assumption 2.2.1 each robot has a unique identifier, whereas the planes are ordered as they were detected in the local sequences. These two elements define a global order of the whole set of maps. The function O:P → Nis defined in such a way that it returns the order of a given plane in the map. For example, the first plane observed by the third robot will have a smaller position in the map than the fourth plane observed by the same robot but a larger value in the global order than any plane observed by the second or the first robot. The different size of the initial maps is solved creating fictitious planes in the local maps so that all the robots have a final map of the same size. A fictitious plane, ˜m, is a plane with no relations in the graph and for which all the coordinates of all its features, π˜m,are initialized to zero. Every robot creates as many fictitious planes as the total number of planes observed by the other robots. This is done exchanging local messages so that, every robot ieventually has a feature vector Π∗ i= (0T 1. . . ΠT i. . . 0T N)T(6.7) and an adjacency matrix Ci ∗with the form Ci ∗=         011 . . . 01i. . . 01N . . ..... . ..... . . 0i1. . . Ci. . . 0iN . . ..... . ..... . . 0N1. . . 0Ni . . . 0NN         ,(6.8) where 0jis a vector of zeros with dimension |Πj|and 0ij is a matrix of zeros with dimension Pi×Pj, j = 1, . . . , N, j 6=i. Let us note that in order to create a fictitious plane it is only necessary to know which robot has seen it, the order in the local map and the number of features it contains. This reduces considerably the size of the exchanged messages. When new messages containing information from other robots are received, the fictitious planes are added to the local maps, P∗ i=P∗ i∪˜m. (6.9) Regarding the adjacency matrices, C∗ i,for any new fictitious plane a new row and column with zeros is created C∗ i=PO( ˜m)Pi[IPi|0]TC∗ i[IPi|0]PO( ˜m)Pi,(6.10) where the middle matrices augment the adjacency matrix as in eq. (6.2) and PO( ˜m)Piis a permutation matrix that moves the last row, Pi,to the row O( ˜m)and displaces all the rows in between one position down. Finally, Π∗ iis also updated by adding fictitious features, with coordinates equal to zero, in the corresponding position. Since the communication graph is fixed, after dvrounds of exchanging information, all the robots will know the size of the global map, and all the vectors Π∗ iand matrices C∗ iwill have the same dimension and the form of eqs. (6.7) and (6.8) respectively. This process is summarized in Algorithm 8. 6.3.2 Data association Here two issues must be addressed. The first one is the data association between planes in different maps and the data association of features between matched planes. Once the data association is known, the second issue is to reduce the adjacency matrices (respectively feature vectors) so that they have the correct number of elements and in the right order. The data association is performed using the algorithm presented in Chapter 3. The function to locally match the planes is the homography between the invariant features of the planes. That is, two planar regions are Distributed Consensus in Multi-Robot Systems with Visual Perception 126 Algorithm 8 Augment local maps - Robot i 1: Send information about the local map to all j∈ Ni 2: for it = 1 . . . dvdo 3: Receive information from all j∈ Ni 4: Create fictitious planes (eq. (6.9)) 5: Augment C∗ i(eq. (6.10)) 6: Send the new information to all j∈ Ni 7: end for associated if a robust homography exists between them. The procedure to compute a homography is exactly the same one applied to pairs of images (DLT+RANSAC) and, as a consequence, is robust to the use of different cameras. Additionally, note that the same function serves to associate the features observed in the planes. The next step is to reduce the size of the maps considering the correspondences found. Given a plane, m, let B(m)be the set of planes associated to mand ¯n(m) = arg minn∈B(m)O(n)be the plane with the lowest value in the global order. For all the associations of the robot i, the adjacency matrix C∗ iis updated to put together all the associated planes C∗ i=In(C∗ i∨P¯n(m),nC∗ i∨C∗ iP¯n(m),n)IT n,(6.11) ∀m∈ Pi, n ∈B(m),where P¯n(m),n is a permutation matrix of the rows ¯n(m)and n, and Inis an identity matrix where the nth row has been deleted. The symbol ∨represents the or operation between the matrices, which can be done taking into account that all the elements of the matrices are in the set {0,1}. Let us note that row ¯n(m)will be the same for all the robots with planes in the set B(m). This means that all the robots will move the information of each association to the same row and will delete the rest of the rows, maintaining the size and the order of their maps. The last problem is to combine the associations of planes in which there is no plane belonging to Pi.To solve this problem a similar exchange of messages like the one to augment the local maps is carried out. In this case the exchanged information are the sets of associated planes B(m).After dviterations all the associations are received by all the robots and using eq. (6.11) all the updates are done. Algorithm 9 schematizes the data association step for planar regions. Algorithm 9 Data association and map reduction for planes - Robot i 1: Exchange local maps with neighbors 2: –Distributed Data Association 3: Execute Algorithm 1 4: –Map Reduction 5: Update C∗ i(eq. (6.11)) 6: for it = 1 . . . dvdo 7: Send block associations to j∈ Ni 8: Receive block associations from j∈ Ni 9: Update C∗ i(eq. (6.11)) 10: end for Regarding the association of the features a similar process is performed for all the features belonging to the same planar region. After such process all the vectors Π∗are updated, having the same size and order. 6.3.3 Common reference At this point, the local maps of planes have been associated and all of them have the same size and are equally sorted. Although the adjacency matrices are ready to execute the consensus algorithm, the features still require 6. Distributed Consensus in Perception using Homographies 127 a common reference image. Otherwise posterior consensus will give erroneous results. In order to solve this problem a max consensus is used to decide, for each plane, which one of the local reference images is defined as the common reference image. In the same process the homography that transforms the features from the local references to the global one is also computed. The number of observed features in the plane, |π|,is the criterion chosen to decide the reference. For every plane, algorithm 10 is executed by every robot. In the algorithm, Hj,i represents the homography that transforms the plane from the coordinates in the local reference to the coordinates of the neighbor’s reference. This homography is the one computed in the local data association step. The variables featsjrepresent the number of real features that each plane, j, has. For the global reference no subscript is used. After dviterations all the robots know the common reference (the one which contains more real features) and the homography to transform their coordinates. Applying this transformation and normalizing the coordinates, all the robots have their features in the same reference frame. The fictitious planes are not affected by changes of the reference. Taking this into account the robots with a fictitious plane do not participate in the max consensus algorithm of such plane. Algorithm 10 Choice of a common reference - Robot i 1: RefPlane = i;feats = |πi|;Hr,i =I 2: for it = 1 . . . dvdo 3: Send [RefPlane,feats,Hr,i] to all j∈ Ni 4: Receive [RefPlanej,featsj,Hr,j] from all j∈ Ni 5: if featsj>feats then 6: RefPlane = RefPlanej;feats = featsj;Hr,i =Hr,jHj,i 7: end if 8: end for 9: Transform the features’ coordinates of πusing Hr,i 6.3.4 Consensus on the global map From here on all the robots have the information needed to perform the consensus. The graphs G∗ isatisfy now all the requirements to apply distributed consensus algorithms. The adjacency matrices of the local maps are updated with the following rule C∗ i(m, n) = C∗ i(m, n)∨C∗ j(m, n),∀j∈ Ni(6.12) Theorem 6.3.1 (Convergence of C∗ i).The set of adjacency matrices C∗ i,under iteration rule (6.12), converges in dviterations to a common matrix C∗that includes all the links between planes. Proof. Let us consider separately each element of the matrices C∗ i.Considering that the initial value of the elements is {0,1},then it holds that C∗ i(m, n)∨C∗ j(m, n) = max(C∗ i(m, n),C∗ j(m, n)).(6.13) Then eq. (6.12) can also be seen as an update of a max consensus algorithm, which is proved to converge in dv iterations [78]. Since C∗ i(m, n) = 1 implies that there is a link between planes mand nand max(0,1) = 1 then all the links of the adjacency matrices are preserved. With respect to the features, since no observations are assumed to be better than others, a distributed averaging of the matched observations is computed. Let us note that although the fictitious planes do not provide any information to the final consensus, they affect it in the sense that the final value is divided by the total number Distributed Consensus in Multi-Robot Systems with Visual Perception 128 of robots. The third coordinate of the features, which is the homogeneous coordinate, plays here a fundamental role. Let us recall that for the fictitious features the third coordinate, usually related with the scale of the point, was also set to zero. Recalling the consensus algorithm using homogeneous coordinates presented in Chapter 4.2, the real average of the feature coordinates will be achieved. Let us note that the consensus is only carried out for the coordinates of the features and not for the whole descriptor. For the SURF descriptors a leader election algorithm is used so that every robot has the same set of SURF descriptors after dvsteps. 6.4 Experimental Results Several experiments have been carried out in order to evaluate the properties and the behavior of the whole method. We have tested it using different real image data sets that correspond to different locations of manmade environments with plenty of planar regions. The first data set has been recorded indoors (House data set). It consists of 3600 frames from different rooms. The second data set is composed by nine different sequences recorded outdoors in a downtown Zaragoza area (Downtown data set). Figure 6.2 shows a view of the map where these sequences have been acquired and the topology used in the experiments. Figure 6.2: Map of Zaragoza (Downtown data set), where the nine sequences have been acquired and the communication graph among the agents. Each camera represents one robot with its local map and the black edges are the communication links in the network. The camera used in all the cases has been a Panasonic Lumix FX-500. In all the cases the camera has moved with 6DOF. For all the images we have used SURF descriptors [13] for matching. The computation of the homographies has been done using DLT+RANSAC algorithm. It is well known that under pure rotations or small motions all the features can be fitted to the same homography. In video sequences with high frame rates this is a common situation. To avoid this problem we have followed the idea of [128] to select key frames among the sequence: • There are as many images as possible between the key frames Ikand Ik+1. • There are at least M matches between the key frames Ikand Ik+1. • There are at least N matches between the key frames Ikand Ik+2. The results are divided in three sections. In the first experiment (sec. 6.4.1) we analyze how the triple matching step works and the properties of the extracted planes. In the second experiment (sec. 6.4.2) we analyze the properties of the individual maps created using the sequences of images from each camera separately. We have compared the resulting graphs obtained for both data sets with graphs made by images [165]. For the latter approach we have stored the SURF descriptors of each image and we have imposed the homography constraint between frames to observe the pros and cons of using images or planes. In the last experiment (sec. 6.4.3) we have tested the multi-robot distributed approach for the Downtown data set. 6. Distributed Consensus in Perception using Homographies 129 6.4.1 Extraction of the planar regions The House data set has helped us to test the detection of planes since it has a lot of different planar regions. In Fig. 6.3 some of the segmented regions are depicted. We observe that although the method detects several planes which are the same in the ceiling, there are no wrong planes segmented. a b Figure 6.3: Planar regions extracted from the House data set. Each region is represented with a different color. In the bottom figure we have added points corresponding to the ceiling transformed with the computed homography. The nine sequences in the Downtown data set are more challenging because in this case the scene contains dynamic elements such as people and cars. There are also a lot of trees that occlude the building facades and, in some cases, there are also illumination changes when the camera points towards the sun. Figure 6.4 and 6.5 depict two examples of two different planes extracted using our method. Even when the extracted planes contain some outlier features the results are still quite good and, what is more important, we observe that the method maintains the planar regions correctly adding new features as they appear. We have observed that sometimes in a real scenario many dynamic objects may generate planar regions. These planar regions are undesirable in a practical situation. A lower bound on the number of features of a plane after the map generation clears almost all the undesired planes. Other times the algorithm considers as a planar region a set of features belonging to different planes but coplanar between them. Usually in the next steps the algorithm grows this plane considering only the biggest number of real coplanar features. The last problem observed comes from the homology test. The homology depends both on the motion between the images and the parameters of the planes. If the motion is small, it is possible that 2 different planes are fused because the three eigenvalues of the homology will be close to one. The algorithm used to select the key frames [128] mitigates this problem. Since the algorithm tries to skip as many images as possible between two consecutive key-frames, consecutive frames will be, in general, far away from each other in terms of distance. Therefore, the homology will only be close to the identity when the planes must actually be fused. 6.4.2 Single camera topological map of planar regions Using the planar regions extracted with our algorithm from the sequences of images, we have computed the associated graphs of planes. We have compared the resulting graphs with the image graphs created following the approach in [165]. Table 6.1 shows the comparison of the graphs generated using the House data set and Table 6.2 shows the same comparison for the nine sequences of the Downtown data set. In both cases the graph made of planes has less nodes and edges than the graph composed by images. The amount of space for storing the information is drastically reduced using our approach (Tables 6.1 and 6.2). Distributed Consensus in Multi-Robot Systems with Visual Perception 130 Figure 6.4: Planar region extracted from one sequence of the Downtown data set. The algorithm is able to track and grow the plane over 63 different frames with dynamic elements and some illumination changes. The top figure represents the plane with the 482 detected features. The plane has been observed in all the images depicted below. Notice that in our approach the size of each plane is not bounded and there can be big differences between nodes. In a visual memory made by images all the nodes will have similar size (the features per node can be assumed to be bounded) whereas the graph made of planes may contain very small planar regions with just a few features, and other nodes can represent large planar regions with hundreds of features and many 6. Distributed Consensus in Perception using Homographies 131 Figure 6.5: Another planar region extracted from one sequence of the Downtown data set. Table 6.1: Results for the house sequence Map Nodes Edges Feats Feats/node Size (MB) Images 140 1728 78124 558 29.0 Planes 30 78 10832 361 4.0 homographies. If the camera moves too fast or if there is a sequence of images in which there are no planar regions the topological map will be unconnected. To prevent these situations, we have also imposed consecutive planes to be connected in the local maps. 6.4.3 Multi-Camera Distributed Topological map The distributed building of a topological map has been done using the maps generated from the Downtown data set. The limited communications between the robots are shown in Fig 6.2. The diameter of the graph is 4, which means that most part of the algorithms will finish only in four steps. As previously commented, the triple matching algorithm finds a lot of small planes which are a mix of different outliers (trees, buses, people and noisy features). These planes do not apport real information and it is better to discard them. In order to do so we have set a threshold of 50 features, so that planes containing less features than the threshold are not considered for the distributed global map. As shown in Table 6.3, after erasing the small planes, only 132 of the 287 planes take part in the distributed process. These planes amount a total of 46981 features. Initially the robots exchange the information about their maps to create fictitious planes. After four steps, every robot has a map with 132 planes and 46981 features. Then the robots exchange their maps with their neighbors and perform the local data association step. Figure 6.6 shows one plane seen by three different Distributed Consensus in Multi-Robot Systems with Visual Perception 132 Table 6.2: Results for the downtown Zaragoza sequences Agent Map Nodes Edges Feats Feats/node Size (MB) 1Images 300 3966 315830 1052 117.4 Planes 104 340 15694 150 5.89 2Images 78 796 58219 746 21.6 Planes 17 62 3958 232 2.28 3Images 33 230 29777 902 11.1 Planes 8 28 1084 135 0.4 4Images 465 7192 431607 928 160.6 Planes 92 288 18497 201 6.95 5Images 86 820 74123 861 27.5 Planes 34 110 4104 120 1.54 6Images 101 1434 79700 781 29.6 Planes 11 40 409 361 1.68 7Images 32 304 29258 914 10.9 Planes 6 14 1611 268 0.61 8Images 35 230 30434 869 11.3 Planes 9 18 2021 224 0.77 9Images 32 318 29237 913 10.9 Planes 6 12 1162 193 0.44 Total Images 1162 15290 1078185 927 400.9 Planes 287 912 48540 169 20.20 Table 6.3: Evolution of the global map’s size Step Nodes Feats Initial global map 287 48540 After erasing small planes 132 46981 Data Association 121 46351 neighbor robots with the found matches. The local associations delete a total of 11 planes and 340 features, remaining 121 planes and 46351 features (third row in Table 6.3). We have observed that the small number of associations is mainly due to the different points of view of the trajectories and not because of mismatching. Even so, in the multi-robot mapping it is advisable to use larger RANSAC thresholds. After data association the robots execute the max consensus algorithm in order to fix the common references for each plane. In the example of the Figure 6.6 the reference plane is the top one because is the one with the most features. Finally, the robots execute the consensus rule to reach an average on the features and a consensus on the adjacency matrices of the topological maps. Figure 6.7 shows the consensus evolution of the three coordinates by the nine robots; we can see that they do not reach the desired average in fxand fybecause only three of the nine robots have information about the feature but the average considers the value of the nine. However, the normalized coordinates (Fig. 6.8) converge to the desired value. A comparison with the maps made by images has been done in order to analyze the amount of information transmitted through the network. This analysis has been carried out analytically considering the network topology and the information exchanged. An upper bound on the number of messages required to transmit some information to the considered network (flooding) is 14. That means that for the map made of images, the 400.9megabytes (Table 6.2) are transmitted 14 times, giving a total of 5612 transmitted megabytes. The breakdown of the transmitted information using topological maps is in Table 6.4. The results show that the total information transmitted through the network using processed planes is considerably smaller (20%). Also the final global map is better using planar regions, since every match mixes the information reducing the total 6. Distributed Consensus in Perception using Homographies 133 Figure 6.6: Multi-Robot Distributed Topological Map. Example of a planar region viewed in three different sequences. Red lines are the matches among the planes. In this example the reference plane is the top one. 0 5 10 15 20 25 0 50 100 150 200 250 300 350 400 Evolution of fx iterations fx(pixels) 0 5 10 15 20 25 0 50 100 150 200 250 300 Evolution of fy iterations fy(pixels) 0 5 10 15 20 25 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Evolution of the homogeneous coordinate iterations fh Figure 6.7: Consensus process for feature coordinates. Initially each agent has a different value of the feature coordinates. The nine agents exchange the information they have with their neighbors. It is observed that after 25 iterations consensus has been achieved and all the agents have the same value of the coordinates. amount of data, whereas with images the total size is the sum of the local maps. 6.5 Discussion In this chapter we have studied the problem of distributed map building by a team of robots using planes as the features to represent the map. The idea of storing planes as information in the top graph rather than Distributed Consensus in Multi-Robot Systems with Visual Perception 134 0 5 10 15 20 25 354 356 358 360 362 364 366 368 Normalized fx iterations fx / fh 0 5 10 15 20 25 292 293 294 295 296 297 298 Normalized fy iterations fy / fh Figure 6.8: Consensus process for normalized feature coordinates. Evolution in normalized coordinates of the value of the same feature than in figure 6.7. Only three agents have a real observation of the feature, which are (358.1072,292.3148)T,(364.2285,297.2203)Tand (358.9520,297.1431)T.The rest of the agents have fictitious features with initial value equal to zero. At the beginning the agents with a fictitious coordinate have ∞values. We can see that eventually the nine agents reach the same value, which corresponds to the average of the measurements of the three agents that observed the feature. Table 6.4: Amount of information transmitted (MB) Total using images ≃5612 Augment maps <1 Share maps 45.2 Data Association 13.2 Block Association <1 Leader Election <1 Consensus 1091.5 Total using planes ≃1150 whole images presents several advantages for the individual robots and for the whole team. We have presented a fully distributed solution using distributed consensus methods and inter-image homographies to relate the information in different images and different maps. At the beginning, each robot creates a local map from the sequence of images it acquires. The planar regions are extracted considering the information from previous images using a triple set plane-image-image for feature matching, tracking and growing the planar regions as new areas of the plane become visible. The planes are organized in a graph, built simultaneously to the extraction, where homologies are used to detect new planes when they appear and define a relation of co-visibility between the planes. The second part of the chapter has dealt with the problem of fusing the individual maps of the robots using distributed consensus. We have seen that the use of homographies also simplifies some of the most important problems in this context. Homographies can be used to solve the data association problem, providing with a robust mechanism to detect planes in different maps. The common reference frame, required to compute the consensus, only requires a max-consensus and the multiplication of different homographies. Finally, since homographies already use homogeneous coordinates, the final consensus can be achieved by all the robots, even if most of them have not seen a specific plane. In the end, we show that the whole team of robots achieves the consensus about the global map in a simple and efficient way. To conclude, we can see that well known computer vision techniques can play a fundamental role in achieving a consensus about the visual information perceived by all the robots. An interesting question is if we can use similar computer vision techniques, which have been very useful in perception tasks, to simultaneously control to team of robots to achieve a specific configuration, e.g., flocking behavior (consensus in the attitude) 7. Distributed Consensus in Control using Epipoles 141 where K > 0is the controller gain. In order to prove the stability of the proposed controller, we will make use of the following lemma. Lemma 7.3.1 (Properties of the controller).The following properties hold: 1. wij =−wji. 2. Pi∈V wi= 0. 3. sign(eij) = sign(eji)⇒ |dij|< π/2. To analyze the stability of the controller, as well as the achievement of the desired configuration, we will first assume that the communication topology is fixed. Theorem 7.3.2 (Convergence to a common orientation).Consider a robotic network like the one defined in section 7.2, with the robots initially oriented in such a way that |θij| ≤ θM< π/2,∀i, j ∈ V.If the robots use the control law (7.6) with βsatisfying αtan(θM 2)< β < α tan(θM 2),(7.7) then limt→∞ θij = 0,∀i, j ∈ V,i.e., the system will reach consensus. Besides the stability of the system, the theorem provides a relation between the calibration parameter and the relative orientation between the agents. Now we proceed to show the behavior of the controller when the communication topology changes over the time. 7.4 Robustness of the controller to more realistic conditions In this section we study how the controller is affected by changes in the communication topology and the use of different cameras by the robots. 7.4.1 Changes in the communication topology The controller presented in the previous section is only valid for a fixed communication topology. However, under real conditions it is most likely that the communication topology will change as the robots move. There are multiple reasons to study the robustness of the controller against changes in the communication topology. The most usual comes from the motion of the robots but the use of visual sensors introduce other issues that can also be modeled as changes in the topology. •Changes in the topology due to the motion of the robots: The controller should take into account that the motion in the robots may introduce some changes in the graph that defines the communication topology. •Changes in the topology due to perception issues: There are also perception issues that may affect the neighborhood of each robot. It is possible that two neighboring robots cannot compute their epipoles due to blurry images or temporal occlusions, which would be the same as to assume that they are not neighbors in the communication graph. •Changes in the topology for computational demands: Finally, computational issues should also be considered to model the communications using a time-varying graph. The computation of the epipoles using a robust algorithm, e.g., DLT+RANSAC [79], requires some time and, although one or two fundamental matrices can be computed in a reasonable amount of time, robots with a larger number of neighbors may not be able to keep up with the rhythm of the continuous time controller. Distributed Consensus in Multi-Robot Systems with Visual Perception 142 For all these reasons it is interesting to analyze the controller in the presence of changes in the communication topology. The following result states that the proposed controller can handle changes in the communication topology, reaching the desired agreement of the headings of the robots. Proposition 7.4.1 (Convergence to a common orientation with topology changes).Consider a robotic network like the one defined in section 7.2, which satisfies the conditions stated in Theorem 7.3.2 and Assumptions 2.2.5 and 2.2.6. If the robots use the control law wi=KX j∈Ni(t) wij, then limt→∞ θij = 0,∀i, j ∈ V. 7.4.2 Cameras with different calibrations When modeling the team of robots in section 7.2.2 we assumed that all the robots wore the same camera with the same intrinsic parameters, i.e., the parameter αwas the same for all the robots. Unfortunately, in a real scenario, even if all the robots are equipped with the same camera (same model, same characteristics, etc.), it is nearly impossible that all the calibrations of the Ncameras will be exactly the same. Let us consider that each robot is wearing a different camera with a different calibration. We denote by αithe calibration parameter of robot i. If the parameter βin (7.5) is kept at the same value for all the robots, then the final configuration of the network will not be the desired consensus because equal epipoles do not imply equal orientations anymore. The following proposition gives the direct expression of the final error between the orientation of pairs of robots: Proposition 7.4.2 (Error with different cameras).The error in the orientation is equal to ˜ θij = arctan (αi−αj) sin ψij cos ψij αisin2ψij −αjcos2ψij (7.8) Equation (7.8) shows that the final error in the orientation of the robots depends, not only on the difference between their calibrations but also on their relative bearing angle. This is good news because we can make the robots achieve the desired configuration, even if they do not have the same cameras. Corollary 7.4.3. If the robots are in parallel or leader follower formations, i.e., ψij =π/2or ψij = 0, then the consensus is achieved. The corollary is proved just by replacing these two values of ψij in eq. (7.8) and seeing that the error value is always zero. Nevertheless, in the experiments section we show the robustness of the controller to different cameras, even if the bearing angle between pairs of robots is different to π/2or zero. 7.5 Experiments In this section we show the behavior of the proposed controller in two different simulated scenarios and with a team of 3 robots moving in different environments. 7.5.1 Simulations The properties of the proposed controller are shown in simulations. The experiments have been carried out using Matlab. We have considered a robotic network composed by ten robots with initial positions and orientations 7. Distributed Consensus in Control using Epipoles 143 depicted in Fig. 7.3 and communications defined by the dashed lines. To simulate the vision system we have randomly generated a set of 3D features in the environment. The cameras have calibration matrix K= diag(300,300,1),and a resolution of 640 ×480 pixels. This implies that the robots have a limited field of view of 94 degrees. Under these conditions not all the robots can observe each other in their images. For example, robot two can only communicate with robot four and there are no other robots visible in its field of view. However, using the epipoles it can compute a control input to align its heading with the one of robot four. The results of using the proposed controller with β= 250 are shown in Figs. 7.3 and 7.4. Since the maximum relative orientation between a pair of robots is 1.23 the bounds on βrequired to converge are 212 < β < 423 and in this case the controller reaches the consensus. The right figure in Fig. 7.3 shows the evolution of the orientation of the robots, which converge to the same value for all of them. The left figure in Fig. 7.4 depicts the control inputs and the right figure the evolution of all the pairs of computed epipoles. −15−10−50510 −10 −8 −6 −4 −2 0 2 4 1 2 34 5 6 7 8 9 10 Initial Configuration of the Robots X (m) Z (m) −10−505 −10 −8 −6 −4 −2 0 2 4 6 8 10 X (m) Z (m) Trajectories followed by the robots 1 2 34 5 6 7 89 10 0 5 10 15 20 25 30 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 Orientation of the Robots Time (s) Orientation (rad) Figure 7.3: Initial positions (left) and trajectories followed by the robots (middle). Dashed lines represent direct communications between robots. In the right figure we can observe the values of the orientation of the robots, reaching the consensus. 0 5 10 15 20 25 30 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 Control Inputs Time (s) w (rad/s) 0 5 10 15 20 25 30 −1.5 −1 −0.5 0 0.5 1 1.5 Epipoles atan(eij/β) Time (s) Figure 7.4: Control inputs and evolution of the pairs of computed epipoles for the robotic network in Fig. 7.3. We have also introduced in the simulation some constraints to make it more realistic. To consider the time required for the computation of the epipoles we have discretized the controller with time step equal to 0.25 seconds. At each iteration, each robot randomly selects a subset of its neighbors to compute the epipoles. This selection generates changes in the network topology, transforming the system into a switching one. Also this selection reduces the number of fundamental matrices that the robots need to compute, improving the computational cost. The dwell time required in Assumption 2.2.5 comes from the discretization. Joint connectivity is preserved because along the time all the links of the original graph (which is connected) are selected at some point. The results of the evolution of the system are shown in Fig 7.5. We can see that the robots still achieve Distributed Consensus in Multi-Robot Systems with Visual Perception 144 the attitude alignment. 0 5 10 15 20 25 30 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 Orientation of the Robots Time (s) Orientation (rad) 0 5 10 15 20 25 30 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 Control Inputs Time (s) w (rad/s) Figure 7.5: Evolution of the network with switching topologies. Orientation of the robots (left) and control inputs (right). 7.5.2 Simulations in a virtual scenario In the second simulation we have consider a more realistic scenario. Using the virtual reality toolbox of MatLab we have created a virtual world. In this way, the robots acquire virtual images of resolution 640 ×480 pixels depending on their position and orientation. In this case the robots need to use real computer vision algorithms to estimate the epipoles. We have extracted SIFT [77] features from the virtual images and the 8 point algorithm with RANSAC [57] to match them in a robust way and to compute the epipoles between pairs of robots. An example of the images acquired by the robots and the features extracted and matched can be found in Figure 7.6. The results of the simulation is in Figure 7.7. Again the robots reach the desired configuration lmages Mat Figure 7.6: Images acquired in the virtual environment and matches between the SIFT descriptors. 7.5.3 Experiments with real robots We have also tested our proposal in a real platform. In this section we briefly describe the whole setup, the experiments carried out and we show the results obtained. Nevertheless, for a better visualization of the results we refer the reader to the attached videos, where the whole motion of the robots can be seen. The experiments have been carried out with three robots Pioneer 3Dx inc with non-holonomic motion constraints like the ones described in eq. (7.1). Each robot has been equipped with a laptop and a wireless antenna to communicate with the other two robots. Regarding the vision system of the robots, in most of the experiments we have used a Kinect camera onboard of each robot. In order to analyze the robustness of the controller when using different cameras in one of the experiments we have equipped one robot with a unibrain 7. Distributed Consensus in Control using Epipoles 145 Figure 7.7: Results of the simulation in the virtual environment. camera, which in addition to have different intrinsic parameters, it also has the disadvantage of acquiring images with radial distortion. The two cameras can be see in Figure 7.8 and an example of the images acquired by each camera is shown in Figure 7.9. Figure 7.8: Cameras equipped by the robots in the experiments. Figure 7.9: Example of images captured by the two cameras used in the experiments. We have used SIFT features and the 8 point algorithm with RANSAC for matching and computing the epipoles. Since in this environment the loop time is important, we have used images of resolution 320 ×240 pixels, reducing the time required to extract the SIFT descriptors. In addition, by using smaller images, the number of features was also reduced, which implies less communications between the robots. The drawback of this reduction is that there are some iterations in which the epipoles cannot be computed due to the lack of enough good matches to obtain a robust estimation. Distributed Consensus in Multi-Robot Systems with Visual Perception 146 Since there are only three robots, in all the experiments we have considered a fixed communication topology in which every robot can communicate with each other. In order to communicate, the robots have used a real time communication protocol [142]. Let us recall that the proposed method assumes some synchronicity between the robots, in the sense that the images acquired by all of them should be acquired at the same time. In a real scenario this is difficult to achieve. For that reason we have used a barrier scheme in which the robots do not acquire a new image until the previous one has been processed. The scheme followed by the robots at each iteration is described next: • Acquire an image and extract the SIFT descriptors. • Communicate to the other robots the descriptors. • Receive the SIFT extracted from the other two robots. • Match the received features with the extracted ones and compute the epipoles. • Compute the control velocity from the epipoles and send an ACK message to the other robots to acquire a new image. • Wait until the reception of the ACK of the other robots and begin with the whole process again. Although with this approach there are still some time gaps between some of the frames of the robots, they are negligible in the final results. The total time for each iteration is around 2 seconds, where most of the time is used in communicating the approximately 300 SIFT descriptors extracted per image (around 300KB). We have not dealt with packet drops, as this is handled by the communication protocol. In the following we describe the experiments carried out: Experiment outdoors In the first experiment we have taken the robots to the parking lot of the Engineering school of the University of Zaragoza. The robots move with constant linear velocity of 0.1m/s. The initial and final configuration of the robots can be seen in Figure 7.10. Since there is no common frame to measure the global orientation of the robots, we cannot offer ground truth results about the error in the initial and the final orientation. Nevertheless, in the figure we can see that the robots end up in a configuration with the same orientation (up to an acceptable error). Let us remark that although the robots that are behind can see the third robot in their images, this information is not used by the control law. The robot that does not see other robots in its image is also turning with the epipoles, as can be seen comparing its initial and final orientation in Figure 7.10. Additionally, the experiment shows that the controller presents some robustness against the planar motion assumption. When the robots left the lane, there is a bump that makes the image to be crooked (see Figure 7.11). The figure also serves as an example of the kind of images acquired by the robots in this experiments and the number of final matches computed at each iteration (around twenty per image). Experiment indoors We have also tested the controller in an indoor environment. In this case the robots do not move forward and only turn (vi= 0,∀i).The results of the experiment are shown in Figure 7.12. Again the robots end up in a configuration with all the orientations aligned. Experiment using different cameras Finally, as we have mentioned above, we have also evaluated the distributed control law equipping the robots with different cameras. In the last experiment two robots are still equipped with a Kinect sensor, but the third 7. Distributed Consensus in Control using Epipoles 147 Figure 7.10: Experiment with three robots outdoors. The initial configuration of the robots is shown on the left figure and the final configuration is shown on the right figure. Figure 7.11: Images acquired by the robots in the parking lot with the computed matches. The top image is slightly crooked due to the bump in the road (see the robot in the other two images). The controller seems to be robust to these small inclinations in the images. robot is equipped with a Unibrain camera. Figure 7.13 shows the initial and final configuration of the robots in this experiment. The unibrain camera has a larger value of αithan the Kinect cameras, however, the value of βhas been set to 500 for the three robots. Looking at the positions of the robots we can see that the relative bearing is neither zero nor π/2, which means that the final orientation should contain some error, as in eq. (7.8). However, the error in the final configuration is of the same magnitude as in the previous experiments, which means that in practice, the algorithm is more sensitive to the computation of the epipoles and the motion constraints of the robots than to the use of different cameras. 7.6 Discussion Summing up, we have dealt with the consensus problem of making a team of robots with non-holonomic constraints move with the same direction, also known as the attitude consensus problem or flocking. We have Distributed Consensus in Multi-Robot Systems with Visual Perception 148 Initial configuration Final configuration Matches between the robots Figure 7.12: Experiment in an indoors environment. In this case the robots have zero linear velocity, vi= 0, and only turn using the proposed controller. Initial configuration Final configuration Matches between the robots Figure 7.13: In this experiment one of the robots is equipped with a different camera (Unibrain) than the other two (Kinect). On the left figure we show the matches between the three cameras. The right figures show the initial and the final configuration of the robots, in which the three robots are aligned despite the different calibrations. presented a new vision-based distributed controller to reach this objective that does not require the robots to directly observe each other but common features of the environment. In this way the robots can reach the consensus while focusing on the perception and mapping tasks explored in previous chapters of the Thesis. Once again, the proposed method uses well known computer vision techniques to achieve the objective in a simple but efficient manner. We make use of the epipoles computed between the images of neighboring robots to estimate the misalignment in their orientations. The use of the epipoles presents several advantages: they do not require explicit computation of the relative motion between the robots or knowledge about the calibration 7. Distributed Consensus in Control using Epipoles 149 of the cameras and there are well known robust techniques for their computation. When all the robots are equipped with the same camera, the controller is able to reach the exact consensus even if the calibration is poorly estimated. In the more realistic scenario where different robots wear different cameras, we have given the expression of the error in the final configuration. In order to isolate the use of computer vision from communication and motion issues of the robots, we have tested our algorithm in a simulated virtual environment with ten robots. Using SIFT features and robust algorithms to estimate the epipoles, the robots achieve the consensus with very small errors. We have also evaluated our proposal using real robots with cameras and limited communications using a real-time protocol to exchange messages. We have seen that the controller works well both in indoor and outdoor environments and the robots are able to reach the consensus, up to an acceptable final error. To see the effect of using different cameras, we have considered a scenario where one robot was equipped with a different camera, with the property of having a high radial distortion. We have shown that in practice the calibration of the cameras is less of an issue than the amount of information the robots require to exchange. This brings up a set of interesting questions that can lead to new lines of research in distributed robotic problems dealing with vision sensors. Proofs Proof of Lemma 7.3.1 (Properties of the controller) First note that dij =−dji.Therefore, if |dij| ≤ π/2,then wij =−wji.In eq. (7.4), when |dij|> π/2, (π−|dij|)has the same sign that (π−|dji|)because |dij| ≤ π. But sign(dij)6=sign(dji), which implies that wij =−wji and 1) is proved. The proof of 2) is done decomposing the sum of wi, X i∈V wi=KX (i,j)∈E wij. Taking into account that the communication graph is undirected and wij =−wji,then the sum is equal to zero. To prove 3) let us consider that both epipoles have the same sign, without loss of generality, positive. The arc tangents have values in the interval [0, π/2) and therefore, the difference in eq. (7.5) belongs to the interval (−π/2, π/2). Proof of Theorem 7.3.2 (Convergence to a common orientation) Let θ(t)=(θ1(t), . . . , θN(t)).The proof is done using the following Lyapunov function V(θ) = X i∈V X j∈V 1 2(θj−θi)2=X i∈V X j∈V 1 2θ2 ij ≥0.(7.9) Note that due to the connectivity assumption, (7.9) is positive definite in terms of, for example, θi−θ1, i = 2, . . . , N. If we compute the derivative of Vwe obtain ˙ V=X i∈V X j∈V (θj−θi)(wj−wi).(7.10) We proceed to show that the derivative is negative if θij 6= 0. First, by developing (7.10) we obtain ˙ V= 2NX i∈V θiwi−X i∈V θiX j∈V wj−X i∈V wiX j∈V θj, Distributed Consensus in Multi-Robot Systems with Visual Perception 150 which by the second point of Lemma 7.3.1 is simplified to ˙ V= 2NX i∈V θiwi. Now, regrouping the terms yields X i∈V θiwi=KX i∈V θiX j∈Ni wij =K 2X (i,j)∈E (θi−θj)wij. Therefore, the derivative of Vcan be expressed as ˙ V=−KN X (i,j)∈E θijwij.(7.11) We show now that under the conditions stated in the theorem, the product θijwij is positive for all i, j. Let us first suppose that θij >0.We divide the analysis in four cases. The first two cases consider positive bearing angles: • Let ψij be positive and satisfying ψij ≥θij.In this case eij > eji ≥0.Since both epipoles have the same sign, using the third point of Lemma 7.3.1, 0< dij < π/2and then wij >0.Note that this case does not depend on the selection of β, provided that it has the same sign as α. • If θij > ψij ≥0then eji <0< eij,which implies that dij ≥0.However, if dij > π/2,then wij <0 and the control may not be stable. In order to have wij >0it must hold that dij ≤π/2,which is equivalent as to say that tan(dij)>0,therefore, using (7.3) and (7.5), tan(dij) = α β(tan(ψij)−tan(ψij −θij)) 1 + α2 β2tan(ψij) tan(ψij −θij)>0.(7.12) The numerator in (7.12) is always positive due to the conditions on θij and ψij.Then, to satisfy (7.12) it is required that 1 + α2 β2tan(ψij) tan(ψij −θij)>0, thus α β<s1 tan(ψij) tan(θij −ψij),(7.13) which depends on the ratio α/β. A lower bound of the right side of eq. (7.13) is provided later in the proof. Let us now analyze the cases of negative bearing angles: • Let us consider first ψij <0and θij −ψij < π/2.When this situation happens eji < eij <0and wij >0because of the third point of Lemma 7.3.1. Again, when the robots are in this configuration, the control does not depend on β. • The last case to analyze appears when ψij <0and θij −ψij > π/2.In this situation the epipoles have different sign, with eij <0< eji,which implies that, in order to have wij >0,it must happen that dij <−π/2.In other words, tan(dij)>0.Now, the numerator in (7.12) is always negative, which requires 1 + α2 β2tan(ψij) tan(ψij −θij)<0,