scripts/stitch_loop.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import time
3 import rospy
4 
5 from std_srvs.srv import Empty
6 
7 if __name__ == '__main__':
8  rospy.init_node('stitch_loop')
9  rospy.wait_for_service('/hugin_panorama/image_saver1/save')
10  rospy.wait_for_service('/hugin_panorama/image_saver2/save')
11  rospy.wait_for_service('/hugin_panorama/stitch')
12  rospy.wait_for_service('/hugin_panorama/reset')
13  save_image1 = rospy.ServiceProxy('/hugin_panorama/image_saver1/save', Empty)
14  save_image2 = rospy.ServiceProxy('/hugin_panorama/image_saver2/save', Empty)
15  stitch = rospy.ServiceProxy('/hugin_panorama/stitch', Empty)
16  reset = rospy.ServiceProxy('/hugin_panorama/reset', Empty)
17 
18  while not rospy.is_shutdown():
19  rospy.loginfo("Clearing previous panorama files")
20  reset()
21  rospy.loginfo("Saving image from camera #1")
22  save_image1()
23  rospy.loginfo("Saving image from camera #2")
24  save_image2()
25  time.sleep(1) # wait for image files to be written to disk
26  rospy.loginfo("Stitching panorama...")
27  stitch()
28  rospy.loginfo("Done. Looping...")


hugin_panorama
Author(s): Daniel Snider
autogenerated on Mon Jun 10 2019 13:37:30