0% found this document useful (0 votes)
8 views26 pages

Mean Shift

Uploaded by

shuzhengrui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views26 pages

Mean Shift

Uploaded by

shuzhengrui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Supplementary Information for

Mean-shift exploration in shape assembly of robot swarms


Guibin Sun et al.

This PDF file includes:

Supplementary Methods
Supplementary Figures 1 to 12
Supplementary Tables 1 to 3
Supplementary References

Other supplementary material for this manuscript includes the following:

Supplementary Movies 1 to 6

Supplementary Movie 1: Complex shape assembly - Snowflake shape assembly


Supplementary Movie 2: Complex shape assembly - Letters “ROBOT” assembly
Supplementary Movie 3: Adaptability to swarm scale changes
Supplementary Movie 4: Cooperative cargo transportation
Supplementary Movie 5: Environment exploration - Entering a passenger elevator
Supplementary Movie 6: Environment exploration - Exploring a complex maze

1
Supplementary Methods

1 Additional Information of Human-Swarm Interface


This section provides more information about the human-swarm interface. The interface is shown in
Supplementary Figure 1. It is coded by Matlab (R2020a). The code is available at https://github.com/
WestlakeAerialRobotics/Human-swarm-interface.

a b Loading a binary graphical image


Shape-design workspace
2
1

c Manually drawing using a mouse

Operation area

Supplementary Figure 1: The human-swarm interface. a A snapshot of the interface. There are six
functional components: shape-design workspace, grid size setting of the workspace, grayscale setting
for gray conversion, brush size selection, brush color selection, and operation area. b An example of
specifying the desired shape by loading a predesigned binary image. The original image is shown in
the bottom left. c An example of drawing a shape in the workspace using the brush tool.

After the human operator has designed a black-white grid, the next step is to convert the black-
white grid to a grayscale one. Here, we present two examples to illustrate the iterative process
described by the algorithm in (1) in the main text. First, consider the left grid in Supplementary
Figure 2a. In this binary grid, there is only a single black cell. We set h = 3. After applying the
iterative algorithm (1) in the main text to each cell of the left grid, we obtain the grayscale grid in
the middle. After applying the algorithm to each cell in the middle grid, the right grayscale grid is
generated. Second, Supplementary Figure 2b shows a grayscale grid generated from a rectangular
shape given in Supplementary Figure 2c. The value of h is set to be 5 in this example. As we can see,
when h increases, the gray area surrounding the black area enlarges.
How to select the value of h? If we select a greater value of h, the influence scope of the desired
shape becomes larger. In this case, the gray level varies smoothly across neighboring cells. As a

2
a b c Local target cell of robot i
Homogenous robot Original
y Desired shape Distances
Distance Transformation  y Center cell o
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
cell 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2/h 2/h 2/h 2/h 2/h
1  = 0 / 5 0.4 0.6 0.8
1 1 1 1 1 1 1 1 1 1/h 1/h 1/h 1 1 1 2/h 1/h 1/h 1/h 2/h
1  = 1 / 5 0.6 0.6 0.8
1/h 0 1/h 1 1 2/h 1/h 0 1/h 2/h
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1 1/h 1/h 1/h 1 1
1
1
1
2/h 1/h 1/h 1/h 2/h
1
 = 2 / 5
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2/h 2/h 2/h 2/h 2/h
1  = 3 / 5 0.8 0.8 0.8
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1  = 4 / 5
1st iteration 2nd iteration  = 5 / 5
o x Focus cell o x
Avoidance range ravoid Neighbor cells of robot i
Neighbor set of focus cell
Currently occupied cell of robot i

Supplementary Figure 2: Illustration of the gray conversion algorithm in (1) in the main text. a An
example to demonstrate the iterative algorithm in (1) in the main text. b Another example to illustrate
the grayscale grid obtained from a binary grid. c A rectangular desired shape and some notations.

result, the control command, which relies on the gray levels of the cells, changes smoothly. However,
a greater value of h is also more computationally expensive. One heuristic value of h suggested by
√ 
our extensive experiments is h = ncell /2 , where ncell is the number of black cells and d·e denotes
round up. In the simple case where the desired shape is a square, the heuristic value of h is half of
the side length of the square.
After the grayscale grid has been generated, it is then sent to all the robots and stored in each
robot’s memory. For all the shapes used in our work, the number of cells varies from 1,443 to 76,629.
The memory size of a grayscale grid stored as a mat file, Matlab’s standard data format, varies
from 0.72 KB to 94.4 KB, which are affordable for mainstream embedded computers nowadays. In
particular, there are 76,629 cells in Supplementary Figure 4a, and the corresponding size is 94.4 KB.
In Supplementary Figure 5b, there are 1,833 cells and the size is 0.81 KB.
In our method, all the cells in the desired shape are black and hence there is no gradient inside
the shape. In this case, the exploration control command plays an important role in successfully
assembling the shape. One may wonder if gradients can also be introduced inside the desired shape
to better guide the robots. The reason that we do not adopt this way is that it usually has a strict
requirement for the initial configuration and the robots may easily get trapped in local minima when
the shape is complex.

2 Additional Information of the Negotiation Algorithms


To introduce a user-specified trajectory for the entire desired formation, we introduce a small number
of informed robots, which know the trajectory reference. The basic idea is that the informed robots
would insist on their interpretations of the desired shape during the negotiation process. As a result,
the interpretations of the other uninformed ones would converge to those of the informed ones.
In particular, the uninformed robots still execute the algorithm in (3) in the main text. The in-

3
formed robots execute the following algorithm instead:

c1 X
vρo ,i = − sign(pρo ,i − pρo ,j )|pρo ,i − pρo ,j |α + c3 (pref − pρo ,i ) + vref (1)
|Ni | j∈N
i

where c3 is a positive constant. Here, pref , vref ∈ R2 are the position and velocity of a time-varying
reference for the shape center. It is notable that the information of the reference is merely known by
the informed robots.
Regarding the orientation negotiation, the uninformed robots still execute the algorithm in (4) in
the main text. The informed robots execute the following algorithm:

