show_grasps_client.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 import roslib; roslib.load_manifest('cob_grasp_generation')
00003 import rospy
00004 
00005 import actionlib
00006 import moveit_msgs.msg
00007 import cob_grasp_generation.msg 
00008 
00009 def show_grasps_client():
00010     client = actionlib.SimpleActionClient('show_grasps', cob_grasp_generation.msg.ShowGraspsAction)
00011     client.wait_for_server()
00012 
00013     object_name = raw_input("Insert object name: ")
00014     grasp_id = int(raw_input("Insert grasp_id: "))
00015 
00016     while not rospy.is_shutdown():
00017         print grasp_id
00018         
00019         # Set the goal here: object_name, grasp_id, sort-by-quality
00020         goal = cob_grasp_generation.msg.ShowGraspsGoal(object_name, grasp_id, True)
00021 
00022         client.send_goal(goal)
00023         client.wait_for_result()
00024         print client.get_result()
00025         
00026         raw_input("Enter for next grasp...")
00027         grasp_id = grasp_id + 1
00028     
00029     
00030 if __name__ == '__main__':
00031     try:
00032         rospy.init_node('show_grasp_client')
00033         result = show_grasps_client()
00034     except rospy.ROSInterruptException:
00035         print "program interrupted before completion"


cob_grasp_generation
Author(s): Witalij Siebert, Felix Messmer
autogenerated on Wed Aug 26 2015 11:01:25