Introduction
Imagine trying to control a flying drone smoothly in the air. To do this, you need to understand how it can turn or tilt in different directions. The axes of rotation—roll, pitch, and yaw—help describe these movements clearly.
Picture holding a toy airplane in your hand. Tilting it side to side is like roll, nodding its nose up and down is pitch, and turning it left or right while keeping it flat is yaw.
↑ Yaw (vertical axis)
│
│
│
O ← Drone center point
/│\
/ │ \
Roll → Pitch
(front-to-back axis) (side-to-side axis)Which axis controls the drone's rotation that tilts it side to side?
Which of the following is the correct way to set the yaw angle to 45 degrees in a drone control program?
drone.set_yaw(____)What will be the output of this code snippet controlling drone rotation?
roll = 10
pitch = -5
yaw = 90
print(f"Roll: {roll}, Pitch: {pitch}, Yaw: {yaw}")Find the error in this code that sets drone rotation angles:
drone.roll = 15
pitch = 20
drone.yaw = 45
print(f"Roll: {drone.roll}, Pitch: {pitch}, Yaw: {yaw}")You want to program a drone to tilt forward by 30 degrees, roll right by 15 degrees, and turn left by 90 degrees. Which code snippet correctly sets these rotations?
Option A:
drone.set_pitch(30)
drone.set_roll(15)
drone.set_yaw(-90)
Option B:
drone.set_pitch(-30)
drone.set_roll(-15)
drone.set_yaw(90)
Option C:
drone.set_pitch(30)
drone.set_roll(-15)
drone.set_yaw(90)
Option D:
drone.set_pitch(-30)
drone.set_roll(15)
drone.set_yaw(-90)Pass the test and this pattern moves unknown