Formation flying basics
📖 Scenario: You are programming a group of drones to fly together in a simple formation. Each drone has a unique ID and a starting position represented by coordinates (x, y).To keep the formation tight, you want to calculate the relative positions of each drone compared to the leader drone.
🎯 Goal: Build a program that stores the drones' starting positions, sets the leader drone, calculates the relative positions of all drones to the leader, and then prints these relative positions.
📋 What You'll Learn
Create a dictionary with drone IDs as keys and their (x, y) positions as values
Create a variable to store the leader drone's ID
Calculate the relative positions of each drone compared to the leader drone using a dictionary comprehension
Print the dictionary of relative positions
💡 Why This Matters
🌍 Real World
Drone teams often fly in formations for tasks like filming, surveying, or search and rescue. Calculating relative positions helps keep them coordinated.
💼 Career
Understanding how to manage multiple drones and their positions is important for drone operators, robotics programmers, and engineers working on autonomous systems.
Progress0 / 4 steps