c2 X
φ̇i = − sign(φi − φj )|φi − φj |α + c4 (φref − φi ) + φ̇ref (2)
|Ni | j∈N
i

where c4 is a positive constant coefficient. Here, φref ∈ R is a time-varying orientation angle that the
desired shape should track. It is only known by the informed robots.
Using informed robots is a common method to introduce time-varying references to a multi-agent
system in the fields of multi-agent consensus [1, 2] and formation control [3, 4]. In these fields,
the informed/uninformed robots are often called leader/follower. When a swarm needs to follow a
desired trajectory, the information about the desired trajectory must be conveyed to the swarm. One
way to do so is to send the information directly to every robot. Another way that is more practical is
to send the information to a small number of informed robots so that the information can then spread
in the swarm via local interactions. In practice, an informed robot may have additional resources to
communicate with a supervisor such as a human operator to acquire the desired trajectory. Or, it can
behave autonomously based on advanced onboard sensing and decision-making systems to sense the
current situation and then decide where to move.

3 Additional Information of the Control Algorithms

3.1 Self-localization: How to calculate ρi

For the control command in (5) and (6) in the main text, we need to calculate the cell index ρi . We
next show how to do that. Since ρi is the index of the cell that is closest to robot i, calculating ρi is
to self-localize robot i in the grid. To obtain ρi , we first need to transform the spatial position pi into
a local frame attached to the desired shape. Recall that the translation and orientation of the desired
shape are described by pρo and φ, respectively. Define a local frame whose origin is located at pρo

4
and y-axis is aligned with φ. While pi is the position of robot i in the global frame, the corresponding
position in the local frame is

−1
p(o)
ρi = Rφi (pi − pρo ,i )

where Rφi is a rotation matrix defined as


 
cos φi − sin φi
Rφi =  .
sin φi cos φi

Then the cell that is closest to robot i can be calculated by


$ '
(o)
pρi
ρi = + ρo
`cell

where operator b·e means rounding to the nearest integer.

3.2 Local target position: How to calculate pT,i

For the control command in (5) in the main text, we need to calculate the cell index ρT,i . To do that,
we need to consider two cases. While ρi is the cell closest to robot i, if ρi is outside the grayscale
desired grid, then robot i can select the nearest gray cell as the target cell ρT,i . If ρi is inside the
grayscale desired grid, robot i can select a cell with the smallest gray level inside a 3 × 3 mask
centered at ρi as the target cell ρT,i . Once the index of the target cell is obtained, the position of that
cell can be calculated by

pT,i = Rφi (ρT,i − ρo )`cell + pρo ,i . (3)

See Supplementary Figure 2b for illustration.


Finally, an intuitive illustration of the proposed strategy is given in Supplementary Figure 3.

4 Additional Simulation Examples


In addition to the experimental and simulation results shown in the main text, we present other simu-
lation examples in this section to further verify the proposed method.

5
a Enter the desired shape b Explore neighboring black cells

Robot's interpretation of the desired shape

Shape center negotiated by the robot


Direction of shape-entering velocity Neighboring black cell
t1 t2 Desired velocity direction

Explore neighboring free black cells


c Avoid collisions with obstacles
Black cell occupied by neighbors

Circular obstacle

Collision point

Collision point

Rectangular obstacle

Desired velocity direction


Avoidance distance ravoid Black cell unoccupied by neighbors

Supplementary Figure 3: Illustration of the three velocity commands in the main text. a An example
to illustrate the principle of shape-entering velocity vient . b Two examples to illustrate the shape-
exploration velocity viexp . c wo examples to demonstrate obstacle avoidance by viint .

Supplementary Table 1: Simulation parameters.


Parameters
Simulation examples
κ1 σ1 σ2 κ3 α c1 c2
Example 1 Supplementary Figure 4 10.0 10.0 20.0 25.0 0.8 1.6 1.6
Supplementary Figure 5a 10.0 5.0 15.0 20.0 0.8 1.6 1.6
Example 2 Supplementary Figure 5b 10.0 5.0 15.0 25.0 0.8 1.6 1.6
Supplementary Figure 5c 10.0 5.0 15.0 25.0 0.8 1.6 1.6
Example 3 Supplementary Figure 6 10.0 5.0 15.0 30.0 0.8 1.6 1.6
Example 4 Supplementary Figure 7 10.0 10.0 17.0 25.0 0.8 1.6 1.6

4.1 Simulation setup

In the simulation, each robot is modeled as a circular omnidirectional robot with a body size of
rbody = 0.2 m. Each robot can sense or communicate with all the robots that lie within its sensing
range rsense = 2.5 m. Furthermore, collision avoidance is triggered if the inter-robot distance is
less than ravoid = 1.5 m. Other parameters for the following examples are listed in Supplementary
Table 1.

6
4.2 Simulation examples

4.2.1 Example 1: Complex shapes

This example aims to further verify the assembly ability of the proposed method for more complex
shapes. As shown in Supplementary Figure 4, the proposed method can successfully assemble planar
versions of double helix structures of DNA. These shapes are highly nonconvex and asymmetrical.
They are believed to be more challenging to assemble than the snowflake shape because they have
many holes and thin branches.

4.2.2 Example 2: Adaptability

While it is favorable when ncell matches nrobot so that each robot can occupy approximately one black
cell, we challenge the proposed method by considering scenarios where ncell and nrobot mismatch.
Supplementary Figure 5 shows 9 scenarios of assembling different desired shapes given different
values of ncell and nrobot . The value of ncell varies from 170 to 2778. The value of nrobot varies from

Supplementary Figure 4: Assembly of planar versions of double helix structures of DNA by the
proposed method. The shape images in (A) and (B) are inspired by [5] and [6], respectively. The
swarm has 300 robots.

