0
0
Drone Programmingprogramming~10 mins

Logging and log analysis in Drone Programming - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Logging and log analysis
Start Drone Operation
Generate Logs
Store Logs
Analyze Logs
Detect Issues or Confirm Success
Take Action or Continue Operation
This flow shows how a drone operation creates logs, stores them, analyzes them, and then uses the results to decide what to do next.
Execution Sample
Drone Programming
battery = 80
log("Drone started")
log("Altitude: 100m")
log("Battery: 80%")
if battery < 20:
  log("Warning: Low battery")
log("Drone landing")
This code logs drone status messages and warns if the battery is low.
Execution Table
StepActionLog MessageCondition CheckedResult
1Log start messageDrone startedN/AMessage stored
2Log altitudeAltitude: 100mN/AMessage stored
3Log battery levelBattery: 80%N/AMessage stored
4Check battery < 20N/A80 < 20?False, no warning logged
5Log landing messageDrone landingN/AMessage stored
💡 All steps completed, no low battery warning triggered
Variable Tracker
VariableStartAfter Step 3After Step 4Final
batteryN/A808080
Key Moments - 2 Insights
Why is there no 'Warning: Low battery' log even though we check battery?
Because at step 4 in the execution_table, the battery value is 80 which is not less than 20, so the warning log is skipped.
What happens to logs after they are generated?
Logs are stored immediately after each log() action as shown in the 'Result' column of the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is logged at step 2?
AAltitude: 100m
BBattery: 80%
CDrone started
DDrone landing
💡 Hint
Check the 'Log Message' column for step 2 in the execution_table
At which step does the battery condition get checked?
AStep 5
BStep 3
CStep 4
DStep 2
💡 Hint
Look at the 'Condition Checked' column in the execution_table
If battery was 10 instead of 80, what would happen at step 4?
ANo warning logged
BWarning: Low battery logged
CDrone landing logged
DBattery log skipped
💡 Hint
Refer to the 'Result' column for step 4 and imagine battery < 20 is true
Concept Snapshot
Logging records events during drone operation.
Logs are stored immediately for later review.
Conditions can trigger special logs (e.g., warnings).
Analyzing logs helps detect problems or confirm success.
Logs guide decisions during and after flight.
Full Transcript
This visual execution shows how a drone program logs messages step-by-step. It starts by logging the drone start, altitude, and battery level. Then it checks if the battery is low. Since the battery is 80, no warning is logged. Finally, it logs the drone landing. Variables like battery are tracked through the steps. Key moments clarify why warnings appear or not. Quiz questions test understanding of log messages and conditions.