Public Member Functions | Private Attributes
rosbridge_library.internal.publishers.PublisherManager Class Reference

List of all members.

Public Member Functions

def __init__
def publish
def register
def unregister
def unregister_all

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 245 of file publishers.py.


Constructor & Destructor Documentation

Definition at line 254 of file publishers.py.


Member Function Documentation

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 324 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.

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.

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 315 of file publishers.py.


Member Data Documentation

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 Mon Oct 6 2014 06:58:09