DOCUMENT IT

This commit is contained in:
2019-02-25 21:00:42 +01:00
parent c987f7362b
commit fbb09ebf8f
9 changed files with 136 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
#! /usr/bin/env python
"""A small module for hand conrols service."""
import os
import rospy
@@ -12,6 +13,12 @@ mp = None
def do_in_parallel(func):
"""Open hands in parallel.
The robot's hand function blocks and only accepts one hand. This is a
thread-based hackaround.
"""
tl = Thread(target=func, args=('LHand',))
tr = Thread(target=func, args=('RHand',))
tl.start()
@@ -21,6 +28,7 @@ def do_in_parallel(func):
def handle_hands(request):
"""Hand service routine."""
if request.target == 'open':
do_in_parallel(mp.openHand)
return HandsResponse('opened')