detect_graspable_objects.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 
00003 import roslib; roslib.load_manifest('tidyup_tools')
00004 import rospy
00005 import sys, traceback
00006 from tidyup_msgs import msg
00007 from tidyup_msgs import srv
00008 
00009 if __name__ == '__main__':
00010   try:
00011     rospy.init_node('detect_graspable_objects', anonymous=True)
00012     rospy.loginfo('detecting graspable objects.')
00013     detect_service = rospy.ServiceProxy('/tidyup/detect_objects', srv.DetectGraspableObjects)
00014     detect_service.wait_for_service()
00015     rospy.loginfo('connected to service.')
00016     request = srv.DetectGraspableObjectsRequest()
00017     request.static_object = 'test_table'
00018     response = detect_service.call(request)
00019     if not response.objects:
00020       rospy.loginfo('no objects in field of view.')
00021     else:
00022       rospy.loginfo('objects in field of view:')
00023       for object in response.objects:
00024         rospy.loginfo(' {0}'.format(object.name))
00025     rospy.loginfo('done.')
00026   except:
00027     traceback.print_exc(file=sys.stdout)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


tidyup_tools
Author(s): Andreas Hertle, Christian Dornhege
autogenerated on Wed Dec 26 2012 15:50:57