stitch_client.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 import roslib; roslib.load_manifest('pano_ros')
00003 import rospy
00004 
00005 import actionlib
00006 import sys
00007 
00008 from pano_ros.msg import *
00009 
00010 def stitch_client(bag_file_name,stich_file_name):   
00011     stich_goal = StitchGoal(bag_file_name=bag_file_name, stitch_file_name=stich_file_name)
00012     client = actionlib.SimpleActionClient('bag_stitcher/stitch', StitchAction)
00013     client.wait_for_server()
00014     client.send_goal(stich_goal)
00015     client.wait_for_result()
00016     return client.get_result()
00017     
00018 def usage():
00019     return "stitch_client.py pano.bag stitch.jpg"
00020 if __name__ == '__main__':
00021     try:
00022         bag_file = ""
00023         stitch_file = ""
00024         
00025         if len(sys.argv) == 3:
00026             bag_file = sys.argv[1]
00027             stitch_file = sys.argv[2]
00028         else:
00029             print usage()
00030             sys.exit(1)
00031         # Initializes a rospy node so that the SimpleActionClient can
00032         # publish and subscribe over ROS.
00033         rospy.init_node('stitch_client')
00034         result = stitch_client(bag_file,stitch_file)
00035         print "stitch result:%d" % (result.result_flags)
00036     except rospy.ROSInterruptException:
00037         print "program interrupted before completion"
00038 


pano_ros
Author(s): Ethan Rublee, Ken Conley
autogenerated on Mon Oct 6 2014 08:06:11