def stop(self) -> bool: """Stops a currently running gripper move or grasp. Args: wait_for_result (bool): If True, this method will block until response is recieved from server. Returns: bool: Whether command was successful. """ goal = StopGoal() self._stop_action_client.send_goal(goal) return self._stop_action_client.wait_for_result(rospy.Duration(15.0))
def stop_action(self): """ Stops a currently running gripper move or grasp. :return: True if command was successful, False otherwise. :rtype: bool """ self._caller = "stop_action" goal = StopGoal() self._stop_action_client.send_goal(goal, done_cb=self._done_cb, active_cb=self._active_cb, feedback_cb=self._feedback_cb) result = self._stop_action_client.wait_for_result(rospy.Duration(15.)) return result
def _done_cb(status, result): rospy.loginfo("GripperInterface: '{}' complete. Result: \n\t{}".format( _caller, result)) if __name__ == '__main__': rospy.init_node("gripper_stop_node") _caller = "stop_gripper" stop_action_client = actionlib.SimpleActionClient( "/franka_ros_interface/franka_gripper/stop", StopAction) stop_action_client.wait_for_server() stop_action_client.send_goal(StopGoal(), done_cb=_done_cb, active_cb=_active_cb, feedback_cb=_feedback_cb) result = stop_action_client.wait_for_result(rospy.Duration(15.)) parser = argparse.ArgumentParser( "Stop current gripper action; Open or close gripper.") gripper_group = parser.add_mutually_exclusive_group(required=False) gripper_group.add_argument("-o", "--open", dest="open", action='store_true', default=False,