Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What does the goto() command do in drone programming?
The goto() command tells the drone to fly to a specific location or set of coordinates.
Click to reveal answer
beginner
How do you specify the destination in the goto() command?
You specify the destination by giving coordinates like latitude, longitude, and sometimes altitude.
Click to reveal answer
intermediate
Why is it important to check the drone's current position before using goto()?
Because the drone needs to know where it is to plan the best path to the destination safely.
Click to reveal answer
intermediate
Can the goto() command be used to navigate to moving targets?
Usually, goto() is for fixed points. For moving targets, more advanced tracking commands are needed.
Click to reveal answer
advanced
What happens if the drone encounters an obstacle while executing goto()?
The drone may stop, avoid the obstacle if programmed, or return to a safe point depending on its obstacle avoidance system.
Click to reveal answer
What parameters are typically needed for the goto() command?
ADrone model and color
BSpeed and battery level
CLatitude, longitude, altitude
DCamera angle and zoom
✗ Incorrect
The goto() command requires coordinates like latitude, longitude, and altitude to navigate.
If a drone is at position A and you use goto() to position B, what does the drone do?
ALands immediately
BReturns to the starting point
CTurns off
DFlies directly to position B
✗ Incorrect
The drone flies from its current position to the specified destination using goto().
Which of these is NOT a typical use of goto() in drone programming?
ATrack a moving object
BNavigate to a waypoint
CFly to a home location
DMove to a specific altitude
✗ Incorrect
goto() is for fixed points, not for tracking moving objects.
What should you do before using goto() to ensure safe navigation?
ACheck current position and battery
BTurn off the drone
CRemove the propellers
DChange the drone's color
✗ Incorrect
Checking position and battery helps ensure the drone can safely reach the destination.
If the drone encounters an obstacle during goto(), what is a possible behavior?
ASpeed up
BAvoid the obstacle or stop
CIgnore and crash
DChange color
✗ Incorrect
Drones with obstacle avoidance will try to avoid or stop to prevent crashes.
Explain how the goto() command works for drone navigation.
Think about how you tell a friend to go somewhere using an address.
You got /3 concepts.
Describe safety checks you should do before using goto() in a drone program.
Like checking your car's fuel and route before a trip.
You got /3 concepts.
Practice
(1/5)
1. What does the goto(x, y, z, speed) command do in drone programming?
easy
A. Moves the drone to the specified coordinates at the given speed.
B. Starts the drone's camera recording.
C. Lands the drone immediately.
D. Turns the drone around 360 degrees.
Solution
Step 1: Understand the purpose of goto()
The goto() command is designed to move the drone to a specific location using coordinates.
Step 2: Analyze the parameters
The parameters x, y, z represent the position in space, and speed controls how fast the drone moves there.
Final Answer:
Moves the drone to the specified coordinates at the given speed. -> Option A
Quick Check:
goto() moves drone = A [OK]
Hint: Remember: goto() moves drone to coordinates fast or slow [OK]
Common Mistakes:
Confusing goto() with camera or landing commands
Ignoring the speed parameter
Thinking goto() rotates the drone
2. Which of the following is the correct syntax to move a drone to position (10, 20, 5) at speed 3 using goto()?
easy
A. goto(10, 20, 3, 5)
B. goto(10, 20, 5, 3)
C. goto(3, 10, 20, 5)
D. goto(5, 3, 10, 20)
Solution
Step 1: Identify parameter order
The goto() command takes parameters in order: x, y, z, speed.
Step 2: Match values to parameters
Given position (10, 20, 5) and speed 3, the correct call is goto(10, 20, 5, 3).
Final Answer:
goto(10, 20, 5, 3) -> Option B
Quick Check:
Order is x,y,z,speed = C [OK]
Hint: Remember parameter order: x, y, z, then speed [OK]
Common Mistakes:
Mixing up speed with coordinate values
Changing parameter order
Using wrong numbers for coordinates
3. What will be the drone's final position after running this code?
goto(5, 5, 10, 2)
goto(10, 10, 5, 4)
medium
A. (0, 0, 0)
B. (5, 5, 10)
C. (15, 15, 15)
D. (10, 10, 5)
Solution
Step 1: Execute first goto()
The drone moves to coordinates (5, 5, 10) at speed 2.
Step 2: Execute second goto()
The drone then moves to (10, 10, 5) at speed 4, which is the final position.
Final Answer:
(10, 10, 5) -> Option D
Quick Check:
Last goto() position = A [OK]
Hint: Last goto() sets final position, earlier ones are overwritten [OK]
Common Mistakes:
Adding coordinates instead of replacing
Ignoring the second goto()
Confusing speed with position
4. Identify the error in this code snippet:
goto(10, 20, speed=5, 3)
medium
A. Speed parameter is given before z coordinate.
B. No error; code is correct.
C. Using named argument for speed but position parameters are positional.
D. Missing one coordinate parameter.
Solution
Step 1: Check parameter usage
The code mixes positional and named arguments incorrectly by placing speed=5 before the last positional argument.
Step 2: Understand Python argument rules
Positional arguments must come before named arguments; here, 3 is positional after a named argument, causing a syntax error.
Final Answer:
Using named argument for speed but position parameters are positional. -> Option C
Quick Check:
Named args after positional = D [OK]
Hint: Named arguments must come after all positional ones [OK]
Common Mistakes:
Placing named arguments before positional
Assuming order doesn't matter
Missing commas between parameters
5. You want the drone to inspect three points in order: (0,0,5), (10,0,5), and (10,10,5), each at speed 2. Which code correctly uses goto() to do this?