Skip to content

Commit 78ac234

Browse files
committed
add new outcome object_not-grasped to grab.py
1 parent 8e4022a commit 78ac234

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

challenge_manipulation/src/manipulation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ def lock(userdata=None):
516516
smach.StateMachine.add( "GRAB_ITEM",
517517
Grab(robot, self.current_item, self.empty_arm_designator),
518518
transitions={ 'done' :'STORE_ITEM',
519-
'failed' :'SAY_GRAB_FAILED'})
519+
'failed' :'SAY_GRAB_FAILED',
520+
'object_not_grasped': 'SAY_GRAB_FAILED'})
520521

521522
smach.StateMachine.add( "SAY_GRAB_FAILED",
522523
states.Say(robot, ["I couldn't grab this thing"], mood="sad"),

challenge_storing_groceries/src/challenge_storing_groceries/manipulate_machine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def lock(userdata=None):
116116
smach.StateMachine.add("GRAB_ITEM",
117117
states.Grab(robot, self.grab_designator, self.empty_arm_designator),
118118
transitions={'done': 'UNLOCK_ITEM_SUCCEED',
119-
'failed': 'UNLOCK_ITEM_FAIL'})
119+
'failed': 'UNLOCK_ITEM_FAIL',
120+
'object_not_detected': 'UNLOCK_ITEM_FAIL'})
120121

121122
@smach.cb_interface(outcomes=["unlocked"])
122123
def lock(userdata=None):

robot_smach_states/src/robot_smach_states/clear.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def __init__(self, robot, source_location, source_navArea, target_location, targ
111111
smach.StateMachine.add('GRAB',
112112
Grab(robot, selected_entity_designator, arm_des),
113113
transitions={'done': 'INSPECT_TARGET',
114-
'failed': 'failed'}
114+
'failed': 'failed',
115+
'object_not_grasped': 'failed'}
115116
)
116117

117118
smach.StateMachine.add('INSPECT_TARGET',

robot_smach_states/src/robot_smach_states/manipulation/grab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def __init__(self, robot, item, arm):
331331
:param item: Designator that resolves to the item to grab. E.g. EntityByIdDesignator
332332
:param arm: Designator that resolves to the arm to use for grabbing. Eg. UnoccupiedArmDesignator
333333
"""
334-
smach.StateMachine.__init__(self, outcomes=['done', 'failed'])
334+
smach.StateMachine.__init__(self, outcomes=['done', 'failed', 'object_not_grasped'])
335335

336336
# Check types or designator resolve types
337337
check_type(item, Entity)
@@ -357,7 +357,7 @@ def __init__(self, robot, item, arm):
357357

358358
smach.StateMachine.add('GRASP_DETECTOR', ActiveGraspDetector(robot, arm),
359359
transitions={'true': 'done',
360-
'false': 'RETRY_GRAB',
360+
'false': 'object_not_grasped',
361361
'failed': 'done',
362362
'cannot_determine': 'RETRY_GRAB'})
363363

@@ -367,7 +367,7 @@ def __init__(self, robot, item, arm):
367367

368368
smach.StateMachine.add('RETRY_GRASP_DETECTOR', ActiveGraspDetector(robot, arm),
369369
transitions={'true': 'done',
370-
'false': 'SAY_FAILED',
370+
'false': 'object_not_grasped',
371371
'failed': 'done',
372372
'cannot_determine': 'SAY_FAILED'})
373373

0 commit comments

Comments
 (0)