|
| Callable[[Blackboard, Any], str] | _monitor_handler = monitor_handler |
| | Function to handle incoming messages.
|
| |
| Event | _msg_event = Event() |
| | Event for message reception.
|
| |
| int | _timeout = timeout |
| | Timeout in seconds for message reception.
|
| |
| Node | _node = node |
| | Shared pointer to the ROS 2 node.
|
| |
| str | _topic_name = topic_name |
| | Name of the topic to monitor.
|
| |
| Subscription | _sub = None |
| | Subscription to the ROS 2 topic.
|
| |
| Type | _msg_type = msg_type |
| |
| Union[QoSProfile, int] | _qos = qos |
| |
| CallbackGroup | _callback_group = callback_group |
| |
| int | _maximum_retry = maximum_retry |
| | Subscription to the ROS 2 topic.
|
| |
Template class to monitor a ROS 2 topic and process incoming messages.
This class provides functionality to subscribe to a ROS 2 topic,
execute a custom monitoring handler, and return specific outcomes
based on the messages received.
Attributes:
_node (Node): Shared pointer to the ROS 2 node.
_sub (Subscription): Subscription to the ROS 2 topic.
_monitor_handler (Callable[[Blackboard, Any], str]): Function to handle incoming messages.
_topic_name (str): Name of the topic to monitor.
msg_list (List[Any]): List to store queued messages.
msg_queue (int): Maximum number of messages to queue.
_timeout (int): Timeout in seconds for message reception.
_maximum_retry (int): Maximum number of retries.
_msg_event (Event): Event for message reception.
| None yasmin_ros.monitor_state.MonitorState.__init__ |
( |
| self, |
|
|
Type | msg_type, |
|
|
str | topic_name, |
|
|
Set[str] | outcomes, |
|
|
Callable | monitor_handler, |
|
|
Union[QoSProfile, int] | qos = 10, |
|
|
CallbackGroup | callback_group = None, |
|
|
int | msg_queue = 10, |
|
|
Node | node = None, |
|
|
int | timeout = None, |
|
|
int | maximum_retry = 3 ) |
Construct a new MonitorState with specific QoS, message queue, and timeout.
Args:
msg_type (Type): The type of message to be monitored.
topic_name (str): The name of the topic to monitor.
outcomes (Set[str]): A set of possible outcomes for this state.
monitor_handler (Callable[[Blackboard, Any], str]): A callback handler to process incoming messages.
qos (Union[QoSProfile, int], optional): Quality of Service settings for the topic.
callback_group (CallbackGroup, optional): The callback group for the subscription.
msg_queue (int, optional): The maximum number of messages to queue.
node (Node, optional): The ROS 2 node to use. If None, a default node is created.
timeout (int, optional): The time in seconds to wait for messages before timing out.
maximum_retry (int, optional): Maximum retries of the monitor if it returns timeout. Default is 3.