save_model.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 articulation_models import track_utils
00010 from articulation_models.track_utils import *
00011 import StringIO
00012 import pickle;
00013 
00014 
00015 def main():
00016   rospy.init_node('model_prior_get')
00017   
00018   model_prior_get = rospy.ServiceProxy('model_prior_get', GetModelPriorSrv)
00019 
00020   request = GetModelPriorSrvRequest()
00021      
00022   try:            
00023     response = model_prior_get(request)
00024     print "got %d prior models, saving to file"%len(response.model)
00025     output = StringIO.StringIO()
00026     response.serialize(output)
00027     fh = open("prior.db", 'w')
00028     fh.write(output.getvalue())
00029     fh.close()
00030   except rospy.ServiceException: 
00031         print "failed to call service"
00032         pass
00033         
00034      
00035 
00036 if __name__ == '__main__':
00037   main()
00038 
00039 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


door_perception_old
Author(s): Felix Endres
autogenerated on Wed Dec 26 2012 15:56:10