Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 import roslib; roslib.load_manifest('rocon_gateway_demos')
00012 import rospy
00013 import rocon_gateway
00014 from gateway_msgs.srv import *
00015
00016
00017
00018
00019
00020 def findFirstRemoteGateway():
00021 '''
00022 Parses the remote gateway list to find a gateway to use for testing.
00023
00024 It's a dumb hack to make testing quite convenient.
00025
00026 @return gateway string name
00027 @rtype string
00028 '''
00029 remote_gateway_info = rospy.ServiceProxy('/gateway/remote_gateway_info',RemoteGatewayInfo)
00030 req = RemoteGatewayInfoRequest()
00031 req.gateways = []
00032 resp = remote_gateway_info(req)
00033 if len(resp.gateways) == 0:
00034 raise rocon_gateway.GatewayError("no remote gateways available")
00035 else:
00036 return resp.gateways[0].name
00037