#!/usr/bin/env python
import roslib; roslib.load_manifest('pr2_props_app')
import rospy
from std_srvs.srv import *

if __name__ == "__main__":
    names = ['pr2_props/high_five_left', 'pr2_props/high_five_double', 'pr2_props/pound_right', 'pr2_props/pound_double', 'pr2_props/low_five_right']
    functions = []
    
    rospy.init_node('pr2_prop_caller')
    
    for i in names:
        try:
            print "Wait for", i
            rospy.wait_for_service(i)
      	    functions.append(rospy.ServiceProxy(i, Empty))
        except rospy.ServiceException, e:
            print "Service call failed:", e
            print i
    
    while not rospy.is_shutdown():
        for i in functions:
            i()
            rospy.sleep(1.0)


