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

Class LocalMaster

source code

rosgraph.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) 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
Method Details

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