Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/stuff/topic_sensor3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def make_quaternion(angle):
return Quaternion(*q)

def save_value(value):
global angle
with lock: # <1>
angle = value * 2 * pi / 100.0 # <2>

Expand All @@ -30,6 +31,7 @@ def save_value(value):

pub = rospy.Publisher('angle', Quaternion, queue_size=10)

global angle
angle = None # <4>
rate = rospy.Rate(10.0)
while not rospy.is_shutdown():
Expand Down