Distributed Localization without Direct Communication Inspired by Statistical Mechanics
Jingxian Wang, Tianye Wang, Wei Wang, Xiwang Dong, Yandong Wang
11 Distributed Localization without DirectCommunication Inspired by Statistical Mechanics
Jingxian Wang ∗ , Tianye Wang , Wei Wang ∗ , Xiwang Dong and Yandong Wang Abstract —Distributed localization is essential in many roboticcollective tasks such as shape formation and self-assembly.Inspired by the statistical mechanics of energy transition, thispaper presents a fully distributed localization algorithm namedas virtual particle exchange (VPE) localization algorithm, whereeach robot repetitively exchanges virtual particles (VPs) withneighbors and eventually obtains its relative position from thevirtual particle (VP) amount it owns. Using custom-designedhardware and protocol, VPE localization algorithm allows robotsto achieve localization using sensor readings only, avoidingdirect communication with neighbors and keeping anonymity.Moreover, VPE localization algorithm determines the swarmcenter automatically, thereby eliminating the requirement offixed beacons to embody the origin of coordinates. Theoreticalanalysis proves that the VPE localization algorithm can alwaysconverge to the same result regardless of initial state and has lowasymptotic time and memory complexity. Extensive localizationsimulations with up to 10000 robots and experiments with 52 low-cost robots are carried out, which verify that VPE localizationalgorithm is scalable, accurate and robust to sensor noises. Basedon the VPE localization algorithm, shape formations are furtherachieved in both simulations and experiments with 52 robots,illustrating that the algorithm can be directly applied to supportswarm collaborative tasks.
Index Terms —Distributed Localization, Statistical Mechanics,Virtual Particle Exchange, Robot Swarm, Shape Formation
I. I
NTRODUCTION S WARM robotics has been drawing more and more atten-tion in robotics community due to its attractive propertiesincluding scalability and adaptability, and high resistanceto failure. Many collective tasks such as shape formation,reconfiguration, and self-assembly [1]–[8] usually require theknowledge of relative position of robots in the swarm. Deploy-ing external localization beacons like indoor motion capturesystem [9], [10] or outdoor Global Positioning System (GPS)[11], [12] is one feasible solution for some swarm systems.However, external beacons are not the solution for manyscenarios. For robots carrying out search-and-rescue tasksin hazardous or remote locations, setting up motion capturesystem is hard and GPS will be unavailable if robots are indooror underground. Furthermore, carrying receiver of GPS can be
This work was supported by the National Natural Science Foundation ofChina under Grants 61922008, 61973013 and 61873011. School of Physics, Peking University, Beijing 100871, China. Department of Urban Studies and Planning, Massachusetts Institute ofTechnology, Cambridge, MA 02139, USA. Computer Science and Artificial Intelligence Laboratory, MassachusettsInstitute of Technology, Cambridge, MA 02139, USA. School of Automation Science and Electrical Engineering, Beihang Uni-versity, Beijing 100191, China. ∗ Corresponding authors: [email protected]; [email protected]. a great burden for swarm systems consisting of numerous tinyrobots which are usually weak in sensing and computation.When external beacons are not desirable, it would be morepractical to rely on on-board sensing and/or internal com-munication among robots. The restrictions including sensing,computing, power and size make the development of relativelocalization algorithms in swarm systems challenging.Previous relative localization algorithms mainly fall intotwo categories: multi-hop and optimization-based. In multi-hop localization category, the simplest approach [1], [6], [13],[14] is to set up a certain amount of fixed pre-assigned beaconsand let other robots acquire their positions by comparing withneighbors. This idea is further developed by adding Kalmanfilter [15], [16] or uncertainty evaluation process [17], [18] toaddress the problem of error accumulation through multiplehops and achieve better localization accuracy. Some otherefforts went into reducing information needed in multi-hoplocalization algorithms. For example, Moore et al . employedsine theorem to estimate relative angle between robots in lo-calization process [19] with only relative distance information.Another example is Cornejo et al . in which sine theorem isused to estimate relative distance between robots in localiza-tion process with only bearing measurements [20]. It is inter-esting that Pillai et al . introduced a process to automaticallyselect the origin of the coordinate system [14] and achievedlocalization without pre-defining the beacon point, though inthis approach the origin of coordinate system is random, whichis not favorable. A general deficiency in multi-hop methodsis that one usually need to setup a fraction of predefinedbeacons first in order to obtain an accurate result, and lowbeacon fraction would lead to low localization accuracy due topropagation of error [21], [22]. This drawback poses difficultyto the deployment of large multi-hop localization systems.In optimization-based category, robots obtain their localiza-tion results by implementing global optimization process likemulti-dimensional scaling (MDS) [23] or regularized semi-definite programming (SDP) relaxation [24] to minimize thedisagreement between the localization results and robots’ mea-surements of relative position of neighbouring robots. How-ever, these optimization methods are inherently centralized,thus are not suitable for large scale robot swarms. To addressthis problem, divide-and-conquer methods are developed todistribute optimization tasks to different robots [25], [26].However, task distribution could be complex, and alignmentprocess [26] requires extra attention to avoid misalignededges or other defects and will fail sometimes. Moreover,optimization-based methods do not always guarantee conver-gence to the most optimal solution and can generate highly a r X i v : . [ c s . R O ] J un unreasonable results in some occasions [26].It is worth noting that in many swarm tasks such as shapeformation [1], collective robotic construction [27] and collec-tive transport [28], [29], it is desirable to have a predictableand stable origin of coordinate system so that when robotsmove, their localization results will not vary significantly.This is not a problem when external or internal beacons arepresented because beacons effectively define a stable coor-dinate system, however, things are different in homogeneousrobot swarms where there is no predefined beacon. Multi-hop based algorithms rely heavily on predefined beacons. Ina homogeneous robot swarm where no predefined beacon isavailable, the only way for multi-hop based algorithms atpresent is to randomly select a robot as the beacon as well asthe origin [14]. Therefore, there is no guarantee that the originwill be the same in two trials of localization. Optimization-based algorithms suffer from the same issue as well becausethese algorithms’ optimization goals usually only include the difference of localization results, but not the absolute value ofthem.When choosing an localization algorithm for a swarm robotsystem, one needs to evaluate multiple aspects of the algo-rithm. Since swarm robots typically have limited computingresources, algorithms which are stable and have low timeand memory complexity are desirable. Moreover, hardware re-quirements to carry out the algorithm are equally important. Itis best if the hardware requirements are as simple as possible,because complex hardware increases the failure probabilityin large-scale systems. For better comparison, representativepapers are analyzed in the aspect of asymptotic time andmemory complexity and convergence behavior in Table I andin the aspect of their requirements for hardware in Table I. Algorithm Method Distri-buted? Time Memory Localminima[1] Multi-hop (cid:88) O ( l ) O ( ) [6] Multi-hop (cid:88) O ( l ) O ( ) [13], [14] Multi-hop (cid:88) O ( l ) O ( ) [15] Multi-hop (cid:88) O ( l ) O ( ) [16] Multi-hop (cid:88) O ( l ) O ( ) [17] Multi-hop (cid:88) O ( l ) O ( N ) [18] Multi-hop (cid:88) O ( l ) O ( ) [19] Multi-hop (cid:88) O ( N ) O ( ) [20] Multi-hop (cid:88) O ( l ) O ( ) [23] Optimization ◦ O ( N ) ∗ O ( N ) ∗ none[24] Optimization ◦ O ( N ) O ( N ) possible[25] Optimization ◦ O ( kN ) O ( N / k ) possible[26] Optimization ◦ ≈ O ( N ) O ( ) unlikelyTABLE IComparison of various algorithms’ inherit property. While evaluatingasymptotic time complexity of algorithms, let N represent the number ofrobots in the swarm, l represent the 1D span of the swarm (e.g. l ≈ √ N in2D scenarios), and let k represent the number of beacons in the swarm. (cid:88) means the algorithm is distributed, and ◦ means the algorithm can work inwith both centralized and distributed theme. The problem of local minimaonly exists in optimization-based algorithms which used gradient descent.Asymptotic time and memory complexity of algorithm presented in [23] arecalculated based on the centralized themes, and asymptotic time complexityfor algorithm presented in [26] is estimated using the simulation resultsprovided in the paper. It could be seen that multi-hop algorithms are more de-manding in beacons, but have better asymptotic time andmemory complexity, while optimization based ones are just
Algorithm Topology Direction Distance Beacons DirectComm.[1] ∗ (cid:88) × × multiple (cid:88) [6] ∗ (cid:88) (cid:88) × single (cid:88) [13], [14] ∗ (cid:88) (cid:88) × single (cid:88) [15] (cid:88) × (cid:88) multiple (cid:88) [16] (cid:88) ◦ (cid:88) ◦ (cid:88) [17] (cid:88) × (cid:88) multiple (cid:88) [18] (cid:88) × (cid:88) multiple (cid:88) [19] (cid:88) × (cid:88) multiple (cid:88) [20] (cid:88) (cid:88) × × (cid:88) [23] (cid:88) × ◦ × (cid:88) [24] (cid:88) × (cid:88) multiple (cid:88) [25] (cid:88) × (cid:88) multiple (cid:88) [26] (cid:88) (cid:88) × × (cid:88) TABLE IIComparison of various algorithms’ requirements for hardware. (cid:88) means thealgorithm requires the corresponding information in order to work, ◦ meansthe algorithm can work with or without this information, and × means thealgorithm can not accept this information. Algorithms presented in [1], [6],[13], [14] require robots to form certain lattice structure with fixed distancebetween adjacent robots. the opposite. Few algorithm combines low asymptotic timeand memory complexity, low requirement for hardware and theconvenience of beacon-less. Furthermore, to the best knowl-edge of the authors, current algorithms in both categories allrequire explicit communication between robots, which meansrobots need to have means to identify neighboring robots andsend message to and/or receive messages from neighboringrobots. This demands higher hardware capability and morecomplex code compared with algorithms which do not requireexplicit communication between robots.Motivated by the challenges stated above, a novel approachto realize fully distributed localization based on the statisticalmechanics of energy transition is proposed in this paper.The localization algorithm is inspired by observations andnumerical simulations of microscopic particle system. It isknown that in a system of microscopic particles, regardlessof initial state, the particle distribution on all energy levelswould eventually reach statistical equilibrium through constanttransitions and the amount of particles on a state will reflect theenergy of the state. Similarly, in VPE localization algorithm,each robot represents a virtual energy level(VEL), has anumerical value representing VP amount it owns, repetitivelysends VPs to neighbors and receives VPs from neighbors, andfinally acquires the localization result through VP amount itowns in the final state.In VPE localization algorithm, because each robot willrepresent a VEL and exchange VPs with other robots withthe same rules, it is inherently fully distributed and can workwith homogeneous swarm. Because each robot only needsto remember how much VPs it owns at present, memoryrequirement is minimal. The algorithm can function wellwithout beacons by design, since the particle exchange processis only related to the relative position of robots and doesnot need to follow any specific order. However it can alsowork with existing beacons to increase localization accuracy(see explanation in Section II-B). Because of a meticulousmathematical coincidence, VPE localization algorithm can becarried out without each robot knowing relative position ofneighboring robots and even without direct communicationbetween robots. In particular, this paper contributes in the following direc-tions: • VPE localization algorithm is fully distributed, andall robots carrying out VPE localization algorithmare indistinguishable, anonymous and work in a non-communication way. Robots do not need to distinguishand communicate directly with neighbors to exchangeVPs, alternatively, they can also use simple light sensorsto sense and calculate VPs. By contrast, almost all previ-ous works assumed that robots can directly communicateto exchange arbitrary data with other robots and candistinguish other robots. Therefore, our algorithm is lessdemanding for hardware and is more resistant to additionor removal of robots. In addition, this work also hastheoretical value by presenting an example of generatingspecific swarm behaviors (localization and shape forma-tion) without direct communication between individuals. • VPE localization algorithm is stable and has low asymp-totic time and memory complexity. Each robot woulddo the same amount of calculation in each iterationregardless of the swarm size, which is suitable for largescale swarms. Theoretical derivation proves that the VPElocalization algorithm always converges and the rela-tionship of the localization result with the initial stateonly includes a global translational factor determined byinitial total VP amount. Furthermore, in a simplified casewhere robots are positioned on a rectangular grid and cancommunicate with immediate neighbors, asymptotic timecomplexity of VPE localization algorithm is proved to be O ( l ) where l is the 1D dimension of the swarm. Amongall representative algorithms in Table I, only pure multi-hop methods have asymptotic time complexity of O ( l ) .Moreover, local minimal problem [26] and complicatedalignment process in divide-and-conquer methods will notappear in VPE localization algorithm. • The algorithm has no requirements for internal or externalbeacons to embody the origin of coordinate system.Instead, in VPE localization algorithm, the origin of co-ordinate system will automatically locate near the centerof the swarm. This feature means that all robots in thelocalization can be homogeneous, which simplifies thedeployment of robot swarms. To the best of the authors’knowledge, this feature is not presented in all previousworks concerning distributed localization. • The algorithm can be executed with minimal hardwareresources and is flexible as well. In Section II-C wepresent a way to execute VPE localization algorithmwithout explicitly detecting neighboring robots’ positionor bearing or even without identifying neighbours. How-ever in Section II-B we also show that VPE localizationalgorithm can work with robots with communicationability and can utilize beacons as well as relative directionand distance information between robots to generate moreaccurate localization result. • Localization and shape formation experiments are carriedout on 52 self-designed low-cost robots, proving that theproposed localization algorithm is suitable for real world applications.The paper is organized as follows. Section II presentsgeneral VPE localization algorithm as well as a modifiedversion which does not require direct communication betweenrobots along with detailed pseudo-code and hardware require-ments. Section III demonstrates theoretical derivation about theconvergence and asymptotic time complexity of proposed lo-calization algorithm. To demonstrate the performance of VPElocalization algorithm in simulations and on robot swarms,Sections IV and V present results in localization and shapeformation simulations and experiments. Section VI addressesseveral issues regarding performance of VPE localization al-gorithm and hardware setups. Section VII concludes the work.Additionally, we also recorded a video for better illustration and open-sourced our code for simulation .Throughout this paper, for simplicity of notation, n and n will denote zero column vectors and one column vectorswith dimension n respectively, m × n will denote zero matriceswith m rows and n columns, I n will denote identity matricesof rank n , ˆ x and ˆ r will denote the unit vector along x axisand vector (cid:126) r respectively, U T will denote the transpose ofvector or matrix U , x ∝ y means x is proportional to y , (cid:98) x (cid:99) will denote the largest integer smaller or equal to x , (cid:126) u · (cid:126) v willdenote the scalar product of vector (cid:126) u and (cid:126) v , (cid:107) v (cid:107) will denote √ v T v , and diag { a , a , · · · , a l } will denote a diagonal matrixof dimension l × l with a , · · · , a l as its diagonal element.II. D ESIGN OF
VPE
LOCALIZATION ALGORITHM
In this section, we first explain the physical principle ofthe VPE method, and then propose a general algorithm ofdistributed localization using VPE method.
A. Physical basis of VPE localization algorithm
In the most probable state of a closed system with constanttemperature T and is composed of identical near-independenttraditional particles (i.e. Nitrogen molecules in a room),amount of particles on different energy levels follows theBoltzmann distribution n i ∝ e − β E i (1)where n i is the number of particles on a specific state i withenergy E i , and β = B T where k B is Boltzmann constant.This equation shows that particles tend to stay in states withlower energy. Describing it in the opposite way, it can alsobe said that the amount of particles in the state reflects theenergy of the state. In order to observe the evolution of suchsystems, Markov chain Monte Carlo (MCMC) simulations areoften used [30], in which a large number of particles arespawned and allowed to transit from a state to another witha certain probability. Eventually, when equilibrium is reached,the distribution of particles will follow a certain distributionwhich, in this case, is the Boltzmann distribution. It is obviousthat a transition probability P in the form of Code written in Mathematica could be downloaded at https://github.com/wjxway/VPE-localization-algorithm P ∝ e − β ∆ E (2)can lead to Boltzmann distribution, where ∆ E denotes theenergy required in a particle’s transition, in other words, thedifference in energy when a particle stays in the state aftertransition and before transition.The relation between Equation 1 and 2 is intriguing. Whilethe transition probability P of particles depends solely on ∆ E which is the relative energy difference, when the particledistribution reaches equilibrium state, the amount of particlesin a specific state will indicate global information of the energylevel of state E i .Mimicking the behavior of particles in the thermal dynamicsystem, we let each robot correspond to a virtual energylevel (VEL) which holds a certain amount of virtual particles(VPs) and let VPs transit from a VEL to another throughcommunications between robots with transition probabilitysimilar to (2) but replace the energy E i with the robots’ x coordinate x i . We can expect that in the equilibrium state,the distribution of VPs will be related to the x coordinatesof robots. In this way, a robot can determine its relativeposition in the swarm by the amount of VPs it owns in theequilibrium state. We name this as Virtual Particle Exchange(VPE) localization algorithm. B. Localization based on VPE localization algorithm
When trying to perform localization using VPE localizationalgorithm, a orthogonal coordinate system should be con-structed first, and then each components of robots’ positioncan be determined separately by executing VPE localizationalgorithm. For example, in a scenario when robots are dis-tributed on a 2D plane, each robot should first agree on acommon x and y direction (possibly using compass), then runVPE localization algorithm twice to determine the x and y components of its location.Writing down the algorithm described in Section II-A in de-tail, we get the general process of VPE localization algorithmwhich consists of three main steps:(1) Each robot is given a certain amount of VPs.(2) Robots exchange VPs repetitively according to theamount of VPs they own and the relative displacement.(3) Robots extract desired results from the amount of VPsthey own in the equilibrium state.In further discussion we name the second step as VPEprocess, which is the most important step in VPE localizationalgorithm.Mathematically speaking, in VPE process the configurationof robot swarm could be described by an undirected weighedgraph G ( V , Γ ) , where V is the set of all l robots (vertexes)and Γ is the weighted adjacency matrix with its element Γ i , j representing how closely robot i is connected to robot j . Γ i , j could be relevant to connection topology, hardware andsoftware settings, and relative distance between robots. Forexample, In Section II-C, Γ i , j represents the intensity of lightsensed by robot j when robot i is emitting isotropic light of unit intensity. In this case, due to the reversibility of light, Γ i , j = Γ j , i holds, thus G is an undirected weighed graph.To describe the state of the system, a series of vector ξ ( n ) are used, where superscript n stands for iteration count(which can be omitted if unnecessary). Element i in vector ξ ( n ) ( ξ ( n ) i ) represents the amount of VP robot i owns. Usingprevious definitions, the VPE localization algorithm is givenin Algorithm 1. Algorithm 1
VPE localization algorithm
Input:
Topology of robot swarm G ( V , Γ ) , relative distancebetween robots (cid:126) r i , j = (cid:126) r j − (cid:126) r i . Output: x component of localization result, χ i , x , for allrobots. Notation Remarks: n m - iterations to calculate (predefined).k - constant controlling the speed of particle transition.k - constant controlling the anisotropical distribution ofVP transition. for each: robot i ∈ V . (cid:46) Initialization: ξ i ← (cid:46) VPE process: for n = → n m − do ξ i ← ξ i + ∑ j (cid:54) = i ξ j P j , i − ξ i P i , j (3) s.t. P i , j = Γ i , j k e − k (cid:126) r i , j · ˆ x (4)where P i , j represents the possibility for VPs owned byrobot i to transit to robot j in this iteration. end for (cid:46) Result Extraction: χ i , x ← − ln ξ i The similarity between VPE localization algorithm andphysical particle transition is clear. In the initial state, all robotsown 1 unit of VPs, and then VPs start transiting betweenrobots (VELs) with probability P i , j = k Γ i , j e − k (cid:126) r i , j · ˆ x , which is(2) with substitution ∆ E = β (cid:126) r i , j · ˆ x . Thus, the correspondingpotential energy of a VP possessed by robot i is E i = β x i + E where x i is the x coordinate of robot i and E is a constant.In the equilibrium state of such a system, as described in (1), ξ i ∝ e − β E i ∝ e − x i and x i = − ln ξ i + x = χ i , x + x where x is a global constant representing the shift of the origin of thecoordinate system. The equation takes the same form as theequation used in step 5 in Algorithm 1.An illustration of VPE process is shown in Figure 1,which shows that after a few iterations, VPs gather on robotswith smaller x coordinates and VP distribution reaches aequilibrium state in which the amount of VPs received and sentby a robot in each iteration equals. In the equilibrium state,the amount of VPs each robot owns follows the relationship ξ i ∝ − e x i as previously described.In practice, in order to set the origin near the center ofswarm, VPE process is run twice using opposite x + direction X + ( a ) Initial stateIteration 0 ( b ) Intermediate stateIteration 3 ( c ) Nearly equilibrium stateIteration 30
Fig. 1. Illustration of different states in a VPE process. Each Black circlerepresents a robot unit positioned at the center of it and small blue circlesinside represent VPs a robot owns. Robots can exchange VPs with robots in6 units. The exchange of VPs is represented by arrows between robots, withthe amount of VPs transferred reflected by the thickness of the arrow. Notethat in real applications VP amounts are real numbers instead of integers. and then the localization result is calculated using χ i , x = ln ξ ( f ) i , − − ln ξ ( f ) i , +
4k (5)where ξ ( f ) i , + and ξ ( f ) i , − are VP amount in final states of twodifferent VPE processes executed with opposite x + direction.This method is used in all further simulations and experiments.Algorithm 1 can be directly implemented in robot systemswhere each robot can obtain the relative position of otherneighboring robots and can exchange data via one-to-onecommunication (configuration 1 in Table I), and can also workwith beacons with pre-defined position by fixing the amount ofVPs owned by beacon robots i at ξ i = exp ( − (cid:126) r i · ˆ x ) . Thoughthese two requirements can easily be met in modular robotswarm [2]–[6], for other swarms in which robots are scatteredin 2D or 3D [1], [9]–[12], these two requirements can be toohard or too expensive to achieve.Slight modification can be made to the algorithm to makeit work with fewer available information and consume lesshardware resource (details provided in the next subsection).In scenarios where robots are approximately evenly spaced, (cid:126) r can be approximated by r ˆ r where r is the weighed averagedistance between connected robots. In this case, Equation 4and line 5 in Algorithm 1 should be changed to P i , j = Γ i , j k e − k ˆ r i , j · ˆ x (6) χ i , x = − r ln ξ i
2k (7)respectively, where k is another constant controlling the speedof particle transition, just like k . Further discussion is allbased on this modified algorithm.C. Detailed code and hardware requirements for each robotto achieve localization without direct communication
Previous discussion focuses on the mathematical aspectof VPE localization algorithm, in which the swarm and thelocalization process is abstracted to a vector ξ and mathe-matical operations on it. However, how these operations arecarried out by robots is an equally important problem, whichdetermines whether the algorithm is distributed, whether thealgorithm requires direct communication between robots, and sometimes the asymptotic time and memory complexity of thealgorithm. In this section, hardware requirements of robots andpseudo-code executed by each robot are presented. By carryingout such code on every robot in the swarm synchronously,the whole swarm effectively executes the VPE localizationalgorithm in a distributed and direct communication-free way.In order to achieve localization without direct communi-cation between robots, we require that each robot possessfollowing two abilities:(i) Sense ambient light intensity.(ii) Emit light with given intensity and angular distribution.These two requirements can easily be satisfied in systemsbased on unmanned cars, as it only requires an extra emitter-receiver ring mounted on each robot. A prototype of the ringis shown in Figure 9.In the localization process, instead of identifying otherrobots or sending digital signal to other robots, robots changethe light intensity distribution in their vicinity and executelocalization based on the variation of ambient light intensitythey sensed. Thus this algorithm has no need for directcommunication between robots. To some extent, we can evenconsider VPE localization algorithm as a sensing-based algo-rithm.The key is how can Algorithm 1, especially line 3, berealized using just the two abilities mentioned above. It is nothard to imagine that the process of sending VPs to other robotswith amount defined by ξ i P i , j can be achieved by emitting lightwith angular distribution I ( ˆ r ) = ξ i k e − k ˆ r · ˆ x (8)and then letting robots sense the change in ambient light(for clarity, we name this process as ‘original process’). Thechange in ambient light s i sensed by robot i is just the sum ofcontribution of all robots, which can be expressed by s i = ∑ j ∈ V Γ j , i ξ j k e − k ˆ r j , i · ˆ x = ∑ j ∈ V ξ j P j , i (9)which is exactly what we wanted.However, problem arises because robots cannot directlycommunicate with other robots: robots cannot know how manyVPs they send to other robots in an iteration. Fortunately,this can be solved by introducing an additional process whererobots emit light with angular distribution I ( ˆ r ) = k e k ˆ r · ˆ x (10)and then let robots sense the change in ambient light. In theequation, k is a constant controlling the intensity of lightemitted. Similarly, the change in ambient light c i sensed byrobot i can be expressed as follows c i = ∑ j ∈ V Γ j , i k e k ˆ r j , i · ˆ x (11)Regarding c i we have the following relationshipk ξ i k c i = k ξ i ∑ j ∈ V Γ j , i e k ˆ r j , i · ˆ x = ∑ j ∈ V ξ i P i , j (12)Surprisingly, the right hand side represents the amount of VPsrobot i sends to other robots. Adding ξ i on both sides ofEquation 9 and subtracting Equation 12 produces ( − c i k k ) ξ i + s i = ξ i + ∑ j ∈ V ξ j P j , i − ξ i P i , j = ξ i + ∑ j (cid:54) = i ξ j P j , i − ξ i P i , j (13)The right hand side of this equation is Equation 3 inAlgorithm 1, while the left hand side is only dependent tolight intensity sensed by robot i and amount of VPs ownedby robot i . Equation 13 shows that robots can carry outlocalization using VPE localization algorithm without directcommunication with any other robots if they have the twoabilities listed above. For better comprehension, an illustrationof the relationship between the additional process and theoriginal process is given in Figure 2, and a detailed pseudo-code executed by each robot is described in Algorithm 2. Light Emitted Light Sensed O r i g i n a l P r o ce ss A dd iti on a l P r o ce ss x + ( a ) x + ( b ) x + ( c ) x + ( d ) Fig. 2. Illustration of robots’ communication pattern. In the figure, each robotis represented by a circle and the robot we would like to focus on is coloredin blue, the value inside each circle represents VP amount each robot ownsand the value next to each arrow represents the contribution of the robot onthe tail of the arrow to the light intensity measured by the robot on the head ofthe arrow. The figure shows that although a robot can only measure the lightintensity it received, i.e. the second column, through the introduction of theadditional process, a robot can obtain both the information of how much VPsit sends and how much VPs it receives in an iteration due to the similarityof light emitted in the original process (subfigure a) and light sensed in theadditional process (subfigure d).
Algorithm 2
Pseudo-code for localization in x axis Input:
All robots:a. Share a common x direction.b. Can emit light with anisotropic angular distributionand sense ambient light intensity. Output:
Localization result χ x for all robots. Notation Remarks: ξ + , ξ − - floating point numbers representing the amountof VPs possessed by a robot. n m - iterations to calculate (predefined). ˆ r - light emitting direction.k , k - constants controlling the intensity of light emitted.k - constant controlling the anisotropic distribution of lightemitted.r - weighed average distance between connected robots. for each: robot i ∈ V . ξ + ← Begin emitting light with angular distribution I ( ˆ r ) = k e k ˆ r · ˆ x c ← sensed ambient light intensity. Stop emission. for n = → n m − do Time synchronization. Possible addition: repeat line 2-4. Begin emitting light with angular distribution I ( ˆ r ) = ξ + k e − k ˆ r · ˆ x . s ← sensed ambient light intensity. Stop emission. ξ + ← (cid:16) − c k k (cid:17) ξ + + s Possible addition: calibrate total VP amount usingcode given in Algorithm 3 in appendix. end for repeat line 1-13 with inverted x axis and store the resultas ξ − . χ x ← r ξ − − ln ξ + .III. A NALYSIS OF
VPE
LOCALIZATION ALGORITHM
VPE localization algorithm is analyzed in two aspects in thissection: convergence and asymptotic time complexity. The-oretical derivation suggests that VPE localization algorithmwill always converge to the same result regardless of initialstate. Furthermore, the asymptotic time complexity of VPElocalization algorithm applying on rectangular lattice is Θ ( l ) where l represents the 1D size of the lattice. A. Convergence of VPE localization algorithm
In following discussion, we consider a VPE localizationalgorithm applied on a connected homogeneous robot swarmconsisting of l robots under following two assumptions: Assumption . Robots can be considered as stationary in alocalization process.
Assumption . All robots send and receive VP synchronouslyin VPE process.
Remark . Assumption 1 is satisfied if robots execute Algo-rithm 2 much faster than they move or if robots take steps toupdate their positions and keep stationary when localization isin progress.The proof is based on five important properties of VPElocalization algorithm:(i) In the initial state, VP amount on all robots are positive.(ii) Amount of VPs transmitted from robot i to robot j inan iteration is never negative.(iii) Amount of VPs transmitted from robot i to robot j inan iteration is linearly correlated to ξ i . (iv) A robot will not give all its VPs to neighbors in aniteration.(v) The swarm is connected.One can verify that properties (i,ii,iii,v) are automaticallysatisfied by Algorithm 2, and property (iv) will be satisfied iffor all robot i , ∑ j (cid:54) = i P i , j < Theorem 1.
VPE localization algorithm will always convergeif Assumption 1 and 2 and Equation 14 hold. Furthermore, thelocalization result will converge to a point which is relevantto the configuration of robot swarm, only shift as a wholewhen the total amount of VPs changes, and is irrelevant tothe distribution of VPs in the initial state.Proof:
We should first convert theorem into a mathemati-cal form. Assumptions 1, 2, and property (iii) mean VPE pro-cess could be considered as a series of linear transformationson VP vector described by ξ ( n + ) = T ξ ( n ) (15)where T = − l ∑ i = P i P · · · P l ,1 P − l ∑ i = i (cid:54) = P i · · · P l ,2 ... ... . . . ... P l P l · · · − l − ∑ i = P l , i (16)is the VP transition matrix. Similarly, properties (ii) and (iv)can be interpreted as follows: for all i ∈ V and j ∈ V , j (cid:54) = i , (cid:40) T i , j ≥ T i , i > U which satisfies U T U T = (cid:18) Q R S (cid:19) (18)where Q and S are square matrices with non-zero dimension.Equivalently, this means matrix T is irreducible.Because T is non-negative, irreducible and for all i , T i , i > T is primitive(i.e. there exists a natural number m which lets T m be allpositive), thus Perron-Frobenius theorem could be applied,which indicates the following three properties:(i) the PerronFrobenius eigenvalue (eigenvalue of matrix T with largest absolute value) r satisfies1 = min i l ∑ j = | T j , i | ≤ r ≤ max i l ∑ j = | T j , i | = r are one-dimensional. In further discussion, v will denote theright eigenvector which satisfies ∑ li = v i = w T willdenote T l which is evidently a left eigenvector of T andsatisfies w T v =
1. (iii) the limit of T n satisfieslim n → ∞ T n r n = vw T (20)Using all three properties, we can deduce that ξ ( ∞ ) = lim n → ∞ T n ξ ( ) = v ( w T ξ ( ) ) = v l ∑ j = ξ ( ) j (21)Plugging Equation 21 into Equation 7, the converging pointof localization result is obtained as follows χ i , x = − r ( ln v + ln ( l ∑ j = ξ ( ) j )) (22)which means the localization result will converge to a pointwhich is relevant to the configuration of robot swarm, onlyshift as a whole when the total amount of VPs changes, andis irrelevant to the distribution of VPs in the initial state.It is worth noting that if Algorithm 1 is used, i.e. P i , j = k Γ i , j e − k (cid:126) r i , j ˆ x , then v = e − x i ∑ lj = e − x j , thus in the equilib-rium state the localization result will satisfy χ i , x = x i +( ln ( ∑ lj = ξ ( ) j ) − ln ( ∑ lj = e − x j )) , which means the localizationresult will be accurate after a translation to align the centroidof localization result and the centroid of the swarm. Remark . By Observing the convergence behavior of ξ ( n ) − ξ ( ) , one could notice that the difference converges with a ratedominated by | λ | n where λ is the eigenvalue of T whichhas the second largest absolute value. This means that errorconverges linearly, and the rate of convergence is determinedby | λ | . Remark . Due to the exponential shrinking behavior ofcomponents corresponding to eigenvalues except for the Per-ronFrobenius eigenvalue, the algorithm will be numericallystable and error resistant if a normalization is performed on ξ regularly to prevent changes of total VP amount (i.e. thecomponent corresponding to PerronFrobenius eigenvalue).A typical normalization method could be N ( ξ ( n ) ) = l ξ ( n ) ∑ j ∈ V ξ ( n ) j (23)which keeps the VP amount per robot fixed at 1. Detailedpseudo-code for normalization is provided in Algorithm 3 inappendix.Through regular normalization, the convergence of theentire algorithm under noise could be ensured. Experimen-tal demonstration of the effectiveness of such normalizationmethod against noise and drift is presented in Figure 12. B. Asymptotic time complexity of VPE localization algorithm
In this section, a semi-quantitative analysis about theasymptotic time complexity of VPE localization algorithmis provided. Because robots update their position estimationiteratively in VPE localization algorithm and the time requiredto execute an iteration does not vary with the size of theswarm, in following discussion we will use iterations requiredto reach a certain accuracy as the measurement of executiontime.
In following discussion, we mainly concern a scenario asillustrated in Figure 3, where l robots are distributed evenly ona 1D straight line with a gap of 1 unit and can only exchangeVPs with immediate neighbors. Furthermore, the localizationaccuracy δ ( n ) in a certain iteration n is defined as the maximumdiscrepancy between the localization result in this iteration andthe converging point of localization result, i.e. δ ( n ) = max i | χ ( n ) i , x − χ ( ∞ ) i , x | (24)where χ ( n ) i , x represents the localization result calculated withthe VP distribution ξ ( n ) in iteration n using Equation 7, thatis χ ( n ) i , x = − r ln ξ ( n ) i
2k (25)
Fig. 3. A simplified model where l robots represented by black dotscan exchange VPs with their immediate neighbors according to previouslymentioned rules. ε and ε are two transition parameters. Theorem 2.
In a 1D robot swarm described above, theiteration n required to achieve an accuracy of δ ( n ) ≤ δ ≤ is Θ ( l ) where l is the number of robots.Proof: In this case, VP transition matrix T is T l × l = − ε ε ε − ε − ε ε . . . . . . . . . ε − ε − ε ε ε − ε (26)where ε = k e − k , and ε = k e k . Without loss of generality,further assume ε < ε and name γ = ε ε . Using these notations,linearly independent eigenvectors { v q } ( q =
1, 2, · · · , l ) andcorresponding eigenvalues { λ q } ( q =
1, 2, · · · , l ) of matrix T can be expressed as follows λ = ( v ) i = γ − i λ p = − ε − ε + √ ε ε cos ( p − ) π l ( v p ) i = γ − i cos (cid:18) i ( p − ) π l + φ p (cid:19) (27)where index p =
2, 3, · · · , l , and φ p satisfycos ( φ p ) = √ γ cos (cid:18) ( p − ) π l + φ p (cid:19) (28)For clarity, matrices S and S (cid:48) are introduced with definitionas follows. S (cid:48) = diag (cid:110) γ , γ , · · · , γ l (cid:111) (29) S = diag (cid:110) γ , γ , · · · , γ l (cid:111) = S (cid:48) (30) Because S (cid:48) T S (cid:48)− is a symmetric matrix, its eigenvectorsare orthogonal, thus we have the following relationship foreigenvectors { u q } ( q =
1, 2, · · · , l ) of matrix ST S − u = l (31) u T i S − u j = ( i (cid:54) = j ) (32)Further define operation (cid:107) v (cid:107) S which maps a vector of dimen-sion l to a non-negative real number by (cid:107) v (cid:107) S = √ v T S − v (33)It is evident that for arbitrary vector v of dimension l ,max i | v i | ≤ γ l (cid:107) v (cid:107) S .Now we proceed to discuss the converging behavior of δ ( n ) which can be expressed using ξ as follows δ ( n ) = max i (cid:12)(cid:12)(cid:12)(cid:12) ln (cid:18) + γ i ξ ( n ) i − γ i ξ ( ∞ ) i γ i ξ ( ∞ ) i (cid:19)(cid:12)(cid:12)(cid:12)(cid:12) ln γ (34)Noticing that γ i ξ ( ∞ ) i is the same for all index i , a sufficientcondition for δ ( n ) < δ can be expressed asmax i (cid:12)(cid:12)(cid:12) γ i ξ ( n ) i − γ i ξ ( ∞ ) i (cid:12)(cid:12)(cid:12) ≤ ψ ( − γ − δ ) (35)where ψ = γ i ξ ( ∞ ) i . At the same time, γ i ξ ( n ) i is also the i thcomponent of S ξ ( n ) , thus by using the property of (cid:107) · (cid:107) S , asufficient condition for inequation 35 is (cid:107) S ξ ( n ) − S ξ ( ∞ ) (cid:107) S ≤ γ − l ψ ( − γ − δ )) (36)If S ξ ( n ) is decomposed using eigenvectors of ST S − as S ξ ( n ) = ( ST S − ) n ( S ξ ( ) ) = l ∑ i = a ( n ) i u i (37)where a ( n ) i is the component of S ξ ( n ) on u i . The followingrelationship of coefficient a ( n ) i could be found a ( n ) i = λ ni a ( ) i (38)which means S ξ ( n ) − S ξ ( ∞ ) = l ∑ i = λ ni a ( ) i u i (39)remembering Equation 32, left hand side of inequation 36 canbe written as (cid:107) S ξ ( n ) − S ξ ( ∞ ) (cid:107) S = (cid:118)(cid:117)(cid:117)(cid:116) l ∑ i = λ ni ( a ( ) i ) (cid:107) u i (cid:107) S ≤ λ n (cid:107) S ξ ( ) − S ξ ( ∞ ) (cid:107) S (40)Combining Equation 36 and 40 and noticing that λ is thesecond largest eigenvalue of T , the upper limit of iterationrequired can be given as − ln γ l (cid:107) S ξ ( ) − S ξ ( ∞ ) (cid:107) S ψ ( − γ − δ ) (cid:44) ln λ (41)By evaluating the upper bound of numerator and substituting λ by its upper bound of 1 − ε − ε + √ ε ε , a simpler formof upper limit n max could be obtained n max = − l ln γ − ln ( γ − ) − ( − γ − δ ) ( − ε − ε + √ ε ε ) (42)The denominator is a constant independent of l , while thenumerator is dominated by l ln γ when l is large, thus theasymptotic time complexity for achieving an accuracy of δ ( n ) ≤ δ is at most O ( l ) .Furthermore, in this system, ξ ( n ) i ( n < i , n ≤ l − i ) takes theform of f ( n ) ( ξ ( ) i − n , · · · , ξ ( ) i + n ) and f ( n ) is independent of i . Thus,when n ≤ l − ξ ( n ) (cid:98) l / (cid:99) and ξ ( n ) (cid:98) l / (cid:99) + will be identical because ξ ( ) i =
1. This means that these two robots, though 1 unit apart,share the same localization result when n ≤ l −
1, thus themaximum localization error must be larger than 1 /
2, whichindicates that the asymptotic time complexity to achieve anaccuracy higher than is at least Ω ( l ) .As the asymptotic time complexity for achieving an accu-racy of δ ( n ) ≤ δ is at most O ( l ) and at least Ω ( l ) , it is Θ ( l ) . Remark . In fact, regardless of the method used, the asymp-totic time complexity of localization in a swarm is physicallylimited by the transmission speed of information which is pro-portional to the length of the swarm, that means no algorithmwith asymptotic complexity lower than Θ ( l ) is possible. Remark . In higher dimensional systems, VPE localizationalgorithm offers stunning theoretical performance. For exam-ple, consider a localization task in 2D and 3D robot swarmsas illustrated in Figure 4, in a rectangular 2D robot swarmwith l × l robots or a 3D swarm with l × l × l robots, theasymptotic time complexity of localization will still be Θ ( l ) (due to translational symmetry, asymptotic time complexityof localization in such a swarm is identical to that of 1Dscenario) instead of Θ ( l ) or Θ ( l ) which is the lower limit ofall centralized algorithm (time required for storing informationtransmitted from all robots in memory). YX (a) 2D YXZ (b) 3DFig. 4. Robot swarm in higher dimension. Black dots represent robots andlines represent connections between robots.
Remark . Iterations required to achieve certain accuracyacross the swarm will vary when the distribution of robotsor the connectivity between robots changes, however somequalitative trends regarding these factors can be found: • Iterations required decreases when there are strongerconnections and more long-range connections betweenrobots. • Iterations required increases when the swarm is larger ormore sparsely distributed.
Remark . Often we need to perform localization on movingrobots, e.g. in shape formation tasks. In such cases, robots’position will not vary much between two consecutive local-ization tasks. This means that by setting the initial VP amountto the final VP amount in previous localization tasks, initialerror ξ ( ) − ξ ( ∞ ) could be greatly reduced, which can greatlyaccelerate the localization process.This method is used in simulations conducted in SectionV, the result of which shows up to 90% time could be savedcompared with a localization procedure starting from scratch.IV. L OCALIZATION V ERIFICATION
In this section, localization results in simulations and ex-periments using VPE localization algorithm are presented andanalyzed.
A. Results in simulations
Simulations are first carried out to provide localizationresults in x axis only on 1D and 2D robot swarms in orderto investigate the asymptotic time complexity of localizationtasks executed with different robot distribution patterns.Four robot distribution patterns are used in simulations:(1) 1D distribution: robots evenly distributed on a line withspacing of 1.(2) 2D distribution: robots are located in a square whoseedge is parallel to x or y axis.(3) 2D distribution: robots are located in a square whosediagonal is parallel to x or y axis.(4) 2D distribution: robots are located in a annulus whoseouter radius is twice the inner radius.If robots are distributed in 2D, their position will be selectedrandomly while keeping the distance between adjacent robotsat approximately 1. The size of the robot swarm is controlledby a dimensionless variable named as ‘size factor’ whichreflects the span of the swarm on x axis. In 1D scenariossize factor is defined as the number of robots, and in 2Dscenarios size factor is defined as the square root of numberof robots. Robot swarms with size factor between 2 and 100are considered in the simulation. In simulations with 1D dis-tribution of robots, conditions where maximum transmissiondistance of light (light will be too dim to be detected overthis distance) is 1.5, 2.5 or 3.5 are evaluated respectively.Parameters used in simulations with 1D distribution of robotsare k = = r = ( (cid:98) d (cid:99) + ) / d denotethe transmission distance of light. In simulations with 2Ddistribution of robots, maximum transmission distance of lightis set to 2.5 and k = = = Line _ _ _ ( a ) A vg . E rr . Line _ _ _ ( b ) A vg . E rr . ( r O p ti m i ze d ) Size Factor
Fig. 5. Average localization error in the equilibrium state. Subfigure(a) displays the localization error with previously described settings whilesubfigure (b) displays the localization error when r is a variable and isoptimized such that localization error is minimized. Curve Line 1 to Line 3correspond to distribution (1) where maximum transmission distance of lightis 1.5, 2.5 and 3.5. Curve Square, Rotated square, and Annulus correspond toconfigurations (2), (3), (4) respectively and is the average of 10 runs. Shadesbehind these three curves indicate the standard deviation of the data. Notethat the increase in error in configuration Line 1 at large size factor is due tonumerical error. less than 0.15. The reason why localization has greater errorwith smaller swarm is because r chosen before is optimizedfor large swarms. If r is a variable and is optimized suchthat localization error is minimized, then in all scenarioslocalization error will be less than 0.12 unit (see subfigure(b)).Iterations required for VPE localization algorithm to con-verge in swarm with different size and distribution are shownin Figure 6. It could be observed that the iterations requiredto reach a certain accuracy are linearly correlated to the sizefactor of the shape instead of number of robots. Furthermore,By comparing group Line 1 to Line 3, one can observe thatless iterations are required to reach a certain accuracy whenrobots can sense light emitted by further robots. It is alsoworth mentioning that in the case where 10000 robots arelocated in a square (size factor = 100), merely 6000 iterationsare required for the algorithm to converge, the number can beeven more staggering with larger swarm or swarm in 3D. Thisphenomenon indicates that this algorithm is especially suitablefor large swarm.In previous discussion, we focused on obtaining x coordi-nates of robots only. By executing VPE localization algorithmtwice in x and y axis respectively, each robot can obtain a2D localization result. To provide better comprehension of theprocedure of VPE localization algorithm and its capabilities,2D localization is achieved in three scenarios:(1) Robots are located in a square whose edge is parallel to x or y axis.(2) Robots are located in a annulus whose outer radius istwice the inner radius. Line _ _ _ I t e r a ti on s R e qu i r e d Size Factor
Fig. 6. Iterations required to converge. The definition of curves are the sameas in Figure 5. (3) Same as (2) except 10% measurement noise is added tothe sensor of robots.The simulation results are shown in Figure 7. All parametersare the same as those used in previous simulations with 2Ddistribution of robots.One can see that in Figure 7, localization results graduallyconverge in less than 200 iterations in all three scenarios andthe average error of localization is only approximately 0.1unit, which is sufficiently accurate for most tasks. Also, in thelast case where 10% of noise is added to all sensors readings,our algorithm still managed to achieve an average localiza-tion error of 0.5 units, which verified that VPE localizationalgorithm is resistive to noise. It is also worth noting thatthe localization results’ centroid is within 1 unit of the actualcentroid of robots in all three scenarios, which is ideal fortasks like shape formation.
B. Results in experiments
To further verify that the VPE localization algorithm issuitable for real applications with strong environmental noiseand interference, experiments with 52 low-cost (approximately$35 each), self-designed robots were conducted.Figure 8 shows the test environment and all robots involvedin the experiment, and Figure 9 shows the detailed view of arobot. Robots move on the ground and a camera records themovements of robots and the light signal feedback sent bythem.The size of each robot is 10 × × Robots = - - - Y Connectivity
Avg. Err. = Iteration 10
Avg. Err. = Iteration 50
Avg. Err. = Iteration 200 A vg . E rr . Error Plot
Robots = - - - Y Avg. Err. = = = A vg . E rr . Robots = - - - Y - - - X Avg. Err. = - - - X Avg. Err. = - - - X Avg. Err. = - - - X A vg . E rr . Iteration
Fig. 7. Localization procedure with different robot distribution. The first column shows the connectivity of the whole swarm, where each green trianglemarks the actual position of a robot and each line represents that light emitted by one robot can be sensed by another, the darker the line is, the stronger thelight sensed. Columns 2,3,4 display the localization results in different iterations of the localization process, where green triangles still represent the actualposition of robots, yellow circles represent localization results of the robot, and blue arrows represent position error of the robot. The last column shows thetrend of localization error versus iteration. In all figures, both the robots’ centroid and the localization result’s centroid are set to { } through translation.Fig. 8. All 52 robots and the test environment. In the first experiment, localization is performed when N robots (N ranging from 2 to 7 are tested in experiment)are distributed evenly on a line with gap of 17.5 cm withk = = is optimized afterwards to minimizelocalization error in the equilibrium state. In order to minimizeinterference, calibration process as mentioned in Remark 3 isnot involved, instead the drift in origin of localization resultis eliminated in data processing afterwards by subtracting Emitter ringReceiver ringIR receiver ( remote control ) MCUMotorBatteryBull wheelExtentionportWheel
Top PCBMain PCBMechanicallayer
Fig. 9. An individual robot. Emitters and receivers are mounted on the topPCB and all other electrical devices are directly mounted on main PCB orconnected to main PCB through wires. the average of localization result (for simplicity, in furtherdiscussion we name this as ‘translated localization result’).We consider the VP distribution has reached equilibrium whenthe variation of translated localization result is less than 0.1r in 200 iterations. In this experiment, each iteration takesapproximately 200 ms, and most of the time are consumed insetting up DACs. We estimates that with better implementationeach iteration could be reduced to less than 1 ms. Localizationerror in the equilibrium state and iterations required to reachequilibrium are investigated, results are shown in Figure 10and 11. A vg . E rr . / c m % % % % % % % % A vg . E rr . / d i s t . b e t w ee n r obo t s Number of Robots
Fig. 10. Localization error in experiments with 1D robot distribution.
ExperimentTheory Best - fit I t e r a ti on s R e qu i r e d Number of Robots
Fig. 11. Iterations required to converge in experiments with 1D robotdistribution. The green line is the iteration required to reach a averageaccuracy of 0.1 with maximum light transmission distance of 20 cm andk = = = As shown in Figure 10, in all experiments where equilibriumstate is reached, error in translated localization result canbe controlled to less than 2.5 cm, which is 15% of thedistance between adjacent robots, and in majority of them,localization error is less than 1.5 cm. Furthermore, as shownin Figure 11, localization is completed in less than 6 minutesin all experiments (could be less than 1.5 seconds with betterimplementation), and experimental points fit well with thetheory best-fit.As mentioned before, the origin of localization result willdrift due to the influence of environment and imprecision ofsensors. Therefore, we implement the calibration algorithmmentioned in Remark 3 and execute it every 20 iterations. Ex-perimental results with the same robot configuration with andwithout calibration algorithm are given in Figure 12. Whilethe localization result without calibration keeps drifting in x + direction and reaches a maximum of 35 cm at iteration 2000,with the calibration algorithm implemented, the localizationresult becomes stable in the end with maximum drift of 1.4cm throughout the whole localization procedure.Then we carried out experiments with 2D robot distributionusing 52 robots with calibration algorithm implemented. Pa- - L o ca li za ti on R e s u lt / c m Iteration Count (a) Without Calibration - L o ca li za ti on R e s u lt / c m Iteration Count (b) With CalibrationFig. 12. Comparison between localization process with and without calibra-tion. Gray horizontal lines represent actual position of robots. rameters used in localization are k = = isadjusted to minimize the error. Robot distribution, the processof localization, and the trend of localization error with iterationcount are provided in Figure 13.The average error is approximately half the average distancebetween adjacent robots. Though not as good as what sim-ulations suggest due to strong environmental influence, itis already sufficient for a variety of tasks including shapeformation.V. A PPLICATIONS TO S HAPE FORMATION
Based on VPE localization algorithm and combined witha deformation algorithm, autonomous and distributed shape-formation can be achieved.The general approach used in deformation is similar toVirtual Force Field Method proposed by [31], in which virtualforces control the movement of robots. Modification has beenmade to the collision avoidance algorithm and movement algo-rithm to better fit our robot system. In our modified algorithm,robots’ movement at each step is the summation of two factors:an attractive factor to pull robots inside the target shape anda repulsive factor to keep robots approximately evenly spacedwhile preventing them from separating from the swarm. Thefirst factor is determined by the position of the robot as wellas the targeted shape, and the second factor is determinedby the relative position of robots in the neighborhood. Themathematical expression of the displacement of robots in eachstep is given by (cid:126) d i = (cid:126) d i , att ( Ω , χ i ) + (cid:126) d i , rep ( (cid:126) r i , j n ) (43)where (cid:126) d i is the movement of robot i in this step. (cid:126) d i , att and (cid:126) d i , rep are the contribution of attractive and repulsive factor. Ω is the target shape, χ i is the current localization result of robot i and ∆ (cid:126) r i , j n represents the relative displacement of all robotsin the neighborhood of robot i .Detailed pseudo-code of the shape formation algorithm usedin our simulations and experiments is described in AppendixB and C. A. Results in simulations
In simulations, up to 52 robots are used to form triangleshape and ‘K’ shape. For better comparison with experimentalresult, average distance between adjacent robots is set toapproximately 0.2 and maximum transmission distance of light is set to 0.5. Parameters used in localization process are:k = = = S = − min σ (cid:82) Σ (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) in ( (cid:126) r , Ω ) − A πσ l l ∑ i = e − | (cid:126) r − (cid:126) r i | σ (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) d s A (44)where A is the area of the target shape Ω , Σ is the entire plane, (cid:126) r i is the position of robot i and in ( (cid:126) r , Ω ) is a function definedas in ( (cid:126) r , Ω ) = (cid:40) ( (cid:126) r (cid:54)∈ Ω ) ( (cid:126) r ∈ Ω ) (45)It is evident that when robots are distributed approximatelyevenly inside the shape, similarity will be close to 1, and ifall robots are far away from target shape then similarity willbe close to 0.The evolution of similarity in a shape formation processis provided in Figure 14. As expected, similarity rapidly increases with time and eventually reaches a relatively largevalue, which indicates that the shape formation results resem-ble the target shapes well in both cases. B. Results in experiments
In experiments, triangle shape and ‘K’ shape are chosen astargets to test shape formation. In all experiments, parametersof localization are: k = = = m . Initiallocalization takes 1000 iterations and preceding re-localizationtakes 100 iterations each. The results are displayed in Figure15.The robot swarm generates the pre-defined shape in bothsituations with maximum similarity value of approximately0.8, which is close to the similarity of approximately evenlyspaced points inside the region. The overall trend of robots’paths is consistent with what simulation suggests. The reasonsfor the decreased similarity value after certain steps are mainlydue to the characteristics of similarity evaluation algorithmwhich prefers points located inside the shape instead of pointson the edge of the shape. From the video one can see thatsubjectively robots are perfecting the shape generated in eachstep.Compared to the method proposed by [1] where robots lineup and move on the boundary of the shape, our approach todeformation is more fluid like, which requires a magnitude lessiterations in deformation and resembles the behavior of naturalswarm systems better. Rapid and accurate shape formationachieved in both simulations and experiments shows thatVPE localization algorithm is suitable for providing relativelocalization results when executing more complex tasks.VI. D ISCUSSION
Though with multiple merits, VPE localization algorithmshas its own limitations which requires further optimization.
Robots = - - Y / m Ground Truth
Avg. Err. = Iteration 10
Avg. Err. = Iteration 100
Avg. Err. = Iteration 300 A vg . E rr . / m Error Plot
Robots = - - Y / m - - X / mGround Truth Avg. Err. = - - X / mIteration 50 Avg. Err. = - - X / mIteration 250 Avg. Err. = - - X / mIteration 650 A vg . E rr . / m IterationError Plot
Fig. 13. Localization results in experiment with 2D robot distribution. In all figures, both the robots’ centroid and the localization result’s centroid are set to { } through translation, however, in reality the origin of localization result is only 4 cm apart from the actual centroid of the swarm. The first experimentis terminated early because equilibrium is reached in 300 iterations. In the second experiment, we cannot obtain a specific robot’s localization result due tohardware issues, thus we neglect this robot in the error analysis. Fig. 14. Shape formation results in simulations.
Similarity = - - Y / m Step 0
Similarity = Step 10
Similarity = Step 26 Robots' Path
Random points inside regionApproximately evenly spaced points S i m il a r it y Similarity Plot
Similarity = - - Y / m - X / mStep 0 Similarity = - X / mStep 10 Similarity = - X / mStep 29 - X / mRobots' Path Random points inside regionApproximately evenly spaced points S i m il a r it y StepSimilarity Plot
Fig. 15. Shape formation results in experiments. The target shape has been scaled to fit the produced shape.
As proved in Section III, VPE localization algorithm has O ( l ) asymptotic time complexity, i.e. it can achieve a certainaccuracy δ in at most α l iterations where α is a constant.However, coefficient α is at the magnitude of several hundredsin simulations and experiments, which is far from theoreticallimit of 0.5. This phenomenon can be observed in Figure 6and 11 where iterations required to converge do not increaselinearly with the size factor when size factor is smallerthan 10. Thus when operating on swarms with less thanseveral hundreds of robots, the algorithm could even be slowercompared with algorithms which have higher asymptotic time complexity. This problem can be partially addressed by im-plementing acceleration algorithms to speed up convergingprocess. A simple example for such acceleration algorithmis setting larger k and k when the localization result isalready near equilibrium. In authors’ crude simulations, suchmethod can provides up to 90% acceleration at a slight risk offailing to converge. Furthermore, in tasks like shape formation,after initial localization, subsequent localization will be muchfaster as well. If VPE localization algorithm is used in systemswithout direct communication ability using Algorithm 2, therequirement for time synchronization between all robots in the swarm can be tricky as well. Currently, authors implement asimple algorithm to achieve time synchronization, in which arobot would start emitting light whenever its timer is up orit sensed light emitted by other robots. Such method mightbe prone to failure with larger swarms, but fortunately, VPElocalization algorithm is resistant to addition and removalof robots, a robot can just skip an iteration if it fails tosynchronize with other robots without influencing the overalllocalization process. Another property of VPE localizationalgorithm is that it relies more on the interaction betweenrobots than internal calculation of each robot, so while thecost for internal computation and memory decreased, the costfor interaction increased. Because emitting signals are usuallymore energy consuming than internal computation, hardwareand software designed for VPE localization algorithm needsto be as energy-efficient as possible.We designed the robot just as a proof of concept of VPElocalization algorithm, so the hardware and software are alldesigned to be as simple as possible, and performance andstability are not our major concern. For example, light sensorand emitters are chosen by convenience of assembly insteadof response speed or accuracy, and codes are not optimized forerror cancelling or energy saving. The crude design partiallyaccounts for the slow speed and undesirable error of localiza-tion, which can possibly be fixed by following measures: • Use frequency modulated signal instead of DC signal toreduce the influence of environment and extend the rangeof signal. For example, we can change line 2 and 12 inAlgorithm 2 to the following:Emit signal with frequency f and strength I ( ˆ r ) .Emit signal with frequency f + f (cid:98) log ( ξ + ) (cid:99) andstrength I ( ˆ r ) / (cid:98) log ( ξ + ) (cid:99) where f is another frequencyconstant.In this way, most environmental noise can be filtered outby a band-pass filter. Furthermore, currently the size ofswarm our hardware can support is restricted because themaximum of I ( ˆ r ) increases with the size of the swarmand emitters will be saturated if the swarm is too largein size. But by converting strength to frequency, we canavoid saturation of emitters thus enabling implementationin large scale swarms. • Use high frequency LED to increase the response ofemitter and use PIN photodiode or negatively biased PNphotodiode to increase the response of receiver.VII. C
ONCLUSION
This paper presents VPE localization algorithm for localiz-ing inside homogeneous robot swarms. In the algorithm, robotsrepetitively exchange VPs with neighboring robots and obtaintheir location results based on the amount of VPs they own inthe final state.The convergence of the algorithm is verified by first re-ducing the problem to a convergence problem of lim n → ∞ T n ξ and then applying PerronFrobenius theorem. Furthermore, aspecific scenario where robots are evenly distributed on a lineis investigated to evaluate the asymptotic time complexity ofthe algorithm, which shows that VPE localization algorithm has asymptotic time complexity of Θ ( l ) where l is span of theswarm on x direction.VPE localization algorithm is then evaluated in simulationsand robot swarm experiments to investigate whether VPElocalization algorithm is suitable for real applications withnoise and interference. Results confirm that our algorithmcan be applied in real world robot swarms by achievinglocalization result with error at approximately half of theaverage distance between robots, and forming accurate triangleshape and ’K’ shape in shape formation tasks.A CKNOWLEDGMENT
Special Thanks to Yi Zhao for discussing with us whenthe project just started and providing assistance with findingproper localization algorithm.R
EFERENCES[1] M. Rubenstein, A. Cornejo, and R. Nagpal, “Programmable self-assembly in a thousand-robot swarm,”
Science , vol. 345, no. 6198, pp.795–799, 2014.[2] V. Zykov, E. Mytilinaios, B. Adams, and H. Lipson, “Robotics: Self-reproducing machines,”
Nature , vol. 435, no. 7039, p. 163, 2005.[3] C. H. Belke and J. Paik, “Mori: a modular origami robot,”
IEEE/ASMETransactions on Mechatronics , vol. 22, no. 5, pp. 2153–2164, 2017.[4] H. Kurokawa, K. Tomita, A. Kamimura, S. Kokaji, T. Hasuo, andS. Murata, “Distributed self-reconfiguration of m-tran iii modular roboticsystem,”
The International Journal of Robotics Research , vol. 27, no.3-4, pp. 373–386, 2008.[5] J. W. Romanishin, K. Gilpin, S. Claici, and D. Rus, “3d m-blocks:Self-reconfiguring robots capable of locomotion via pivoting in threedimensions,” in . IEEE, 2015, pp. 1925–1932.[6] K. Gilpin, K. Kotay, D. Rus, and I. Vasilescu, “Miche: Modular shapeformation by self-disassembly,”
The International Journal of RoboticsResearch , vol. 27, no. 3-4, pp. 345–372, 2008.[7] X. Dong, B. Yu, Z. Shi, and Y. Zhong, “Time-varying formationcontrol for unmanned aerial vehicles: Theories and applications,”
IEEETransactions on Control Systems Technology , vol. 23, no. 1, pp. 340–348, 2015.[8] X. Dong, Y. Li, C. Lu, G. Hu, Q. Li, and Z. Ren, “Time-varying forma-tion tracking for uav swarm systems with switching directed topologies,”
IEEE Transactions on Neural Networks and Learning Systems , vol. 30,no. 12, pp. 3674–3685, 2019;2018;.[9] A. Kushleyev, D. Mellinger, C. Powers, and V. Kumar, “Towards aswarm of agile micro quadrotors,”
Autonomous Robots , vol. 35, no. 4,pp. 287–300, Nov 2013.[10] J. A. Preiss, W. Honig, G. S. Sukhatme, and N. Ayanian, “Crazyswarm:A large nano-quadcopter swarm,” in , May 2017, pp. 3299–3304.[11] G. Vsrhelyi, C. Virgh, G. Somorjai, N. Tarcai, T. Szrenyi, T. Nepusz,and T. Vicsek, “Outdoor flocking and formation flight with autonomousaerial robots,” in , Sep. 2014, pp. 3866–3873.[12] S. Hauert, S. Leven, M. Varga, F. Ruini, A. Cangelosi, J. Zufferey,and D. Floreano, “Reynolds flocking in reality with fixed-wing robots:Communication range vs. maximum turning rate,” in , Sep. 2011,pp. 5015–5020.[13] G. Reshko, “Localization techniques for synthetic reality,” Master’sthesis, Carnegie Mellon University, 2004.[14] P. Pillai, J. Campbell, G. Kedia, S. Moudgal, and K. Sheth, “A 3dfax machine based on claytronics,” in . IEEE, 2006, pp. 4728–4735.[15] A. Savvides, H. Park, and M. B. Srivastava, “The bits and flops ofthe n-hop multilateration primitive for node localization problems,” in
Proceedings of the 1st ACM international workshop on Wireless sensornetworks and applications . ACM, 2002, pp. 112–121. [16] L. Luft, T. Schubert, S. I. Roumeliotis, and W. Burgard, “Recursivedecentralized localization for multi-robot systems with asynchronouspairwise communication,” The International Journal of Robotics Re-search , vol. 37, no. 10, pp. 1152–1167, 2018.[17] C. S. J. Rabaey, K. Langendoen et al. , “Robust positioning algorithmsfor distributed ad-hoc wireless sensor networks,” in
USENIX technicalannual conference , 2002, pp. 317–327.[18] Y. Kim, B. Lee, H. So, D.-H. Hwang, and S.-C. Kim, “Cooperativelocalization considering estimated location uncertainty in distributed adhoc networks,”
International Journal of Distributed Sensor Networks ,vol. 14, no. 2, p. 1550147718759634, 2018.[19] D. Moore, J. Leonard, D. Rus, and S. Teller, “Robust distributed networklocalization with noisy range measurements,” in
Proceedings of the2Nd International Conference on Embedded Networked Sensor Systems .ACM, 2004, pp. 50–61.[20] A. Cornejo, A. J. Lynch, E. Fudge, S. Bilstein, M. Khabbazian, andJ. McLurkin, “Scale-free coordinates for multi-robot systems withbearing-only sensors,”
The International Journal of Robotics Research ,vol. 32, no. 12, pp. 1459–1474, 2013.[21] K. Langendoen and N. Reijers, “Distributed localization in wireless sen-sor networks: a quantitative comparison,”
Computer networks , vol. 43,no. 4, pp. 499–518, 2003.[22] J. W. Park, D. H. Park, and C. Lee, “Angle and ranging based localizationmethod for ad hoc network,”
The Journal of Supercomputing , vol. 64,no. 2, pp. 507–521, 2013.[23] Y. Shang, W. Ruml, Y. Zhang, and M. P. Fromherz, “Localizationfrom mere connectivity,” in
Proceedings of the 4th ACM internationalsymposium on Mobile ad hoc networking & computing . ACM, 2003,pp. 201–212.[24] P. Biswas, T.-C. Lian, T.-C. Wang, and Y. Ye, “Semidefinite pro-gramming based algorithms for sensor network localization,”
ACMTransactions on Sensor Networks (TOSN) , vol. 2, no. 2, pp. 188–220,2006.[25] J. Fan, B. Zhang, and G. Dai, “D3d-mds: a distributed 3d localizationscheme for an irregular wireless sensor network using multidimensionalscaling,”
International Journal of Distributed Sensor Networks , vol. 11,no. 2, p. 103564, 2015.[26] S. Funiak, P. Pillai, M. P. Ashley-Rollman, J. D. Campbell, and S. C.Goldstein, “Distributed localization of modular robot ensembles,”
TheInternational Journal of Robotics Research , vol. 28, no. 8, pp. 946–961,2009.[27] K. H. Petersen, N. Napp, R. Stuart-Smith, D. Rus, and M. Kovac,“A review of collective robotic construction,”
Science Robotics ,vol. 4, no. 28, 2019. [Online]. Available: https://robotics.sciencemag.org/content/4/28/eaau8479[28] Z. Wang and M. Schwager, “Force-amplifying N-robot transport system(Force-ANTS) for cooperative planar manipulation without communica-tion,”
The International Journal of Robotics Research , vol. 35, no. 13,pp. 1564–1586, 2016.[29] Z. Wang and M. Schwager, “Kinematic multi-robot manipulation withno communication using force feedback,” in , May 2016, pp. 427–432.[30] B. A. Berg,
Markov Chain Monte Carlo Simulations and Their StatisticalAnalysis . World Scientific Publishing, 2004.[31] S. Hou and C. C. Cheah, “Dynamic compound shape control of robotswarm,”
IET control theory & applications , vol. 6, no. 3, pp. 454–460,2012. A PPENDIX
A. Calibration algorithm for total VP amount
Algorithm 3
Pseudo-code for calibration of total VP amount
Input:
All robots:a. Can emit light with isotropic angular distribution andsense ambient light intensity.b. Knows the VP amount it owns (named as ξ ). Output:
Normalized VP amount ξ (cid:48) for all robots whichsatisfies ξ i / ξ j = ξ (cid:48) i / ξ (cid:48) j and ∑ i ξ (cid:48) i = l . Notation Remarks: ξ A - floating point variable used in the calibration process. n m - iterations to calculate (predefined).k , k - constants controlling the intensity of light emitted. for each: robot i ∈ V . ξ A ← ξ Begin emitting isotropic light signal with intensity of k unit. c ← sensed ambient light intensity. Stop emission. for n = → n m − do Time synchronization. Possible addition: repeat line 2-4. Begin emitting isotropic light signal with intensity ofk ξ A unit. s ← sensed ambient light intensity. Stop emission. ξ A ← (cid:16) − ck k (cid:17) ξ A + s end for ξ (cid:48) ← ξξ A One might have noticed that this is just Algorithm 2 with k =
0, thus it is not hard to understand why this algorithm canserve its purpose.
B. Modified collision avoidance algorithm
By exploiting the fact that a robot would sense higher inten-sity of light when placed closer to other robots, an algorithm tokeep robots approximately evenly spaced is created in orderto avoid collision between robots. Detailed pseudo-code forcollision avoidance algorithm is shown in Algorithm 4.
Algorithm 4
Pseudo-code for collision avoidance
Input:
All robots:a. Share a common x + direction.b. Can emit light with anisotropic angular distributionand sense ambient light intensity. Output: repulsive factor (cid:126) d i , rep in (43) for all robots. Notation Remarks: ˆ r - light emitting direction.k (cid:48) - constant controlling the anisotropic distribution oflight emitted.C ,C - constants controlling the strength of repulsivefactor. I - constant controlling the desired distance betweenrobots. d , d - constants controlling the strength of repulsivefactor. for each: robot i ∈ V . Begin emitting light with angular distribution I ( ˆ r ) = e k (cid:48) ˆ r · ˆ x ( k > ) (46) I x , + ← sensed ambient light intensity. Begin emitting light with angular distribution I ( − ˆ r ) . I x , − ← sensed ambient light intensity. d rep , x ← C tanh ( C ( max ( I x , + , I x , − ) − I )) I x , + − I x , − I x , + − I x , − where d rep , x represents the x component of (cid:126) d rep repeat line 1-5 for y direction and obtain y component ofrepulsive factor d rep , y . (cid:126) d rep ← { d rep , x , d rep , y } When a robot is far away from the main swarm, the intensityof light it sensed would become weak, such that the repulsivefactor of displacement will point to the direction where higherintensity is received, which is the direction towards the mainswarm. On the other hand, if a robot is too close to anotherrobot, a large repulsive factor with direction opposite to theother robot will be generated. This method can yield faircollision avoidance and aggregation result, yet robots do notneed to have the ability to detect neighbors or know the relativedistance and angle of neighboring robots.
C. Overall shape formation algorithm
The overall shape formation algorithm is presented inAlgorithm 5.
Algorithm 5
Modified Virtual Force Field Algorithm
Input:
All robots:a. Know the target shape Ω .b. Can calculate its position relative to the swarm χ .c. Can calculate the repulsive factor (cid:126) d rep given byAlgorithm 4. Output:
Achieve shape formation.
Notation Remarks: C ,C - constants controlling the strength of attractivefactor. for each: robot i ∈ V . while true do Calculate position relative to the swarm χ . (cid:126) p near ← argmin (cid:126) p ∈ ∂ Ω | χ − (cid:126) p | where (cid:126) p near represents theclosest point to (cid:126) p on the boundary of region Ω . (cid:126) f ← (cid:126) p near − χ (cid:126) d att ← C ( + tanh ( C ( in ( χ , Ω ) − ) | (cid:126) f | ) ( in ( χ , Ω ) − ) ˆ f Calculate (cid:126) d rep . Move the robot by (cid:126) d = (cid:126) d att + (cid:126) d rep .8: