@@ -324,7 +324,8 @@ def execute(self, userdata=None):
324324class Grab (smach .StateMachine ):
325325 def __init__ (self , robot , item , arm ):
326326 """
327- Let the given robot move to an entity and grab that entity using some arm
327+ Let the given robot move to an entity and grab that entity using some arm. Performs grasp detection and retries
328+ if it's not holding anything
328329
329330 :param robot: Robot to use
330331 :param item: Designator that resolves to the item to grab. E.g. EntityByIdDesignator
@@ -358,7 +359,7 @@ def __init__(self, robot, item, arm):
358359 transitions = {'true' : 'done' ,
359360 'false' : 'RETRY_GRAB' ,
360361 'failed' : 'done' ,
361- 'cannot determine' : 'done ' })
362+ 'cannot determine' : 'RETRY_GRAB ' })
362363
363364 smach .StateMachine .add ('RETRY_GRAB' , PickUp (robot , arm , item ),
364365 transitions = {'succeeded' : 'RETRY_GRASP_DETECTOR' ,
@@ -368,7 +369,7 @@ def __init__(self, robot, item, arm):
368369 transitions = {'true' : 'done' ,
369370 'false' : 'SAY_FAILED' ,
370371 'failed' : 'done' ,
371- 'cannot determine' : 'done ' })
372+ 'cannot determine' : 'SAY_FAILED ' })
372373
373374 smach .StateMachine .add ('SAY_FAILED' , Say (robot , "I failed grabbing the object" ),
374375 transitions = {'spoken' : 'failed' })
0 commit comments