Package rospy :: Package impl :: Module registration :: Class RegManager

Class RegManager

source code

          object --+    
                   |    
RegistrationListener --+
                       |
                      RegManager

Registration manager used by Node implemenation. Communicates with ROS Master to maintain topic registration information. Also responds to publisher updates to create topic connections

Instance Methods
 
__init__(self, handler)
ctor.
source code
 
start(self, uri, master_uri)
Start the RegManager.
source code
bool
is_registered(self)
Check if Node has been registered yet.
source code
 
run(self)
Main RegManager thread loop.
source code
 
cleanup(self, reason)
Cleans up registrations with master and releases topic and service resources
source code
 
reg_removed(self, resolved_name, data_type_or_uri, reg_type)
RegistrationListener callback
source code
 
reg_added(self, resolved_name, data_type_or_uri, reg_type)
RegistrationListener callback
source code
 
publisher_update(self, resolved_name, uris)
Inform psmanager of latest publisher list for a topic.
source code

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, handler)
(Constructor)

source code 

ctor.

Parameters:
  • handler - node API handler
Overrides: object.__init__

start(self, uri, master_uri)

source code 

Start the RegManager. This should be passed in as an argument to a thread starter as the RegManager is designed to spin in its own thread

Parameters:
  • uri (str) - URI of local node
  • master_uri (str) - Master URI

is_registered(self)

source code 

Check if Node has been registered yet.

Returns: bool
True if registration has occurred with master

run(self)

source code 

Main RegManager thread loop. Periodically checks the update queue and generates topic connections

cleanup(self, reason)

source code 

Cleans up registrations with master and releases topic and service resources

Parameters:
  • reason (str) - human-reasonable debug string

reg_removed(self, resolved_name, data_type_or_uri, reg_type)

source code 

RegistrationListener callback

Parameters:
  • resolved_name (str) - resolved name of topic or service
  • data_type_or_uri (str) - either the data type (for topic regs) or the service URI (for service regs).
  • reg_type (str) - Valid values are Registration.PUB, Registration.SUB, Registration.SRV
Overrides: RegistrationListener.reg_removed

reg_added(self, resolved_name, data_type_or_uri, reg_type)

source code 

RegistrationListener callback

Parameters:
  • resolved_name (str) - resolved name of topic or service
  • data_type_or_uri (str) - either the data type (for topic regs) or the service URI (for service regs).
  • reg_type (str) - Valid values are Registration.PUB, Registration.SUB, Registration.SRV
Overrides: RegistrationListener.reg_added

publisher_update(self, resolved_name, uris)

source code 

Inform psmanager of latest publisher list for a topic. This will cause RegManager to create a topic connection for all new publishers (in a separate thread).

Parameters:
  • resolved_name (str) - resolved topic name
  • uris ([str]) - list of all publishers uris for topic