Module 4/5 · Weeks 10–12 · 27 h

Multiple UAS

UAT 366 Indoor Autonomous and Multi-Unmanned Aircraft Systems

About 90 minDraft, awaiting reviewLast updated 30 September 2026

Lesson

By the end of this module you will be able to

  1. Assign tasks to several drones by exhaustive search and compare with a greedy method
  2. Compute the closest approach of two drone paths between waypoints
  3. Explain downwash, the Boids rules and ORCA in multi-drone flight
  4. Estimate the communication bandwidth of a drone swarm
  5. Keep a formation with leader-follower slots or a consensus rule and choose a stable step size

Prerequisites: UAT 366 Modules 1–3

Why this matters

One drone cannot count the whole warehouse in a night; three can do it faster, but new questions arise. Which drone does which job? Do the paths cross? Does the downwash from an upper drone disturb one below? Can the network carry every drone’s data? The review by Chung et al. (2018) concludes that multi-drone coordination must handle task allocation, path planning and communication together.

Task allocation

Matching drones to tasks with the least total distance is the assignment problem, solved exactly by the Hungarian method (Kuhn, 1955). For small numbers exhaustive search works. A greedy method, where each drone in turn takes its nearest remaining task, is fast but can be very poor.

A rectangular warehouse plan with four drones D1 to D4 at the corners and four tasks T1 to T4 inside. Blue lines show the minimum-total-distance assignment: D1 to T3, D2 to T1, D3 to T2 and D4 to T4
Figure 1 Assigning tasks to four drones

Example 1 Exhaustive search versus greedy

import math
from itertools import permutations

drones = [(0, 0), (0, 30), (60, 0), (60, 30)]
tasks = [(10, 25), (35, 15), (30, 5), (50, 25)]
cost = [[math.dist(d, t) for t in tasks] for d in drones]

best = min(permutations(range(4)), key=lambda p: sum(cost[i][p[i]] for i in range(4)))
used, greedy = set(), []
for i in range(4):
    j = min((j for j in range(4) if j not in used), key=lambda j: cost[i][j])
    used.add(j)
    greedy.append(j)

for name, plan in (("optimal", best), ("greedy", greedy)):
    total = sum(cost[i][plan[i]] for i in range(4))
    pairs = ", ".join(f"D{i + 1}->T{plan[i] + 1}" for i in range(4))
    print(f"{name:<8} {total:6.1f} m  {pairs}")
optimal    81.9 m  D1->T3, D2->T1, D3->T2, D4->T4
greedy    131.0 m  D1->T1, D2->T2, D3->T4, D4->T3

D1 takes its nearest task T1 first, which forces D2, close to T1, to travel far. The total is much worse than the optimum. For dozens of drones, use the Hungarian method, which finds the optimum without trying every permutation.

Closest approach between waypoints

The knowledge unit on swarm trajectories warns that checking only at waypoints can miss close approaches between them. Two drones swapping places are 2 m apart at both the start and the end, yet collide halfway.

Drone A in blue moves left to right while drone B in pink moves right to left over the same time. A vertical dashed line in the middle shows that at 1 second both are at x equals 0, closest distance zero; the two are drawn on separate rows for readability
Figure 2 Two paths that are apart at the waypoints but collide in between

Example 2 Closest approach between two path segments

Assume both drones move in straight lines at constant rates over the same interval.

def closest(a0, a1, b0, b1, t0=0.0, dt=2.0):
    r0 = [a - b for a, b in zip(a0, b0)]
    dr = [(a1i - b1i) - r for a1i, b1i, r in zip(a1, b1, r0)]
    dd = sum(v * v for v in dr)
    u = 0.0 if dd == 0 else min(1.0, max(0.0, -sum(r * d for r, d in zip(r0, dr)) / dd))
    d = sum((r + u * v) ** 2 for r, v in zip(r0, dr)) ** 0.5
    return d, t0 + u * dt

