|
Ark
|
A Publisher class that extends the CommHandler base class. More...
Public Member Functions | |
| None | __init__ (self, LCM lcm, str channel_name, type channel_type) |
| Initializes the Publisher instance with the LCM instance, channel name, and message type. | |
| None | publish (self, object msg) |
| Publishes a message to the specified channel if the publisher is enabled. | |
| None | restart (self) |
| Restarts the publisher by enabling it again and logging the action. | |
| None | suspend (self) |
| Shuts down the publisher by disabling it and logging the shutdown action. | |
| get_info (self) | |
| Return a dictionary describing this publisher. | |
| Public Member Functions inherited from comm_handler.comm_handler.CommHandler | |
| __init__ (self, LCM lcm, str channel_name, type channel_type) | |
| Initializes the communication handler with an LCM instance, a channel name, and a channel type. | |
| str | __repr__ (self) |
| Returns a string representation of the communication handler, showing the channel name and the type of message it handles. | |
Public Attributes | |
| str | comm_type = "Publisher" |
| Public Attributes inherited from comm_handler.comm_handler.CommHandler | |
| str | channel_name = channel_name |
| type | channel_type = channel_type |
| bool | active = True |
Additional Inherited Members | |
| Protected Attributes inherited from comm_handler.comm_handler.CommHandler | |
| LCM | _lcm = lcm |
| Initializes the communication handler with an LCM instance, a channel name, and a channel type. | |
A Publisher class that extends the CommHandler base class.
This class handles the publishing of messages to a specified communication channel using LCM.
Attributes: _enabled (bool): A flag indicating whether the publisher is enabled.
| None comm_handler.publisher.Publisher.__init__ | ( | self, | |
| LCM | lcm, | ||
| str | channel_name, | ||
| type | channel_type ) |
Initializes the Publisher instance with the LCM instance, channel name, and message type.
Also sets the publisher as enabled and logs the setup.
| lcm | The LCM instance used for communication. |
| channel_name | The name of the channel for publishing messages. |
| channel_type | The type of message expected for the channel. |
| comm_handler.publisher.Publisher.get_info | ( | self | ) |
Return a dictionary describing this publisher.
Reimplemented from comm_handler.comm_handler.CommHandler.
| None comm_handler.publisher.Publisher.publish | ( | self, | |
| object | msg ) |
Publishes a message to the specified channel if the publisher is enabled.
| msg | The message object to publish. This should match the expected type for the channel. |
| None comm_handler.publisher.Publisher.restart | ( | self | ) |
Restarts the publisher by enabling it again and logging the action.
Reimplemented from comm_handler.comm_handler.CommHandler.
| None comm_handler.publisher.Publisher.suspend | ( | self | ) |
Shuts down the publisher by disabling it and logging the shutdown action.
Reimplemented from comm_handler.comm_handler.CommHandler.
| str comm_handler.publisher.Publisher.comm_type = "Publisher" |