Public Member Functions | Public Attributes
rosbridge_library.internal.subscribers.MultiSubscriber Class Reference

List of all members.

Public Member Functions

def __init__
def callback
def has_subscribers
def subscribe
def unregister
def unsubscribe
def verify_type

Public Attributes

 lock
 msg_class
 subscriber
 subscriptions
 topic

Detailed Description

Handles multiple clients for a single subscriber.

Converts msgs to JSON before handing them to callbacks.  Due to subscriber
callbacks being called in separate threads, must lock whenever modifying
or accessing the subscribed clients. 

Definition at line 46 of file subscribers.py.


Constructor & Destructor Documentation

def rosbridge_library.internal.subscribers.MultiSubscriber.__init__ (   self,
  topic,
  msg_type = None 
)
Register a subscriber on the specified topic.

Keyword arguments:
topic    -- the name of the topic to register the subscriber on
msg_type -- (optional) the type to register the subscriber as.  If not
provided, an attempt will be made to infer the topic type

Throws:
TopicNotEstablishedException -- if no msg_type was specified by the
caller and the topic is not yet established, so a topic type cannot
be inferred
TypeConflictException        -- if the msg_type was specified by the
caller and the topic is established, and the established type is
different to the user-specified msg_type

Definition at line 53 of file subscribers.py.


Member Function Documentation

def rosbridge_library.internal.subscribers.MultiSubscriber.callback (   self,
  msg,
  callbacks = None 
)
Callback for incoming messages on the rospy.Subscriber

Converts the incoming msg to JSON, then passes the JSON to the
registered subscriber callbacks.

Keyword Arguments:
msg - the ROS message coming from the subscriber
callbacks - subscriber callbacks to invoke

Definition at line 149 of file subscribers.py.

Return true if there are subscribers 

Definition at line 143 of file subscribers.py.

def rosbridge_library.internal.subscribers.MultiSubscriber.subscribe (   self,
  client_id,
  callback 
)
Subscribe the specified client to this subscriber.

Keyword arguments:
client_id -- the ID of the client subscribing
callback  -- this client's callback, that will be called for incoming
messages

Definition at line 117 of file subscribers.py.

Definition at line 95 of file subscribers.py.

Unsubscribe the specified client from this subscriber

Keyword arguments:
client_id -- the ID of the client to unsubscribe

Definition at line 133 of file subscribers.py.

Verify that the subscriber subscribes to messages of this type.

Keyword arguments:
msg_type -- the type to check this subscriber against

Throws:
Exception -- if ros_loader cannot load the specified msg type
TypeConflictException -- if the msg_type is different than the type of
this publisher

Definition at line 100 of file subscribers.py.


Member Data Documentation

Definition at line 68 of file subscribers.py.

Definition at line 68 of file subscribers.py.

Definition at line 68 of file subscribers.py.

Definition at line 68 of file subscribers.py.

Definition at line 68 of file subscribers.py.


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


rosbridge_library
Author(s): Jonathan Mace
autogenerated on Thu Jan 2 2014 11:53:35