Introduction
Imagine flying a drone through a complex path where some parts need slow, careful movement and others require quick travel. Managing the drone's speed during the mission helps keep it safe and efficient.
Think of driving a car on a road trip. You slow down in busy towns and speed up on highways. You also follow traffic signs that tell you when to change speed.
┌─────────────────────────────┐ │ Mission Path │ ├─────────────┬───────────────┤ │ Waypoint 1 │ Speed: Slow │ ├─────────────┼───────────────┤ │ Waypoint 2 │ Speed: Medium │ ├─────────────┼───────────────┤ │ Waypoint 3 │ Speed: Fast │ └─────────────┴───────────────┘ ↓ Adjust speed based on environment ┌─────────────────────────────┐ │ Automatic & Manual Control│ └─────────────────────────────┘
drone.setSpeed(3) print(drone.speed)
drone.setspeed(10)
distance = drone.getDistance()
if distance < 5:
drone.setSpeed(2)
else:
drone.setSpeed(8)Pass the test and this pattern moves unknown