Skip to content
Snippets Groups Projects
Commit 09084b15 authored by Projekt Robbie's avatar Projekt Robbie
Browse files

Robot changes

parent d78d2c83
No related branches found
No related tags found
1 merge request!5Extend homer_gesture_recognition Interface
......@@ -100,7 +100,7 @@ class GestureRecognitionInterface:
gestures = rospy.wait_for_message(
"/gesture_recognition/pointing",
PersonGestures,
timeout=timeout / gesture_count,
timeout=timeout,
)
except:
break
......@@ -117,34 +117,36 @@ class GestureRecognitionInterface:
ray_right = map(lambda p: PointWrapper(p), pointing.ray_right)
ray_left = map(lambda p: PointWrapper(p), pointing.ray_left)
if store_right != [] and store_left != []:
if store_right == [] and store_left == []:
rospy.loginfo("initially set store")
store_right = ray_right
store_left = ray_left
continue
else:
count = 0
store_modifications = 0
if ray_right != [] and store_right != []:
if ray_right[1].distance(store_right[1]) < distance_threshold:
store_right[1] = (store_right[1] + ray_right[1]) / 2
count += 1
store_modifications += 1
if ray_left != [] and store_left != []:
if ray_left[1].distance(store_left[1]) < distance_threshold:
store_left[1] = (store_left[1] + ray_left[1]) / 2
count += 1
store_modifications += 1
if count > 0:
if store_modifications > 0:
counter += 1
rospy.loginfo("inremented counter is now at " + str(counter))
else:
store_right = []
store_left = []
counter = 0
rospy.loginfo("reset store")
if counter >= gesture_count:
......@@ -154,7 +156,7 @@ class GestureRecognitionInterface:
]
if visualize:
publish_marker(result, lifetime=10, scale=0.2)
publish_marker(result, lifetime=10, scale=0.15, frame_id="map")
return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment