Consider a drone starting with orientation angles roll=0°, pitch=0°, yaw=0°. The drone applies a roll of 30° followed by a pitch of 45°. What is the final pitch angle after these rotations?
roll = 0 pitch = 0 yaw = 0 # Apply roll roll += 30 # Apply pitch pitch += 45 print(pitch)
Roll changes the rotation around the front-to-back axis, pitch changes rotation around the side-to-side axis. They add independently here.
Roll and pitch are rotations around different axes. Applying roll does not change pitch. After applying pitch of 45°, the pitch angle is 45°.
Which axis does the yaw rotation occur around in a drone's coordinate system?
Yaw turns the drone left or right, like turning your head.
Yaw is rotation around the vertical axis, which points up from the drone. This rotation changes the drone's heading direction.
A drone starts with roll=0°, pitch=0°, yaw=0°. It first applies a yaw of 90°, then a roll of 90°. What is the final roll angle?
roll = 0 pitch = 0 yaw = 0 yaw += 90 roll += 90 print(roll)
Roll and yaw rotations are around different axes and add independently here.
Yaw changes heading but does not affect roll angle. After applying roll of 90°, the roll angle is 90°.
What error does the following code produce?
pitch = 0 pitch = pitch + '30' print(pitch)
Check the types of values being added.
The code tries to add an integer (pitch) and a string ('30'), which causes a TypeError.
A drone starts at roll=0°, pitch=0°, yaw=0°. It applies these rotations in order: roll=45°, pitch=30°, yaw=60°. What is the final yaw angle?
roll = 0 pitch = 0 yaw = 0 roll += 45 pitch += 30 yaw += 60 print(yaw)
Each rotation changes its own axis angle independently here.
Yaw is updated last by adding 60°. The final yaw angle is 60°.
