Package smach_ros :: Module monitor_state :: Class MonitorState

Class MonitorState

source code


A state that will check a given ROS topic with a condition function.

Instance Methods
 
__init__(self, topic, msg_type, cond_cb, max_checks=-1, input_keys=[], output_keys=[])
State constructor @type topic string @param topic the topic to monitor
source code
 
execute(self, ud) source code
 
request_preempt(self) source code
Method Details

__init__(self, topic, msg_type, cond_cb, max_checks=-1, input_keys=[], output_keys=[])
(Constructor)

source code 
State constructor
@type topic string
@param topic the topic to monitor

@type msg_type a ROS message type
@param msg_type determines the type of the monitored topic

@type max_checks int
@param max_checks the number of messages to receive and evaluate. If cond_cb returns False for any
       of them, the state will finish with outcome 'invalid'. If cond_cb returns True for 
       all of them, the outcome will be 'valid'