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.
Method | __init__ |
Register a subscriber on the specified topic. |
Method | callback |
Callback for incoming messages on the rospy.Subscriber |
Method | has |
Return true if there are subscribers |
Method | subscribe |
Subscribe the specified client to this subscriber. |
Method | unregister |
Undocumented |
Method | unsubscribe |
Unsubscribe the specified client from this subscriber |
Method | verify |
Verify that the subscriber subscribes to messages of this type. |
Instance Variable | lock |
Undocumented |
Instance Variable | msg |
Undocumented |
Instance Variable | subscriber |
Undocumented |
Instance Variable | subscriptions |
Undocumented |
Instance Variable | topic |
Undocumented |
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
Callback for incoming messages on the rospy.Subscriber
Passes the message to registered subscriber callbacks.
Keyword Arguments: msg - the ROS message coming from the subscriber callbacks - subscriber callbacks to invoke
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
Unsubscribe the specified client from this subscriber
Keyword arguments: client_id -- the ID of the client to unsubscribe