0
0
Drone Programmingprogramming~30 mins

Waypoint mission creation in Drone Programming - Mini Project: Build & Apply

Choose your learning style9 modes available
Waypoint Mission Creation
📖 Scenario: You are programming a drone to fly a simple mission by visiting specific GPS points called waypoints. Each waypoint has latitude, longitude, and altitude. The drone will fly from one waypoint to the next in order.This is useful for tasks like aerial photography, surveying, or delivery.
🎯 Goal: Create a waypoint mission by defining waypoints, setting a mission speed, building the mission list, and printing the mission details.
📋 What You'll Learn
Create a list of waypoints with exact GPS coordinates and altitudes
Set a mission speed variable
Build a mission list that includes each waypoint with speed
Print the mission waypoints with their details
💡 Why This Matters
🌍 Real World
Waypoint missions are used in drones for tasks like mapping, inspection, and delivery by flying precise routes.
💼 Career
Understanding waypoint mission creation is important for drone operators, developers, and engineers working in aerial robotics and automation.
Progress0 / 4 steps
1
Create the list of waypoints
Create a list called waypoints with these exact dictionaries: {'lat': 37.7749, 'lon': -122.4194, 'alt': 100}, {'lat': 37.7750, 'lon': -122.4180, 'alt': 120}, and {'lat': 37.7755, 'lon': -122.4170, 'alt': 110}.
Drone Programming
Need a hint?

Use a list with three dictionaries. Each dictionary must have keys 'lat', 'lon', and 'alt' with the exact values.

2
Set the mission speed
Create a variable called mission_speed and set it to 5 (meters per second).
Drone Programming
Need a hint?

Just create a variable named mission_speed and assign the number 5.

3
Build the mission list with speed
Create a list called mission that contains dictionaries for each waypoint. Each dictionary should have keys 'lat', 'lon', 'alt', and 'speed'. Use a for loop with variables point to iterate over waypoints and add mission_speed as the speed for each waypoint.
Drone Programming
Need a hint?

Use a for loop to go through each waypoint and add a new dictionary to mission with the same lat, lon, alt, and the speed from mission_speed.

4
Print the mission waypoints
Use a for loop with variables wp and index using enumerate(mission, 1) to print each waypoint in the format: Waypoint {index}: lat={lat}, lon={lon}, alt={alt}, speed={speed}.
Drone Programming
Need a hint?

Use enumerate(mission, 1) to get the index starting at 1 and print each waypoint's details with an f-string.