cases = {
    "swap on the same line": ((-1, 0, 2), (1, 0, 2), (1, 0, 2), (-1, 0, 2)),
    "swap 0.5 m apart sideways": ((-1, 0, 2), (1, 0, 2), (1, 0.5, 2), (-1, 0.5, 2)),
    "one above the other": ((0, 0, 2.0), (2, 0, 2.0), (0, 0, 2.4), (2, 0, 2.4)),
}
for name, (a0, a1, b0, b1) in cases.items():
    d, t = closest(a0, a1, b0, b1)
    print(f"{name:<26} ends {sum((a - b) ** 2 for a, b in zip(a0, b0)) ** 0.5:.1f} m apart -> "
          f"min {d:.2f} m at t {t:.1f} s")
swap on the same line      ends 2.0 m apart -> min 0.00 m at t 1.0 s
swap 0.5 m apart sideways  ends 2.1 m apart -> min 0.50 m at t 1.0 s
one above the other        ends 0.4 m apart -> min 0.40 m at t 0.0 s

In the third case the drones stay 0.4 m apart vertically the whole way, which looks safe, but the lower drone sits in the downwash of the upper one. Hönig et al. (2018) therefore model each drone as an ellipsoid that is longer vertically than horizontally, so the vertical separation threshold must be larger than the horizontal one. The actual values must come from testing the drone model in use.

Flocking and mutual avoidance

  • Boids (Reynolds, 1987) simulates a flock with three rules each bird applies on its own. The original names are collision avoidance, velocity matching and flock centering; today they are usually called separation, alignment and cohesion. There is no central commander.
  • ORCA (van den Berg et al., 2011) extends velocity obstacles so that each drone takes half the responsibility for avoidance, suitable for many drones deciding independently.
  • Crazyswarm (Preiss et al., 2017) is an experimental platform for swarms of small indoor drones, now available as Crazyswarm2 on ROS 2. Kushleyev et al. (2013) demonstrated agile indoor flight of many drones. Drone shows use software such as Skybrush with pre-planned trajectories.

A pre-planned show is different from a swarm that decides for itself. Warehouse stock counting usually combines central planning with local avoidance.

Communication

Every drone sends frequent position and status updates, and the total bandwidth grows with the number of drones.

Example 3 Swarm bandwidth

MSG_BYTES, RATE_HZ, OVERHEAD = 60, 30, 1.3          # position message, rate, protocol overhead
for n in (3, 10, 50):
    kbps = n * RATE_HZ * MSG_BYTES * 8 * OVERHEAD / 1000
    print(f"{n:>2} drones: {kbps:6.1f} kbit/s for position updates only")
 3 drones:   56.2 kbit/s for position updates only
10 drones:  187.2 kbit/s for position updates only
50 drones:  936.0 kbit/s for position updates only

These figures exclude camera video. If every drone streamed video, bandwidth would rise by hundreds of times. Processing on board and sending only results matters a great deal in multi-drone work.

Formation flight

Formation flight means keeping a fixed geometric shape while the group moves, for example three drones in a V scanning three rack levels side by side, or a line that sweeps an aisle. Flocking keeps the group together loosely; a formation fixes each drone’s slot in the shape. Oh, Park and Ahn (2015) sort formation-control methods by what each drone can sense and control:

  • Position-based: every drone knows its own position in a shared frame (RTK GNSS outdoors, motion capture or UWB indoors) and flies to its own slot. Drone shows and Crazyswarm-style labs work this way. It is simple, but the shape holds only as well as each drone’s positioning.
  • Displacement-based: each drone controls its relative position (displacement) to its neighbours in a shared heading reference, using their broadcast positions or relative sensing. It needs no common origin, only a common sense of direction.
  • Distance-based: each drone controls only the distances to its neighbours, and needs neither a shared origin nor a shared heading, at the cost of harder control laws.

Two ways of keeping a shape are common in practice. In leader-follower, each follower’s slot is the leader’s position plus an offset turned by the leader’s heading :

