12 from std_msgs.msg
import Float64
13 from control_msgs.msg
import (
21 self.
_goal = GripperCommandGoal()
24 self._client.wait_for_server(rospy.Duration(10.0))
25 if not self._client.wait_for_server(rospy.Duration(10.0)):
26 rospy.logerr(
"Exiting - Gripper Action Server Not Found.")
27 rospy.signal_shutdown(
"Action Server not found.")
32 self._goal.command.position = position
33 self._goal.command.max_effort = effort
37 print(
"feedback callback")
41 self._client.cancel_goal()
43 def wait(self, timeout=0.1 ):
44 self._client.wait_for_result(timeout=rospy.Duration(timeout))
45 return self._client.get_result()
48 self.
_goal = GripperCommandGoal()
51 rospy.init_node(
"gipper_action_client")
55 print(
"Open Gripper.")
57 gc.command(math.radians(gripper),1.0)
64 print(
"Close Gripper.")
66 gc.command(math.radians(gripper),1.0)
71 if __name__ ==
"__main__":
def wait(self, timeout=0.1)
def command(self, position, effort)