7
16 to 256. Each column of the 9 subfigures has the same value of nrobot . Each row has the same ncell
and the same desired shape. The physical size of each cell is calculated adaptively by (2) in the main
text.
In these scenarios, the desired shapes can be well assembled even though ncell and nrobot mismatch

Supplementary Figure 5: Simulation results to demonstrate the adaptability of the proposed method
given different desired shapes, ncell , and nrobot . a Crescent shape assembly. b Infinity shape assembly.
c Snowflake shape assembly.

8
severely. For example, when ncell = 2778  nrobot = 64 (the second subfigure in Supplementary
Figure 5c), the desired shapes can still be well assembled.

4.2.3 Example 3: Maneuverability

This example demonstrates that the proposed method can track moving shapes. In this example, a
swarm of 128 robots sequentially assemble five letters, “R”, “O”, “B”, “O”, and “T”, from random
initialization. These five letter shapes are generated by loading predesigned images and sent to all the
robots one by one. Moreover, seven out of 128 (about 5%) robots in the swarm are selected informed
robots that know the desired sinusoid trajectory of the shape.
As shown in Supplementary Figure 6, the proposed method can assemble the desired shape while
steering the shape to move as expected. The distributed negotiation on the desired shape can converge
quickly as shown in Supplementary Figure 6a. Supplementary Figure 6c shows the performance
metrics in this example. It can be seen that the two metrics can converge to their ideal states promptly

Supplementary Figure 6: Simulation results for illustrating the maneuverability of the proposed
method. a Swarm trajectory. There are 128 robots. b Negotiation errors of the shape translation
and orientation with respect to the desired reference. c Performance metrics.

9
after the desired shape is switched.

Supplementary Figure 7: The influence of measurement errors. Constant biases and white noises
are added to the position and velocity measurements of each robot. The biases for each robot are
randomly generated in the beginning and remain the same during the entire process. The white noises
are generated at every time step. The impact of the constant biases is that the performance described
by the three metrics drops gradually as the magnitude of biases increases. The impact of the white
noises is that the robots would constantly adjust their positions slightly due to the time-varying noises.

10
4.2.4 Example 4: Influence of measurement errors

This example examines the influence of measurement errors on the control performance. In the
presence of different levels of measurement biases and white noises, the shape assembly results are
shown in Supplementary Figure 7. In general, as the level of measurement errors increases, the
performance of the proposed method would degenerate gradually in terms of the three performance
metrics. Intuitively, the finally assembled shape would be deformed in the presence of measurement
errors, which is in general a common phenomenon for cooperative estimation and control tasks [7,8].

Supplementary Figure 8: Comparison between the proposed method, the assignment-based one in [9]
and the assignment-free one in [10]. The desired shape is an arrow. a The case of 20 robots. b The
case of 100 robots. c The case of 300 robots.

11
4.2.5 Example 5: More comparison results

In this example, the proposed method is compared with two state-of-the-art ones in [9] and [10]. The
simulation result of assembling an “N” letter shape is shown in Figure 4 in the main text. Here, we
present another scenario where different numbers of robots assemble an arrow shape. The simulation
results are shown in Supplementary Figure 8. As can be seen, the proposed method leads to smoother
and shorter trajectories.
The parameters of the three algorithms are shown in Supplementary Table 2. It is noted that the
parameters of communication period for the three algorithms have different values. The explanation
is given below. The communication period is usually selected to be the same as the control period.
This is the case for our proposed control strategy where both the control and communication periods
equal 10 ms. However, the assignment-based method in [9] requires different values of the two
parameters. It also requires another parameter called plan period. The relationship between the three
parameters must satisfy certain conditions. In particular, denote the communication frequency as
fcomm . Then, the communication period is equal to 1/fcomm . Let ∆t denote the plan period. Then,
the three parameters must satisfy 2/fcomm = ∆t > l/vm [9], where l is the grid size and vm is the
speed of a robot. Finally, the value of the communication period of the assignment-free method [10]
is fine-tuned. The communication period can also be selected as 10 ms, but the performance can be
improved when it is selected as 100 ms. That is because too frequent updates of the neighbors’ states
may downgrade the edge detection performance.

Supplementary Table 2: Simulation parameters of the three methods.


Parameters Assignment-based Assignment-free The proposed
Body size (m) 0.15 0.15 0.15
Sensing range (m) 1.30 1.30 1.30
Avoidance distance (m) - 0.55 0.55
Grid size (m) 0.60 - -
Light-detection distance (m) - 0.70 -
Border size (m) - 0.00 -
Control period (ms) 10 10 10
Plan period (ms) 600 - -
Communication period (ms) 300 100 10

12
5 Experiments on 50 Robots

5.1 Robotic hardware platform

Every robot built for the experiments has a radius of 0.15 m and a height of 0.25 m. It consists of
four major modules: 1) a master controller for robot motion control; 2) a wireless transceiver for
information transmission; 3) four driving rotors with Mecanum wheels providing omnidirectional
maneuverability; and 4) an LED belt exhibiting the robot’s moving intention. More specifically, the
main controller carries an STM32F4 microprocessor with a 168 Mhz clock and 192 kB random-
access memory, and an ICM-20948 motion-tracking device for sensing acceleration and angular ve-
locity with accuracy up to 0.0006 m/s2 and 0.0153 ◦ /s. A real-time operating system FreeRTOS is
embedded in the microprocessor to handle the robot’s basic behaviors, LED belt display, and interact
with the workstation. The microprocessor controls the robot’s motion at a rate of 100 Hz. Each robot
is equipped with a 2.4 GHz Wi-Fi transceiver, which is mainly used to connect to the workstation’s
wireless router. The robot moves in a two-dimensional plane using four Mecanum wheels driven by
DC motors. A dual H-bridge driver controls the speed and direction of each motor independently,
allowing for omnidirectional motion. The maximum speed of each wheel is limited to 3.5 m/s.
Each robot can exhibit its motion intention by using the LED belt on the inner edge of the robot’s
dome. Each LED can show four types of colors: red, green, blue, and white. Red, green, and blue
correspond to the magnitudes of vient , viexp , and viint , respectively. White corresponds to the velocity
magnitude of the robot. When the number of LEDs exhibiting a certain color is large, the magnitude
of the corresponding quantity is large. In particular, denote nled as the total number of LEDs in the
belt, and vmax ∈ R as the maximum speed of the robot. The number of white LEDs is designed as

