Introduction
Flying multiple drones together in a coordinated way can be tricky. The challenge is to keep them moving safely and smoothly as a group without crashing or losing control.
Imagine a group of cyclists riding together on a road. One cyclist leads the way, and the others follow closely behind, keeping a steady distance and matching the leader's speed and turns to stay safe and organized.
┌───────────┐
│ Leader │
└─────┬─────┘
│
┌─────────┴─────────┐
│ │
┌─────┴─────┐ ┌─────┴─────┐
│ Follower1 │ │ Follower2 │
└───────────┘ └───────────┘positions = [(0,0), (1,1), (2,2)]
for i, pos in enumerate(positions):
print(f"Drone {i} flies to {pos}")drones = ['D1', 'D2', 'D3']
positions = [(0,0), (1,1), (2,2)]
for i in range(len(drones)):
print(f"Send {drones[i]} to position {positions}")Pass the test and this pattern moves unknown