Skip to content

Commit 4c078d1

Browse files
committed
Add arm.gripper_position_detector.min_position to compare
1 parent 1497e83 commit 4c078d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

robot_smach_states/src/robot_smach_states/manipulation/active_grasp_detector.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
from robot_smach_states.util.designators.arm import ArmDesignator
1111

1212

13+
1314
class ActiveGraspDetector(smach.State):
1415
REQUIRED_ARM_PROPERTIES = {"required_gripper_types": [GripperTypes.GRASPING], }
1516

1617
def __init__(self, robot: Robot, arm_designator: ArmDesignator, threshold_difference: float = 0.075,
17-
minimum_position: float = -0.75, max_torque: float = 0.15) -> None:
18+
max_torque: float = 0.15) -> None:
1819
"""
1920
State for detecting whether the robot is holding something using the gripper position.
2021
@@ -34,9 +35,7 @@ def __init__(self, robot: Robot, arm_designator: ArmDesignator, threshold_differ
3435
self.robot = robot
3536

3637
self.arm_designator = arm_designator
37-
3838
self.threshold_difference = threshold_difference
39-
self.minimum_position = minimum_position
4039
self.max_torque = max_torque
4140

4241
def execute(self, userdata=None) -> str:
@@ -51,7 +50,7 @@ def execute(self, userdata=None) -> str:
5150
if first_position is None:
5251
rospy.logerr("Cannot retrieve first position")
5352
return 'failed'
54-
elif first_position < self.minimum_position:
53+
elif first_position < arm.gripper_position_detector.min_position:
5554
rospy.logdebug("First position is {}".format(first_position))
5655
return 'cannot_determine'
5756

0 commit comments

Comments
 (0)