Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 import sys
00010 import genpy
00011 from sr_hand.grasps_parser import GraspParser
00012 import sr_grasp
00013 from sr_robot_msgs.msg import GraspArray
00014
00015 parser = GraspParser()
00016 parser.parse_tree(xml_filename=sys.argv[1])
00017
00018 grasps = GraspArray()
00019 for name, g in parser.grasps.iteritems():
00020 ng = sr_grasp.Grasp()
00021 ng.id = name
00022 ng.set_grasp_point(positions=g.joints_and_positions)
00023 grasps.grasps.append(ng)
00024
00025
00026 print genpy.message.strify_message(grasps.grasps)