DOCUMENT IT
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user