icp_test.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 """
00004  usage: %(progname)s <track_file1.txt> .. 
00005 """
00006 
00007 import roslib; roslib.load_manifest('articulation_models')
00008 import rospy
00009 from track_utils import *
00010 
00011 model_pub = rospy.Publisher('model', TrackMsg)
00012 data_pub = rospy.Publisher('data', TrackMsg)
00013 data_aligned_pub = rospy.Publisher('data_aligned', TrackMsg)
00014 
00015 def main():
00016   rospy.init_node('simple_publisher')
00017   
00018   icp_align = rospy.ServiceProxy('icp_align', AlignModelSrv)
00019 
00020   for id1,filename1 in enumerate(rospy.myargv()[1:]):
00021     for id2,filename2 in enumerate(rospy.myargv()[1:]):
00022       if id1 >= id2:
00023         continue
00024       track1 = readtrack(filename1)
00025       track2 = readtrack(filename2)
00026       
00027       print "calling service.."
00028       request = AlignModelSrvRequest()
00029       request.model.track = track1
00030       request.data.track = track2
00031       response = icp_align(request)
00032       
00033       rospy.sleep(0.05)
00034       request.model.track.header.frame_id="/"
00035       request.data.track.header.frame_id="/"
00036       response.data_aligned.track.header.frame_id="/"
00037       model_pub.publish(request.model.track)
00038       data_pub.publish(request.data.track)
00039       data_aligned_pub.publish(response.data_aligned.track)
00040       rospy.sleep(0.05)
00041 
00042 
00043 if __name__ == '__main__':
00044   main()
00045 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


icp
Author(s): Maintained by Juergen Sturm
autogenerated on Wed Dec 26 2012 15:34:47