nwhite = bnled (vmax − kvk)/vmax c

where b·c means round down. The smaller the velocity command is, the more white LEDs there are.
If all LEDs are white, the robot intends to stop moving. Let nred , ngreen , and nblue refer to the number
of red, green, and blue LEDs, respectively. Then, nred + ngreen + nblue = nled − nwhite . We design

kvient k
 
nred = (nled − nwhite ) ent ,
kvi k + kviexp k + kviint k
kviexp k
 
ngreen = (nled − nwhite ) ent ,
kvi k + kviexp k + kviint k
kviint k
 
nblue = (nled − nwhite ) ent ,
kvi k + kviexp k + kviint k

13
where b·e is the operation to round to the nearest integer.

5.2 Experimental setup

All experiments are conducted in a rectangular arena with the dimension as 8 m×7 m×3 m. There are
five key components in the experiments: 1) 50 robot swarm, 2) a workstation, 3) wireless routers for
connecting the robot swarm and workstation, 4) a motion capture system for positioning robots, and
5) an ultra-wide angle camera used to film experiments. These components are detailed as follows.

Robot swarm: A swarming system of 50 ground robots was developed. All robots in the swarm
are homogeneous and have no unique identities among them. Although different robots may have
different IP addresses and position markers, these labels are not used in the algorithms.

Workstation: Limited by the computing power of the robot’s microprocessor, a workstation is


used to control the robot swarm in a multithreaded manner. The workstation carries a 3.6 GHz
and 64 bit six-core Xeon processor, and 32 GB random-access memory. In the experiments, each
robot corresponds to an independent control thread in the workstation and communicates with its
corresponding thread using wireless routers. In this way, each robot has two controllers. One runs
the proposed algorithm in the workstation, and the other is onboard and tracks the control commands
sent from the workstation.

Wireless router: To avoid channel congestion and reduce transmission latency, six wireless routers
are used to establish the connection between the robots and their thread in the workstation. In the
experiments, it is primary to ensure real-time and efficient transmission while a certain amount of
packet loss can be tolerated. Thus, the communication along this connection uses standard UDP
protocol to complete the information transmission at a rate of 40 Hz.

VICON system: A VICON motion capture system is used to track the robot’s motion. All motion
states, including position and heading, are acquired by the workstation at an update rate of 100 Hz
via the VICON-DataStream software development kit. Then, the robot’s motion velocity and heading
rate can be calculated by using the method of forward differencing. In the workstation, there is an
additional thread for receiving and calculating all motion states of the robots.

Camera: An ultra-wide angle camera is mounted above the experimental arena to record the ex-
periments at 4 K and 60 fps. The operation and parameter setting of the camera can be done via

14
cell phone. In some experiments, the brightness and exposure of the camera are adjusted to increase
contrast.

5.3 Parameter setting

The parameter settings of all experiments in this paper are shown in Supplementary Table 3. Al-
though the same set of parameters can still effectively work across different experiments, we fine-
tune them to gain better performance. The criterion for parameter tuning is explained below. In the
shape-assembly experiments, all the parameters are the same except that σ2 varies mildly in differ-
ent scenarios. This is because robots may require different exploring strengths for different complex
shapes. In the cargo-transportation experiment, σ1 is an important parameter. Here, it is tuned to be a
little large so that robots can enter the moving shape and encircle the cargo as quickly as possible. In
the space-exploration experiment, σ1 and κ3 are tuned to be a little large so that the robots can flood
into the space quickly while avoiding collision.

Supplementary Table 3: Experiment parameter settings


Parameters
Experiments
κ1 σ1 σ2 κ3 α c1 c2
Fig. 3A 2.0 0.5 6.0 10.0 0.8 1.6 1.6
Complex
shape assembly Fig. 3C 2.0 0.5 5.0 10.0 0.8 1.6 1.6
Fig. 4 2.0 0.5 6.0 10.0 0.8 1.6 1.6
Cargo transportation Fig. 5 2.0 2.0 6.0 6.0 0.8 1.6 1.6
Fig. 6A 2.5 2.0 5.0 15.0 0.8 1.6 1.6
Space exploration
Fig. 6B 2.5 3.0 8.0 15.0 0.8 1.6 1.6

