0
0
Drone Programmingprogramming~10 mins

Speed control during mission in Drone Programming - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Speed control during mission
Start Mission
Set Initial Speed
Check Mission Progress
Adjust Speed?
NoContinue at Current Speed
Yes
Update Speed
Check if Mission Complete
No
End Mission
Back to Check Mission Progress
The drone starts the mission with an initial speed, then continuously checks progress to decide if speed needs adjustment, repeating until the mission ends.
Execution Sample
Drone Programming
speed = 5  # initial speed in m/s
while not mission_complete():
    progress = get_progress()
    if progress > 50:
        speed = 3  # slow down after halfway
    move_drone(speed)
This code sets an initial speed, then slows the drone down after it passes halfway through the mission.
Execution Table
Stepprogress (%)Condition (progress > 50)Speed (m/s)Action
110False5Move drone at speed 5
230False5Move drone at speed 5
355True3Slow down to speed 3
470True3Move drone at speed 3
590True3Move drone at speed 3
6100True3Mission complete, stop
💡 Mission progress reached 100%, loop ends
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5Final
speed5553333
progress01030557090100
Key Moments - 2 Insights
Why does the speed change only after progress passes 50%?
Because the condition 'progress > 50' becomes True at step 3 (progress 55), triggering the speed update as shown in the execution_table.
Does the speed ever increase again after slowing down?
No, once speed is set to 3 at step 3, it stays at 3 until mission ends, as no condition changes it back.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the speed at step 2?
A3 m/s
B5 m/s
C0 m/s
DCannot tell
💡 Hint
Check the 'Speed (m/s)' column at step 2 in the execution_table.
At which step does the condition 'progress > 50' become true?
AStep 5
BStep 1
CStep 3
DStep 6
💡 Hint
Look at the 'Condition (progress > 50)' column in the execution_table.
If the initial speed was 6 instead of 5, what would be the speed at step 1?
A6 m/s
B5 m/s
C3 m/s
D0 m/s
💡 Hint
Refer to variable_tracker for 'speed' initial value and how it changes.
Concept Snapshot
Speed control during mission:
- Start mission with initial speed
- Continuously check mission progress
- If progress passes threshold (e.g., 50%), adjust speed
- Continue until mission completes
- Use conditions inside loop to update speed dynamically
Full Transcript
This visual trace shows how a drone controls its speed during a mission. It starts with an initial speed of 5 meters per second. As the mission progresses, the program checks the progress percentage. When progress exceeds 50%, the speed is reduced to 3 meters per second to slow down the drone. This change happens at step 3 in the execution table. The speed remains at 3 until the mission completes at 100% progress. The variable tracker shows how 'speed' and 'progress' change at each step. Key moments clarify why speed changes only after halfway and why it does not increase again. The quiz questions help reinforce understanding by asking about speed values and condition checks at specific steps.