If the leader fails, the whole group loses its reference, so a replacement rule is needed. In consensus-based formation, each drone has a desired offset and moves so that its “position minus offset” agrees with its neighbours’. The discrete-time consensus rule of Olfati-Saber, Fax and Murray (2007), applied to , is

where are the drones that drone hears. The paper shows that a step size , where is the largest number of neighbours any drone has, guarantees convergence on a connected network. Each drone uses only its neighbours’ messages, the position updates of the previous section, so there is no single leader to lose. On top of this, a common velocity command moves the whole shape along the aisle.

Example 4. Leader-follower slots and consensus formation

Positions are in metres with x east and y north, and headings are measured counter-clockwise from the x axis. The V shape, the starting positions and the chain of radio links are assumed.

import math

def slot(leader, heading_deg, offset):          # leader-follower: offset is in the leader's frame
    a = math.radians(heading_deg)
    fwd, left = offset
    return (leader[0] + fwd * math.cos(a) - left * math.sin(a),
            leader[1] + fwd * math.sin(a) + left * math.cos(a))

for off in ((-2.0, 1.5), (-2.0, -1.5)):
    x, y = slot((10.0, 5.0), 90, off)
    print(f"offset {off} with leader heading 90 deg -> slot ({x:.1f}, {y:.1f})")

OFFSETS = [(0.0, 0.0), (-2.0, 1.5), (-2.0, -1.5)]   # desired shape: a V of three drones
LINKS = {0: [1], 1: [0, 2], 2: [1]}                # who hears whom (a chain), max degree 2

def spread(p):                                     # formation error: largest distance from agreement
    xi = [(p[i][0] - OFFSETS[i][0], p[i][1] - OFFSETS[i][1]) for i in range(3)]
    cx, cy = sum(x for x, _ in xi) / 3, sum(y for _, y in xi) / 3
    return max(math.hypot(x - cx, y - cy) for x, y in xi)

def run(eps, steps):
    p = [(0.0, 0.0), (1.0, 4.0), (5.0, -3.0)]      # scattered after take-off
    for _ in range(steps):
        new = []
        for i in range(3):
            ux = sum((p[j][0] - OFFSETS[j][0]) - (p[i][0] - OFFSETS[i][0]) for j in LINKS[i])
            uy = sum((p[j][1] - OFFSETS[j][1]) - (p[i][1] - OFFSETS[i][1]) for j in LINKS[i])
            new.append((p[i][0] + eps * ux, p[i][1] + eps * uy))
        p = new
    return spread(p)

print(f"start: formation error {run(0.4, 0):.2f} m")
for eps in (0.4, 0.6, 0.7):
    print(f"eps {eps}: error after 5 steps {run(eps, 5):6.2f} m, after 20 steps {run(eps, 20):8.2f} m")
offset (-2.0, 1.5) with leader heading 90 deg -> slot (8.5, 3.0)
offset (-2.0, -1.5) with leader heading 90 deg -> slot (11.5, 3.0)
start: formation error 4.10 m
eps 0.4: error after 5 steps   0.28 m, after 20 steps     0.00 m
eps 0.6: error after 5 steps   0.72 m, after 20 steps     0.03 m
eps 0.7: error after 5 steps   3.53 m, after 20 steps    14.75 m

With the leader flying north, “2 m behind and 1.5 m to the left” becomes (8.5, 3.0): turning the offset by the heading is essential, or the followers would take the wrong side when the leader turns. In the consensus part the middle drone has two neighbours, so . With the V forms within a few steps. is above the guaranteed limit and still converges, but more slowly with overshoot, because the condition is sufficient, not necessary. makes the drones overcorrect and the error grows: in real flight this is an oscillation that ends in a collision. The step size, update rate and message delay must be tested in SITL before flight, and the offsets must respect the downwash separation from the closest-approach section.

Module lab

Lab: two drones in the lab

  1. Use the code from Example 1 to assign stock-counting tasks to two or three drones and compare with greedy.
  2. Plan each drone’s path, check the closest approach of every segment with the code from Example 2, and fix any below the threshold.
  3. Test in SITL or Crazyswarm2 simulation first, then fly two real drones at low speed.
  4. Measure downwash by holding one drone above another at different separations and logging the lower drone’s disturbance.
  5. Measure the real network bandwidth during flight and compare with Example 3.