Parameter `cell may influence the smoothness of the control command. When `cell is too big (e.g.,
equal to the sensing radius of each robot), the number of cells that are inside the sensing radius of
each robot would be small. In this case, a cell leaving or entering the sensing radius would constitute
a major change that may cause an abrupt change in the control command. By contrast, when `cell
is small, the number of cells that are inside the sensing radius of each robot is large. In this case, a
cell leaving or entering the sensing radius would cause a smaller change in the control command and
hence the smoothness is enhanced.
Selecting an appropriate sampling rate is important to achieve accurate and stable performance.
Discretization can affect the precision of a dynamic system. For the negotiation/consensus process,
an implementation obtained from discretizing a finite-time-convergent continuous-time algorithm

15
would converge to a neighborhood of zero (instead of exactly zero) [11]. Similarly, discretization
would cause a loss of information which may result in poorer control performance [12, Chapter 14.2].
The digital implementation of our control algorithm uses a zero-order hold. Similar techniques are
also used in [9, 13, 14]. Nevertheless, the impact of discretization is neglectable if the sampling rate
is properly selected. General guidelines on how to select appropriate sampling rates can be found
in [12, Chapter 14.2]. For example, the sampling rate of the consensus process in our simulation and
experiments is 100 Hz. The resulting consensus errors of the position and orientation of the desired
shape are smaller than the level of 10−2 even when the shape tracks a time-varying trajectory. The
experimental results confirm a satisfactory level of performance of the system.

6 Convergence Analysis
We next present the convergence analysis of the proposed negotiation and control algorithms. The
output of the consensus process is used by the control process, but the negotiation process does not
rely on the control process. This relationship is illustrated by Supplementary Figure 9.
Negotiation states of Motion states
neighbors of neighbors

p ρo , j , v ρo , j ,  j , j  i pj,vj, j  i

Graphical Nonparametric Parametric


desired shape Gray grid gray grid Interpretation gray grid Proposed
Robot
conversion negotiation control

Negotiation states pρo ,i , v ρo ,i , i Motion states pi , v i

Negotiation loop Control loop

Supplementary Figure 9: The structure of the proposed method.

It is notable that the consensus process converges much faster than the control process. The
fundamental reason is that the consensus process is a numerical computational process that involves
only virtual states (i.e., the position and orientation of the desired shape). These states are not subject
to physical dynamics. By contrast, the control process is subject to real physical dynamics and
constraints such as the dynamics of the robots and the saturation of the velocity and acceleration.
Therefore, the control process evolves much slower. The experimental and simulation results support
this observation. For instance, it can be seen from Figure 3c in the main text that the consensus
process converges more than 5 times faster than the control process (the convergence time of the
consensus process is about 3 seconds whereas that of the control process is about 20 seconds).
Since the consensus process converges much faster, it can be viewed as a fast inner loop while
the control process is a slow outer loop. Then, we can analyze the two processes separately. That is,

16
when we analyze the convergence of the control process, we can assume that the consensus process
has already converged.

6.1 Convergence Analysis of Negotiation Algorithms

6.1.1 Preliminaries

We first introduce some preliminary results.

Lemma 1 ( [15] ). Suppose that function V (t) : [0, ∞) → [0, ∞) is differentiable and satisfies

V̇ (t) ≤ −cV (t)α

where c > 0 and 0 < α < 1 are two constants. Then, V (t) will reach zero at finite time t∗ ≤
V (0)1−α /[c(1 − α)] and V (t) = 0 for all t ≥ t∗ .

Lemma 2 ( [16] ). Let z1 , z2 , ..., zm ≥ 0 and 0 < β ≤ 1. Then

m
!β m
X X
zi ≤ ziβ .
i=1 i=1

Lemma 3 ( [17] ). Suppose function g satisfies g(zi , zj ) = −g(zj , zi ), i, j ∈ {1, 2, ..., m}, i 6= j.
Then, for a set of numbers y1 , y2 , ..., ym , it holds that

m X
m m m
X 1 XX
yi g(zi , zj ) = (yi − yj )g(zi , zj ).
i=1 j=1
2 i=1 j=1

6.1.2 Convergence analysis

We next analyze the convergence of the negotiation algorithm in (3) and (4) in the main text. We only
consider the case where there are no informed robots. In particular, the negotiation algorithm in (3)
in the main text can be written as

nrobot nrobot
c1 X α 1 X
vρo ,i =− aij sig pρo ,i − pρo ,j + aij vρo ,j (4)
|Ni | j=1 |Ni | j=1

17
where sig(·)α = sign(·)| · |α , and aij ∈ {0, 1}. If (i, j) ∈ E, then aij = 1, otherwise aij = 0.

Lemma 4 (Properties of sig function). For any vector z = [z1 , ..., zm ]T , it holds that sig(−z)α =
−sig(z)α and zT sig(−z)α ≥ kzkα+1 , where k · k is the Euclidean norm.

Proof. First, sig(−z)α = sign(−z)|−z|α = −sign(z)|z|α = −sig(z)α . Second, zT sig(−z)α =


2 α+1
Pm Pm
α α+1
= m T α
P
i=1 zi sign(zi )|zi | = i=1 |zi | i=1 (|zi | )
2 . Based on Lemma 2, we have z sig(−z) =
α+1
2 α+1
Pm
≥( m 2 2
= kzkα+1 .
P
i=1 (|zi | ) i=1 |zi | )
2

With the above preparation we are ready to present the following convergence result. It should
be noted that the convergence relies on an assumption of the underlying graph G. In particular, G
is assumed to be connected and fixed. This assumption is valid when the initial graph is connected
and the consensus process converges much faster than the control process. In particular, we can
suppose that, when the consensus process converges, the swarm configuration is almost unchanged
and hence the graph remains fixed and connected. In fact, a simple method that can strictly ensure the
assumption of the underlying graph would be to run an initialization process, during which we wait
for the consensus process to converge first. We did not do this because the present strategy already
works effectively.
The design of the consensus algorithm in (4) is inspired by the work in [16] and our previous
work in [3]. The proof of the finite-time convergence given below is inspired by the method in [16].

Theorem 1 (Convergence of negotiation). If G is undirected, connected, and fixed, under the ne-
gotiation algorithm (3) and (4), there exists a finite time t∗ > 0 such that pρo ,i (t) = pρo ,j (t) and
φi (t) = φj (t) for all t ≥ t∗ and all i, j ∈ V.

Proof. Reorganizing (4) and multiplying |Ni | on both sides gives

nX
robot nX
robot
 α
aij vρo ,i − vρo ,j = −c1 aij sig pρo ,i − pρo ,j .
j=1 j=1

pT
P
Multiplying i ρo ,i on both sides of the above equation yields

nX
robot nX
robot

aij pT
ρo ,i (vρo ,i − vρo ,j ) = −c1 aij pT α
ρo ,i sig(pρo ,i − pρo ,j ) .
i,j=1 i,j=1

18
By applying Lemma 3 and the fact that aij = aji , we have

nX
robot nX
robot
T  T α
aij pρo ,i − pρo ,j vρo ,i − vρo ,j = −c1 aij pρo ,i − pρo ,j sig pρo ,i − pρo ,j . (5)
i,j=1 j=1

Choose the Lyapunov candidate as

nrobot
1 X T 
V (t) = aij pρo ,i − pρo ,j pρo ,i − pρo ,j .
2 i,j=1

Substituting (5) into the time derivative of V (t) yields

nX
robot nX
robot
T  T α
V̇ (t) = aij pρo ,i − pρo ,j vρo ,i − vρo ,j = −c1 aij pρo ,i − pρo ,j sig pρo ,i − pρo ,j .
i,j=1 j=1

It then follows from Lemma 4 that

nX
robot nX
robot  2 2
 α+1
2
α+1 α+1
V̇ (t) ≤ −c1 aij pρo ,i − pρo ,j = −c1 aij pρo ,i − pρo ,j .
i,j=1 i,j=1

2
Since aij ∈ {0, 1}, we have aij α+1 = aij . It then follows from Lemma 2 that

nX
! α+1
2
robot
2 α+1 α+1 α+1
V̇ (t) ≤ −c1 aij pρo ,i − pρo ,j = −c1 [2V (t)] 2 = −2 2 c1 V (t) 2

i,j=1

α+1
Thus, by Lemma 1, there exist c = 2 2 c1 and t∗1 ≤ V (0)/[c(1 − α)] such that V (t) = 0 for all
t ≥ t∗1 .
The convergence proof of algorithm (4) in the main text is similar to algorithm (3). We can also
conclude that there exists at finite time t∗2 such that all robots’ negotiations on shape orientation will
reach an agreement before t∗2 . Let t∗ = max{t∗1 , t∗2 }. Then, both pρo ,i (t) = pρo ,j (t) and φi = φj for
all t ≥ t∗ and all i, j ∈ V.

6.2 Convergence Analysis of Control Algorithms

6.2.1 Preliminaries

We need to introduce a necessary preliminary result.

Theorem 2 (Direction of mean-shift [18]). Let xi ∈ R2 be a data point and D = {xi } be a set of

19
finite data points. Suppose g(·) is a kernel function. The mean-shift vector defined for any y ∈ R2 ,
P
g (ky − xi k) xi
xi ∈D
m(y) = P − y, (6)
g (ky − xi k)
xi ∈D

points toward the direction of the maximum increase of the data point density, that is the gradient
direction.

The above theorem indicates a well-known property of the classic mean-shift algorithm for den-
sity maximization. Since the proposed shape-exploration command viexp in (6) in the main text is an
adapted mean-shift algorithm, Theorem 2 will be useful.

6.2.2 Objective function and assumptions

Consider the objective function J(t) defined as

nX
robot nX
robot
 
J(t) = Ji (t) = h ξρi ,c (t) (7)
i=1 i=1

where h is the number of gray levels, ξρi ,c is the gray value of the cell occupied by robot i in Fgray,c ,
and b·e is rounding to the nearest integer. Here, h is a constant and hence can be removed from the
objective function. However, we retain it because 0 ≤ ξρi ,c (t) ≤ 1 but hξρi ,c (t) is an integer so that
 
we can apply Theorem 3. Note that Ji (t) = h ξρi ,c (t) is the value of robot i = 1, . . . , nrobot .
Since J(t) = 0 if and only if all robots enter Fc , we can prove the convergence of the control
dynamics by showing that J(t) converges to zero. To that end, we introduce the following theorem
from [9].

Theorem 3 (Almost sure convergence [9]). Let P {X} denote the probability of event X occurring.
For any function J(t) ∈ Z≥0 , it will almost surely converge to zero if:
1) J(t) is always bounded from above: ∃a ∈ Z≥0 , s.t. ∀t, J(t) ≤ a;
2) J(t) is always non-increasing: ∀t2 ≥ t1 , J(t2 ) ≤ J(t1 );
3) J(t) is strictly decreasing with nonzero probability: ∃τ,  > 0, s.t. ∀t, P {J(t + τ ) ≤ J(t) −
1|J(t) 6= 0} ≥ .

To apply this theorem, considering the high complexity of the overall system, we introduce the
following mild assumptions.
1) Convex desired shape. Although the proposed control method works effectively for non-convex
shapes, we only consider convex shapes in the convergence analysis. In particular, the shape should

20
be such that, for a robot located in any position, the black cells and the non-black cells inside the
robot’s sensing radius form two convex sets, respectively. In this way, the convergence proof will be
simplified for the robots that are near the boundary of the desired shape.
2) Large desired shape. We assume that the desired shape is sufficiently large to accommodate
all nrobot robots. If this assumption is not satisfied, it is possible that the robots may not be able to
move into the desired shape and J(t) may not reach zero. For example, suppose each robot occupies
2 2
a space of πravoid and the space of the desired shape should be at least nrobot πravoid .
3) Stationary desired shape. Although the proposed control method can handle moving desired
shapes, we only consider the case of stationary desired shapes. That is vref = 0. Moreover, since
the velocity alignment term in (7) is designed for tracking moving desired shapes, it is ignored in the
convergence proof as well. Experimental results verify that the absence of this term does not affect
the convergence of the system for stationary desired shapes. In this way, the control command (7)
becomes a pure repelling velocity command for inter-robot collision avoidance.
4) Sparse initial configuration. We assume that in the initial configuration the robots are located
sparsely so that the distance between any two robots is greater than ravoid . Without this assumption,
robots may have large repelling velocities initially so that J(t) may increase.

6.2.3 Convergence of the objective function

With the above preparation, we are ready to analyze the system convergence. We will prove that the
three conditions in Theorem 3 are all valid one by one. The intuition is illustrated by the simulation
example in Supplementary Figure 10, which shows that Ji (t) for all i and J(t) are decreasing.

a Final swarm and trajectory b Cost function Ji (t) of robot i c Objective function J (t)
30.1 36 2304

22.5 24 1728
y-axis (m)

y-axis (m)

y-axis (m)

14.9 16 1152

7.3 8 576
Initial position
Final position
-0.3 0 0
-0.3 7.3 14.9 22.5 30.1 0 2 4 6 8 0 2 4 6 8
x-axis (m) Time (s) Time (s)

Supplementary Figure 10: An example to illustrate the mathematical property that J(t) and Ji (t)
decrease zero.

First, we show that the first condition in Theorem 3 is valid.

21
Lemma 5 (Boundedness of J(t)). The objective function J(t) is bounded from above for all t =
0, 1, 2, . . . and specifically satisfies 0 ≤ J(t) ≤ nh.

Proof. It follows from (1) in the main text that ξρi ,c takes a value in [0, 1]: if ρi is black, then ξρi ,c = 0;
 
if ρi is white, then ξρi ,c = 1; otherwise, ρi is gray and ξρi ,c ∈ (0, 1). Therefore, h ξρi ,c (t) is an
integer in [0, h] and hence J(t) = ni=1
P robot  
h ξρi ,c (t) is an integer in [0, nh].

Second, we show that the second condition in Theorem 3 is valid. This is to show that J(t) is
always non-increasing.

Lemma 6 (Non-increasing of J(t)). The objective function J(t) is non-increasing for t = 0, 1, 2, . . . .

Proof. The idea of the proof is to show that Ji (t) is non-increasing for any i ∈ {1, . . . , nrobot } and
hence J(t) = ni=1
P robot
Ji (t) is non-increasing. This idea is illustrated by Supplementary Figure 10.
We consider the following two scenarios.
• Scenario 1: robot i is inside the desired shape (see Supplementary Figure 11a).
When robot i is inside the desired shape, it is driven jointly by viexp and viint . We further examine
two cases.
Case 1.1: robot i is inside the desired shape but far away from the shape boundary (see the left
subfigure of Supplementary Figure 11a). In this case, since the maximum velocity of each robot is
limited and the sampling time is sufficiently small, it is impossible for robot i to move out of the
shape at the next time step t + 1. As a result, Ji (t) would not increase. Moreover, on the one hand,
viexp points to the highest density point of the unoccupied black cells due to Theorem 2. On the
other hand, if there are robots inside the collision range of robot i, then viint points from the highest
density of the surrounding robots. As a result, the overall velocity would drive robot i away from the
surrounding robots to the highest density of surrounding black cells.
Case 1.2: robot i is inside the desired shape but sufficiently close to the boundary so that the robot
may possibly move out of the shape in the next time step (see the right subfigure of Supplementary
Figure 11a). In this case, viexp points to the inside of the desired shape (i.e., the highest density point
of black cells). We next show that the overall velocity is impossible to point to the outside of the
shape so that robot i moves out of the shape. The proof is by contradiction. Suppose that the overall
velocity of robot i points to the outside of the shape. Since viexp points to the inside, we know that
viint must point to the outside and its magnitude must be greater than viexp . It indicates that robot i
must be sufficiently close to one or multiple inner robots so that the repelling velocity generated by
the inner robots is great. The sufficient closeness can be generated due to two possibilities.

22
a Inside the desired shape b Outside the desired shape

Supplementary Figure 11: An illustration of cases in the proof of Lemma 6. a Robot i is inside the
desired shape. b Robot i is outside the desired shape.

The first possibility is that robot i approaches the inner robots actively to reach a sufficiently
small separation. It is however impossible for the repelling velocity to be greater than the exploration
velocity since robot i would already stop approaching the inner ones when the repelling velocity
increases to certain values. The second possibility is that the inner ones approach robot i actively to
reach a sufficiently small separation. This is also invalid. On the one hand, the inner robots would
not actively approach a robot sufficiently close based on the analysis in Case 1.1. On the other hand,
when the inner robots are close to the shape boundary, their viexp command would also turn to point
to the inside of the shape. Therefore, the overall velocity of a robot would not point to the outside.
Therefore, a robot that has entered a shape would not leave and hence Ji (t) does not increase.
• Scenario 2: robot i is located outside of the desired shape (see Supplementary Figure 11b).
This scenario can be further divided into two cases.
Case 2.1: robot i is outside but close to the boundary of the shape so that robot i is surrounded
by both black and non-black cells (see the left subfigure of Supplementary Figure 11b). In this case,
robot i would be driven by vient , viexp , and viint . Here, vient and viexp both point to the inner of the
shape. Moreover, since the inner agents would not leave the shape as analyzed in Scenario 1, we
know that the overall velocity of robot i would not point to the outer of the shape. The detailed
analysis is similar to Case 1.2. Therefore, Ji (t) would not increase.
Case 2.2: robot i is outside and far away from the boundary so that the surrounding cells are all
non-black (see the right subfigure of Supplementary Figure 11b). In this case, robot i is driven by
vient and viint . Here, vient points to ρT,i , which is the closest and darkest cell. Regarding viint , we know
the robots that are close to the shape would not diverge from it based on the analysis in Case 2.1. As
a result, they would not attempt to approach robot i to repel it away from the shape. The detailed
analysis is similar to Case 1.2. As a result, Ji (t) would not increase.

Although Lemma 6 shows that J(t) would not increase, it does not indicate whether J(t) will

23
decrease to zero. We still need to show that the swarm would not get trapped so that J(t) remains the
same nonzero value forever. To that end, we introduce the following concept first.

Definition 1 (Deadlock). A swarm of robots is deadlocked if they all stop moving while they have not
entered the desired shape completely.

We next show that the third condition in Theorem 3 is valid.

Lemma 7 (Decreasing of J(t)). For any t, if J(t) 6= 0, then there exists a finite time interval [t, t + T ]
where the objective function J(t) would strictly decrease by at least one.

Proof. We prove this by contradiction. Suppose that not all robots have entered the desired shape,
but the swarm is deadlocked so that all robots stop moving.
There are two scenarios (see an illustration in Supplementary Figure 12).
Scenario 1: all the robots are deadlocked outside of the desired shape (see Supplementary Fig-
ure 12a). This is impossible because if no robots are inside the shape, the outer ones that are close to
the shape would move into the inside driven by the vient command since there is no repelling velocity
that prevents a robot from doing that.
Scenario 2: some robots are inside the shape, and some are outside (see Supplementary Fig-
ure 12b). We first examine the robots inside the shape.
Suppose that m robots have already entered the shape, and m < nrobot . Since it is assumed that
the swarm is deadlocked, the outside robots have stopped moving. Then, the inside robots would
disperse in the shape and avoid generating repelling forces among themselves. That is because the
inter-robot repulsive command viint and exploration command viexp would encourage the robots to
disperse. Since the desired shape is assumed to be sufficiently large, the inter-robot distances among
the m robots would be greater or close to ravoid so that the repulsive velocity commands among
adjacent neighbors would be sufficiently small. In particular, when the desired shape is sufficiently
large, the inter-robot repulsive velocity commands would be zero.
Then, consider an outer robot that is outside but about to enter the boundary of the shape. The
outer robot would actively approach the inner ones due to the vient command. If the control gain κ3
in vient is sufficiently large, the inner robots would be pushed away since the inter-robot repelling
command is sufficiently small as analyzed above. Therefore, the outer robot would enter the shape
eventually. In summary, when m < nrobot robots are inside the robots, the inner robots disperse so
that inter-robot repelling velocity commands are close to zero and hence allow another outside robot
to enter. This conflicts with the hypothesis that the outside robots are deadlocked forever.
Therefore, although some individual robots may get trapped outside when “queuing” for entering
the shape, the swarm would not get deadlocked forever as analyzed above. As a result, the objective

24
a b c

Supplementary Figure 12: An illustration of the deadlocked scenarios in the proof of Lemma 7.

function J(t) would always decrease within a finite time. Once an outer robot enters the shape, J(t)
would decrease by at least one.

Theorem 4 (Convergence of J(t)). The objective function J(t) would eventually converge to zero
and hence all the robots would enter the desired shape.

Proof. Under the assumptions given at the beginning of Section 6.2.3, we can obtain Lemma 5 and
Lemma 6, which indicate that J(t) is always bounded from above and J(t) is always non-increasing.
Lemma 7 shows that J(t) is strictly decreasing with a probability of one within a finite time. This is a
stronger condition than the third condition of Theorem 3, which requires only a nonzero probability.
As a result, the third condition of Theorem 3 is satisfied. Therefore, the three conditions in Theorem 3
are satisfied and the convergence of J(t) follows.

Supplementary References
[1] Ning, B., Han, Q.L. & Lu, Q. Fixed-time leader-following consensus for multiple wheeled
mobile robots. IEEE Trans. Cybern. 50, 4381–4392 (2020).

[2] Dong, S., Ren, W. & Wu, Z.G. Observer-based distributed mean-square consensus design
for leader-following multiagent Markov jump systems. IEEE Trans. Cybern. 51, 3054–3061
(2021).

[3] Zhao, S. Affine formation maneuver control of multiagent systems. IEEE Trans. Autom. Control
63, 4140–4155 (2018).

[4] Chen, F. & Dimarogonas, D.V. Leaderfollower formation control with prescribed performance
guarantees. IEEE Trans. Control Netw. Syst. 8, 450–461 (2021).

[5] Zeng, C., Jian, Y., Vosoughi, S., Zeng, C. & Zhao, Y. Evaluating native-like structures of rna-
protein complexes through the deep learning method. Nat. Commun. 14, 1060 (2023).

25
[6] Groot, J.D. The libraries of the future will be made of DNA. https://theconversation.com/
the-libraries-of-the-future-will-be-made-of-dna-86274 (2018).

[7] Cai, Y. & Shen, Y. An integrated localization and control framework for multi-agent formation.
IEEE Trans. Signal Process. 67, 1941–1956 (2019).

[8] Zhao, S. & Zelazo, D. Localizability and distributed protocols for bearing-based network local-
ization in arbitrary dimensions. Automatica 698, 334–341 (2016).

[9] Wang, H. & Rubenstein, M. Shape formation in homogeneous swarms using local task swap-
ping. IEEE Trans. Robot. 36, 597–612 (2020).

[10] Alhafnawi, M., Hauert, S. & ODowd, P. Self-organised saliency detection and representation in
robot swarms. IEEE Robot. Autom. Lett. 6, 1487–1494 (2021).

[11] Ceragioli, F., Persis, C.D. & Frasca, P. Discontinuities and hysteresis in quantized average con-
sensus. Automatica 47, 1916–1928 (2011).

[12] Middleton, R.H. & Goodwin, G.C. in Digital control and estimation: A unified approach. (Pren-
tice Hall, New Jersey, 1990).

[13] Vsrhelyi, G., Virgh, C., Somorjai, G., Nepusz, T., Eiben, A.E. & Vicsek, T. Optimized flocking
of autonomous drones in confined environments. Sci. Robot. 3, eaat3536 (2018).

[14] Li, J., Ning, Z., Hei, S., Leei, C. & Zhao, S. Three-dimensional bearing-only target following
via observability-enhanced helical guidance. IEEE Trans. Robot. 39, 1509–1526 (2023).

[15] Bhat, S.P. & Bernstein, D.S. Finite-time stability of continuous autonomous systems. SIAM J.
Control Optim. 38, 751–766 (2000).

[16] Wang, L. & Xiao, F. Finite-time consensus problems for networks of dynamic agents. IEEE
Trans. Autom. Control 55, 950–955 (2010).

[17] Sun, Y., Feng, L., Li, W. & Shi, H. Finite-time flocking of cucker-smale systems. in 34th
Chinese Control Conf., pp. 7016–7020 (Hangzhou, China, IEEE, 2015).

[18] Fukunaga, K. & Hostetler, L. The estimation of the gradient of a density function, with applica-
tions in pattern recognition. IEEE Trans. Inf. Theory 21, 32–40 (1975).

26

You might also like