def callback(message): # Loop until the node is killed with Ctrl-C # pub_string = "hello world %s"%rospy.get_time() # define here f(message), or a function on a message #floorToPixel = uv_out #pixelToFloor = xy #objectToPixel = uv_out2 #pixelToObject = xy2 size = GRID_SIZE intervalSize = 0.3048/3 homographies_out = homographies(floorX,floorY,objectX,objectY,size,intervalSize) #publish on many publishers related to this topic on arrival (if necessary) pub.publish(homographies_out) "otherpub.publish(message)" #assign globalvariables, we almost always need this #globalVar = function(message) global uv_out global uv_out2 global xy global xy2 "put more globalvar assignments here"
global objy floorx, floory, objx, objy, im = check_homography(np_image, H, nx, ny) cv2.imshow('Check Homography', im) # # Loop until the user presses a key key = -1 while key == -1: key = cv2.waitKey(10) raw_input('Press enter to continue: ') cv2.destroyAllWindows() r = rospy.Rate(.2) # 10hz while not rospy.is_shutdown(): #publish on all of my publishing topics # print "publishing" # print objy pub.publish(homographies(floorx, floory, objx, objy, GRID_SIZE, GRID_LENGTH)) r.sleep() except KeyboardInterrupt: print 'Keyboard Interrupt, exiting' break # Catch if anything went wrong with the Image Service except rospy.ServiceException, e: print "image_process: Service call failed: %s"%e # # When done, get rid of windows and start over