0
0
Drone Programmingprogramming~30 mins

Receiving telemetry data in Drone Programming - Mini Project: Build & Apply

Choose your learning style9 modes available
Receiving telemetry data
📖 Scenario: You are programming a drone that sends telemetry data about its position and battery level. You want to receive this data and process it step-by-step.
🎯 Goal: Build a program that receives telemetry data as a dictionary, sets a battery warning threshold, filters the telemetry data to find values below the threshold, and then prints the warnings.
📋 What You'll Learn
Create a dictionary called telemetry_data with keys 'altitude', 'speed', and 'battery' and values 120, 45, and 15 respectively.
Create a variable called battery_warning_level and set it to 20.
Use a dictionary comprehension called warnings to include only telemetry items where the value is less than battery_warning_level.
Print the warnings dictionary.
💡 Why This Matters
🌍 Real World
Drones send telemetry data to ground stations to monitor flight status and safety.
💼 Career
Understanding how to receive and filter telemetry data is important for drone software developers and engineers working with real-time sensor data.
Progress0 / 4 steps
1
Create telemetry data dictionary
Create a dictionary called telemetry_data with these exact entries: 'altitude': 120, 'speed': 45, and 'battery': 15.
Drone Programming
Need a hint?

Use curly braces {} to create a dictionary with the given keys and values.

2
Set battery warning level
Create a variable called battery_warning_level and set it to 20.
Drone Programming
Need a hint?

Just assign the number 20 to the variable battery_warning_level.

3
Filter telemetry warnings
Use a dictionary comprehension called warnings to include only items from telemetry_data where the value is less than battery_warning_level.
Drone Programming
Need a hint?

Use {key: value for key, value in telemetry_data.items() if value < battery_warning_level}.

4
Print warnings
Print the warnings dictionary.
Drone Programming
Need a hint?

Use print(warnings) to show the filtered dictionary.