Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
rosbridge_library.internal.publishers.PublisherManager Class Reference

Public Member Functions

def __init__ (self)
 
def publish (self, client_id, topic, msg, latch=False, queue_size=100)
 
def register (self, client_id, topic, msg_type=None, latch=False, queue_size=100)
 
def unregister (self, client_id, topic)
 
def unregister_all (self, client_id)
 

Public Attributes

 unregister_timeout
 
 unregister_timers
 

Private Member Functions

def _unregister_impl (self, topic)
 

Private Attributes

 _publishers
 

Detailed Description

The PublisherManager keeps track of ROS publishers

It maintains a MultiPublisher instance for each registered topic

When unregistering a client, if there are no more clients for a publisher,
then that publisher is unregistered from the ROS Master

Definition at line 243 of file publishers.py.

Constructor & Destructor Documentation

def rosbridge_library.internal.publishers.PublisherManager.__init__ (   self)

Definition at line 252 of file publishers.py.

Member Function Documentation

def rosbridge_library.internal.publishers.PublisherManager._unregister_impl (   self,
  topic 
)
private

Definition at line 319 of file publishers.py.

def rosbridge_library.internal.publishers.PublisherManager.publish (   self,
  client_id,
  topic,
  msg,
  latch = False,
  queue_size = 100 
)
Publish a message on the given topic.

Tries to create a publisher on the topic if one does not already exist.

Keyword arguments:
client_id -- the ID of the client making this request
topic     -- the topic to publish the message on
msg       -- a JSON-like dict of fields and values
latch     -- (optional) whether to make this publisher latched
queue_size -- (optional) rospy publisher queue_size to use

Throws:
Exception -- a variety of exceptions are propagated.  They can be
thrown if there is a problem setting up or getting the publisher,
or if the provided msg does not map to the msg class of the publisher.

Definition at line 334 of file publishers.py.

def rosbridge_library.internal.publishers.PublisherManager.register (   self,
  client_id,
  topic,
  msg_type = None,
  latch = False,
  queue_size = 100 
)
Register a publisher on the specified topic.

Publishers are shared between clients, so a single MultiPublisher
instance is created per topic, even if multiple clients register.

Keyword arguments:
client_id  -- the ID of the client making this request
topic      -- the name of the topic to publish on
msg_type   -- (optional) the type to publish
latch      -- (optional) whether to make this publisher latched
queue_size -- (optional) rospy publisher queue_size to use

Throws:
Exception -- exceptions are propagated from the MultiPublisher if
there is a problem loading the specified msg class or establishing
the publisher

Definition at line 257 of file publishers.py.

def rosbridge_library.internal.publishers.PublisherManager.unregister (   self,
  client_id,
  topic 
)
Unregister a client from the publisher for the given topic.
    Will wait some time before actually unregistering, it is done in
    _unregister_impl

If there are no clients remaining for that publisher, then the
publisher is unregistered from the ROS Master

Keyword arguments:
client_id -- the ID of the client making this request
topic     -- the topic to unregister the publisher for

Definition at line 295 of file publishers.py.

def rosbridge_library.internal.publishers.PublisherManager.unregister_all (   self,
  client_id 
)
Unregisters a client from all publishers that they are registered
to.

Keyword arguments:
client_id -- the ID of the client making this request 

Definition at line 325 of file publishers.py.

Member Data Documentation

rosbridge_library.internal.publishers.PublisherManager._publishers
private

Definition at line 253 of file publishers.py.

rosbridge_library.internal.publishers.PublisherManager.unregister_timeout

Definition at line 255 of file publishers.py.

rosbridge_library.internal.publishers.PublisherManager.unregister_timers

Definition at line 254 of file publishers.py.


The documentation for this class was generated from the following file:


rosbridge_library
Author(s): Jonathan Mace
autogenerated on Wed Jun 3 2020 03:55:14