Skip to content

Commit 119689e

Browse files
committed
examples: set_attitude_target: avoid use of None in to_quaternion
1 parent 10d79fa commit 119689e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/set_attitude_target/set_attitude_target.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def send_attitude_target(roll_angle = 0.0, pitch_angle = 0.0,
9494
Note that as of Copter 3.5, thrust = 0.5 triggers a special case in
9595
the code for maintaining current altitude.
9696
"""
97-
if not use_yaw_rate and yaw_angle is None:
97+
if yaw_angle is None:
98+
# this value may be unused by the vehicle, depending on use_yaw_rate
9899
yaw_angle = vehicle.attitude.yaw
99100
# Thrust > 0.5: Ascend
100101
# Thrust == 0.5: Hold the altitude

0 commit comments

Comments
 (0)