Python YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
yasmin_demos.publisher_demo.PublishIntState Class Reference
Inheritance diagram for yasmin_demos.publisher_demo.PublishIntState:
Collaboration diagram for yasmin_demos.publisher_demo.PublishIntState:

Public Member Functions

 __init__ (self)
Int32 create_int_msg (self, Blackboard blackboard)
Public Member Functions inherited from yasmin_ros.publisher_state.PublisherState
None __init__ (self, Type msg_type, str topic_name, Callable create_message_handler, Union[QoSProfile, int] qos=10, CallbackGroup callback_group=None, Node node=None)
str execute (self, Blackboard blackboard)

Public Attributes

 create_int_msg

Additional Inherited Members

Protected Attributes inherited from yasmin_ros.publisher_state.PublisherState
Callable[[Blackboard], Any] _create_message_handler = create_message_handler
 Callback handler to create messages.
Node _node = node
 Shared pointer to the ROS 2 node.
str _topic_name = topic_name
 Name of the topic to publish to.
Publisher _pub
 Publisher to the ROS 2 topic.

Detailed Description

PublishIntState is a YASMIN ROS publisher state that sends incrementing integers
to the 'count' topic using std_msgs.msg.Int32 messages.

This state increments a counter on the blackboard and publishes it.

Constructor & Destructor Documentation

◆ __init__()

yasmin_demos.publisher_demo.PublishIntState.__init__ ( self)
Initializes the PublishIntState with the topic 'count' and a message creation callback.

Member Function Documentation

◆ create_int_msg()

Int32 yasmin_demos.publisher_demo.PublishIntState.create_int_msg ( self,
Blackboard blackboard )
Generates a std_msgs.msg.Int32 message with an incremented counter value.

Args:
    blackboard (Blackboard): The shared data store between states.

Returns:
    Int32: A ROS message containing the updated counter.

Member Data Documentation

◆ create_int_msg

yasmin_demos.publisher_demo.PublishIntState.create_int_msg

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