Skip to content

Commit 77ae731

Browse files
authored
(Place) Removed useless motion of arm and improved docs (#1317)
Current implementation: Robot goes to the `prepare_place` pose BEFORE navigating to the place pose. PR: Robot now doesn't move to the `prepare_place` pose anymore at any moment. Also changed some asserts to use more correct type checking
2 parents e5b3111 + 78a6b00 commit 77ae731

File tree

1 file changed

+2
-43
lines changed
  • robot_smach_states/src/robot_smach_states/manipulation

1 file changed

+2
-43
lines changed

robot_smach_states/src/robot_smach_states/manipulation/place.py

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,6 @@
1616
from robot_smach_states.world_model.world_model import Inspect
1717

1818

19-
class PreparePlace(smach.State):
20-
REQUIRED_ARM_PROPERTIES = {"required_trajectories": ["prepare_place"], }
21-
22-
def __init__(self, robot, arm):
23-
"""
24-
Drive the robot back a little and move the designated arm to place the designated item at the designated pose
25-
26-
:param robot: Robot to execute state with
27-
:param locked arm: Designator -> arm to place with, so Arm that holds entity_to_place, e.g. via
28-
ArmHoldingEntityDesignator
29-
"""
30-
smach.State.__init__(self, outcomes=['succeeded', 'failed'])
31-
32-
# Check types or designator resolve types
33-
check_type(arm, PublicArm)
34-
35-
# Assign member variables
36-
self._robot = robot
37-
self._arm_designator = arm
38-
39-
def execute(self, userdata=None):
40-
41-
arm = self._arm_designator.resolve()
42-
if not arm:
43-
rospy.logerr("Could not resolve arm")
44-
return "failed"
45-
46-
# Arm to position in a safe way
47-
arm.send_joint_trajectory('prepare_place', timeout=0)
48-
arm.wait_for_motion_done()
49-
50-
return 'succeeded'
51-
52-
# ----------------------------------------------------------------------------------------------------
53-
54-
5519
class Put(smach.State):
5620
REQUIRED_ARM_PROPERTIES = {"required_gripper_types": [GripperTypes.GRASPING], }
5721

@@ -201,9 +165,8 @@ def __init__(self, robot, item_to_place, place_pose, arm, place_volume=None, upd
201165
smach.StateMachine.__init__(self, outcomes=['done', 'failed'])
202166

203167
# Check types or designator resolve types
204-
assert(item_to_place.resolve_type == Entity or type(item_to_place) == Entity)
205-
assert(arm.resolve_type == PublicArm or type(arm) == PublicArm)
206-
#assert(place_volume.resolve_type == str or (type(place_volume) == str))
168+
check_type(item_to_place, Entity)
169+
check_type(arm, PublicArm)
207170

208171
# parse place volume
209172
if place_volume is not None:
@@ -244,10 +207,6 @@ def __init__(self, robot, item_to_place, place_pose, arm, place_volume=None, upd
244207
'failed': 'failed'}
245208
)
246209
smach.StateMachine.add('RESOLVE_ARM', ResolveArm(arm, self),
247-
transitions={'succeeded': 'PREPARE_PLACE',
248-
'failed': 'failed'})
249-
250-
smach.StateMachine.add('PREPARE_PLACE', PreparePlace(robot, arm),
251210
transitions={'succeeded': 'LOCK_DESIGNATOR',
252211
'failed': 'failed'})
253212

0 commit comments

Comments
 (0)