Package rocon_utilities :: Module ros_utilities :: Class SubscriberProxy
[frames] | no frames]

Class SubscriberProxy

source code

Works like a service proxy, but using a subscriber instead.

Instance Methods
 
__init__(self, topic, msg_type) source code
 
__call__(self, timeout=None)
Returns immediately with the latest data or waits for incoming data.
source code
 
wait_for_next(self, timeout=None)
Makes sure any current data is cleared and waits for new data.
source code
 
wait_for_publishers(self)
Blocks until publishers are seen.
source code
Method Details

__init__(self, topic, msg_type)
(Constructor)

source code 
Parameters:
  • topic - the topic name to subscriber to @type str
  • msg_type - any ros message type (typical arg for the subscriber) @type msg
  • timeout - timeout on the wait operation (None = /infty) @type rospy.Duration() @return msg type data or None

__call__(self, timeout=None)
(Call operator)

source code 

Returns immediately with the latest data or waits for incoming data.

Parameters:
  • timeout - time to wait for data, polling at 10Hz. @type rospy.Duration @return latest data or None

wait_for_publishers(self)

source code 

Blocks until publishers are seen.

@raise rospy.exceptions.ROSInterruptException if we are in shutdown.