예제 #1
0
def attach():
	'''
	Purpose:
	---
	This function is used to activate gripper and if the box gets attached with drone it checks value of result and change the global variable grip_res=1

	Input Arguments:
	---
	None

	Returns:
	---
	None
	'''

	req = 0
	resp = 0
	activate = 0
	rospy.wait_for_service('/edrone/activate_gripper')
	activate = rospy.ServiceProxy('/edrone/activate_gripper', Gripper)
	req = GripperRequest(True)
	resp = activate(req)
	GripperResponse(resp)
	global grip_res
	if(req.activate_gripper == True and resp.result == True):
	   	grip_res = 1
예제 #2
0
def dettach():
	'''
	Purpose:
	---
	This function is used to deactivate gripper and dettached box with drone

	Input Arguments:
	---
	None

	Returns:
	---
	None
	'''

	req = 0
	resp = 0
	activate = 0
	rospy.wait_for_service('/edrone/activate_gripper')
	activate = rospy.ServiceProxy('/edrone/activate_gripper', Gripper)
	req = GripperRequest(False)
	resp = activate(req)
	GripperResponse(resp)
 def activate_gripper(self, shall_i):
     rospy.wait_for_service('/edrone/activate_gripper')
     act_gripper = rospy.ServiceProxy('/edrone/activate_gripper', Gripper)
     req = GripperRequest(shall_i)
     resp = act_gripper(req)