Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 import roslib; roslib.load_manifest('rocon_gateway_demos')
00008 import rospy
00009 import gateway_msgs.srv
00010 from gateway_msgs.srv import ConnectHub
00011 import argparse
00012
00013 """
00014 Tests the ros service handle (/gateway/connect_hub) for connecting
00015 a gateway to a hub.
00016
00017 Usage:
00018 1 > roslaunch rocon_gateway_demos buccaneer_hub.launch
00019 2a> roslaunch rocon_gateway_demos buccaneer_gateway_ros_api.launch
00020 2b> rosrun rocon_gateway_demos connect_localhost.py
00021 """
00022
00023 if __name__ == '__main__':
00024
00025 parser = argparse.ArgumentParser(description='Make a connection to a localhost hub by service call')
00026
00027 rospy.init_node('connect_localhost')
00028
00029 connect = rospy.ServiceProxy('/gateway/connect_hub',ConnectHub)
00030
00031
00032 req = gateway_msgs.srv.ConnectHubRequest()
00033 req.uri = "http://localhost:6380"
00034 print ""
00035 print "== Request =="
00036 print ""
00037 print req
00038 print ""
00039 resp = connect(req)
00040 print "== Response =="
00041 print ""
00042 print resp
00043