Common mistakes

Watch out

  • Using greedy without checking its quality.
  • Checking separation only at waypoints.
  • Using the same vertical and horizontal separation despite downwash.
  • Streaming video from every drone over one network.
  • Using formation offsets without turning them by the leader’s heading, or a consensus step size above without testing.
  • Flying multiple drones for the first time for real without simulating first.

Summary

  • Task allocation is an assignment problem, solved exactly by the Hungarian method; greedy can be very poor.
  • Closest approach must be checked between waypoints, not only at them.
  • Downwash requires larger vertical separation than horizontal separation.
  • Boids and ORCA let each drone decide for itself; bandwidth grows with the number of drones.
  • A formation fixes each drone’s slot: leader-follower turns offsets by the leader’s heading, and consensus needs to be sure of converging.

Check your understanding

  1. With 5 drones and 5 tasks, how many possible assignments are there?
  2. Drone A goes from (0, 0) to (4, 0) while drone B goes from (4, 1) to (0, 1) over the same time. What is the closest distance?
  3. Why is checking only at waypoints not enough?
  4. A leader at (0, 0) heads east (0°). Where is the slot of a follower whose offset is 2 m behind and 1 m to the left?
  5. 20 drones each send 60-byte messages 30 times per second (ignoring headers). What bandwidth is used?
Answers
  1. 1 m, when they pass at x = 2.
  2. Two drones can come close between waypoints even if they are apart at every waypoint.
  3. (−2, 1): behind is −x and left is +y when heading east.
  4. bit/s = 288 kbit/s

Key formulas

Closest approach of two drones in one segment
Total bandwidth
Consensus formation step

Key references

  1. Kuhn, H. W. (1955). The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1–2), 83–97. link
  2. Chung, S.-J., Paranjape, A. A., Dames, P., Shen, S., & Kumar, V. (2018). A survey on aerial swarm robotics. IEEE Transactions on Robotics, 34(4), 837–855. link
  3. Kushleyev, A., Mellinger, D., Powers, C., & Kumar, V. (2013). Towards a swarm of agile micro quadrotors. Autonomous Robots, 35(4), 287–300. link
  4. Preiss, J. A., Hönig, W., Sukhatme, G. S., & Ayanian, N. (2017). Crazyswarm: A large nano-quadcopter swarm. In 2017 IEEE International Conference on Robotics and Automation (pp. 3299–3304). IEEE. link
  5. Hönig, W., Preiss, J. A., Kumar, T. K. S., Sukhatme, G. S., & Ayanian, N. (2018). Trajectory planning for quadrotor swarms. IEEE Transactions on Robotics, 34(4), 856–869. link
  6. Reynolds, C. W. (1987). Flocks, herds and schools: A distributed behavioral model. ACM SIGGRAPH Computer Graphics, 21(4), 25–34. link
  7. van den Berg, J., Guy, S. J., Lin, M., & Manocha, D. (2011). Reciprocal n-body collision avoidance. In Robotics research (Springer Tracts in Advanced Robotics, Vol. 70, pp. 3–19). Springer. link
  8. IMRCLab. Crazyswarm2: A ROS 2 testbed for aerial robot teams [Documentation]. link
  9. CollMot Robotics. Skybrush Live documentation. link
  10. Oh, K.-K., Park, M.-C., & Ahn, H.-S. (2015). A survey of multi-agent formation control. Automatica, 53, 424–440. link
  11. Olfati-Saber, R., Fax, J. A., & Murray, R. M. (2007). Consensus and cooperation in networked multi-agent systems. Proceedings of the IEEE, 95(1), 215–233. link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Intensive lab and field practice recorded in a lab notebook

Learning evidence: Lab notebook signed by the instructor

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Automation, robotics and swarms · Aircraft, structures and design