Package rocon_gateway :: Module master_api :: Class LocalMaster
[frames] | no frames]

Class LocalMaster

source code

               object --+    
                        |    
rosgraph.masterapi.Master --+
                            |
                           LocalMaster

Representing a ros master (local ros master). Just contains a few utility methods for retrieving master related information as well as handles for registering and unregistering rules that have been pulled or flipped in from another gateway.

Instance Methods
 
__init__(self)
:param caller_id: name of node to use in calls to master, ``str`` :param master_uri: (optional) override default ROS master URI, ``str`` :raises: :exc:`ValueError` If ROS master uri not set properly
source code
 
register(self, registration)
Registers a rule with the local master.
source code
 
unregister(self, registration)
Unregisters a rule with the local master.
source code
 
generate_connection_details(self, connection_type, name, node)
Creates all the extra details to create a connection object from a rule.
source code
 
generate_advertisement_connection_details(self, connection_type, name, node)
Creates all the extra details to create a connection object from an advertisement rule.
source code
 
get_ros_ip(self) source code
 
get_connection_state(self) source code
 
find_gateway_namespace(self)
Assists a script to find the (hopefully) unique gateway namespace.
source code

Inherited from rosgraph.masterapi.Master: deleteParam, getParam, getParamNames, getPid, getPublishedTopics, getSystemState, getTopicTypes, getUri, hasParam, is_online, lookupNode, lookupService, registerPublisher, registerService, registerSubscriber, searchParam, setParam, subscribeParam, unregisterPublisher, unregisterService, unregisterSubscriber, unsubscribeParam

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

:param caller_id: name of node to use in calls to master, ``str`` :param master_uri: (optional) override default ROS master URI, ``str`` :raises: :exc:`ValueError` If ROS master uri not set properly

Overrides: object.__init__
(inherited documentation)

register(self, registration)

source code 

Registers a rule with the local master.

Parameters:
  • registration - registration details @type utils.Registration

    @return the updated registration object (only adds an anonymously generated local node name) @rtype utils.Registration

unregister(self, registration)

source code 

Unregisters a rule with the local master.

Parameters:
  • registration - registration details for an existing gateway registered rule @type utils.Registration

generate_connection_details(self, connection_type, name, node)

source code 

Creates all the extra details to create a connection object from a rule.

Parameters:
  • connection_type - the connection type (one of gateway_msgs.msg.ConnectionType) @type string
  • name - the name of the connection @type string
  • node - the master node name it comes from @param string

    @return the utils.Connection object complete with type_info and xmlrpc_uri @type utils.Connection

generate_advertisement_connection_details(self, connection_type, name, node)

source code 

Creates all the extra details to create a connection object from an advertisement rule. This is a bit different to the previous one - we just need the type and single node uri that everything originates from (don't need to generate all the pub/sub connections themselves.

Probably flips could be merged into this sometime, but it'd be a bit gnarly.

Parameters:
  • connection_type - the connection type (one of gateway_msgs.msg.ConnectionType) @type string
  • name - the name of the connection @type string
  • node - the master node name it comes from @param string

    @return the utils.Connection object complete with type_info and xmlrpc_uri @type utils.Connection

find_gateway_namespace(self)

source code 

Assists a script to find the (hopefully) unique gateway namespace. Note that unique is a necessary condition, there should only be one gateway per ros system.

@return Namespace of the gateway node. @rtype string