Skip to content

Commit

Permalink
usa only a single gripper interface
Browse files Browse the repository at this point in the history
  • Loading branch information
PetervDooren committed Apr 6, 2021
1 parent c828bf3 commit 5f17438
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/gripper_controller/gripper_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,20 @@ def __init__(self):
self.success = True

# server
self.srv_safe_joint_change_left = actionlib.SimpleActionServer('left_arm/gripper/action',
GripperCommandAction,
execute_cb=self.gripper_left,
auto_start=False)
self.srv_safe_joint_change_right = actionlib.SimpleActionServer('right_arm/gripper/action',
GripperCommandAction,
execute_cb=self.gripper_right,
auto_start=False)
self.srv_safe_joint_change_left.start()
self.srv_safe_joint_change_right.start()
self.srv_safe_joint_change = actionlib.SimpleActionServer('/hero/gripper/action',
GripperCommandAction,
execute_cb=self.gripper,
auto_start=False)
self.srv_safe_joint_change.start()

# clients
self.client_safe_joint_change = rospy.ServiceProxy('safe_pose_changer/change_joint', SafeJointChange)
self._grasp_client = actionlib.SimpleActionClient('gripper_controller/grasp', GripperApplyEffortAction)

def gripper_left(self, goal):
def gripper(self, goal):
self.success = self.safe_joint_change_srv(goal)
if self.success:
self.srv_safe_joint_change_left.set_succeeded()

def gripper_right(self, goal):
self.success = self.safe_joint_change_srv(goal)
if self.success:
self.srv_safe_joint_change_right.set_succeeded()
self.srv_safe_joint_change.set_succeeded()

def safe_joint_change_srv(self, goal):
"""
Expand Down

0 comments on commit 5f17438

Please sign in to comment.