gateways.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #       
00003 # License: BSD
00004 #   https://raw.github.com/robotics-in-concert/rocon_multimaster/master/rocon_gateway_tutorials/LICENSE 
00005 #
00006 
00007 ##############################################################################
00008 # Imports
00009 ##############################################################################
00010 
00011 import roslib; roslib.load_manifest('rocon_gateway_tutorials')
00012 import rospy
00013 import rocon_gateway
00014 from gateway_msgs.srv import *
00015 
00016 ##############################################################################
00017 # Functions
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 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


rocon_gateway_tutorials
Author(s): Daniel Stonier
autogenerated on Tue Jan 15 2013 17:43:42