Go to the documentation of this file.00001
00002
00003 import roslib; roslib.load_manifest('srs_decision_making')
00004 import rospy
00005 import sys
00006
00007 import actionlib
00008
00009 import srs_decision_making.msg as xmsg
00010
00011 def DM_client(json_parameters):
00012 client = actionlib.SimpleActionClient('srs_decision_making_actions', xmsg.ExecutionAction)
00013
00014 client.wait_for_server()
00015
00016
00017 _goal=xmsg.ExecutionGoal()
00018
00019
00020
00021
00022 _goal.json_parameters = json_parameters
00023
00024 client.send_goal(_goal)
00025
00026
00027 client.wait_for_result()
00028
00029
00030 return client.get_result()
00031
00032 if __name__ == '__main__':
00033 try:
00034
00035
00036
00037 json_parameters = '{"tasks":[{"time_schedule":1263798000000,"task":"get","deliver_destination":{"pose2d":{"theta":0.0,"y":0.0,"x":0.0}},"object":{"object_type":"Milkbox"}}],"initializer":{"device_type":"ui_loc","device_id":"ui_loc_0001"}}'
00038
00039 rospy.init_node('dm_client2')
00040 result = DM_client(json_parameters)
00041 rospy.loginfo('result %s',result)
00042
00043 except rospy.ROSInterruptException:
00044 print "program interrupted before completion"