Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 import roslib; roslib.load_manifest('srs_likelihood_calculation')
00015
00016 import sys
00017
00018 import rospy
00019 from srs_likelihood_calculation.srv import *
00020
00021 def likelihood_client(x, y):
00022 rospy.wait_for_service('likelihood')
00023 try:
00024 likelihood = rospy.ServiceProxy('likelihood', Likelihood)
00025 resp1 = likelihood(x, y)
00026 print "DEM wants to know likelihood for %s from %s"%(x,y)
00027 return resp1
00028 except rospy.ServiceException, e:
00029 print "Service call failed: %s"%e
00030
00031 def usage():
00032 return "%s [command candidates]"%sys.argv[0]
00033
00034 if __name__ == "__main__":
00035
00036
00037 x=raw_input("Please enter the consulting command end with Enter: \n")
00038
00039 y=raw_input("Please enter the candidates for the consulting command:the format is\n cadidate1 candidate2 candidate3 ...,\nend with Enter: \n")
00040
00041 print likelihood_client(x, y)
00042