Ark
Loading...
Searching...
No Matches
comm_handler.publisher.Publisher Class Reference

A Publisher class that extends the CommHandler base class. More...

Inheritance diagram for comm_handler.publisher.Publisher:
comm_handler.comm_handler.CommHandler

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
lcmThe LCM instance used for communication.
channel_nameThe name of the channel for publishing messages.
channel_typeThe type of message expected for the channel.

Member Function Documentation

◆ get_info()

comm_handler.publisher.Publisher.get_info ( self)

Return a dictionary describing this publisher.

Reimplemented from comm_handler.comm_handler.CommHandler.

◆ publish()

None comm_handler.publisher.Publisher.publish ( self,
object msg )

Publishes a message to the specified channel if the publisher is enabled.

Parameters
msgThe message object to publish. This should match the expected type for the channel.

◆ restart()

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.

◆ suspend()

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.

Member Data Documentation

◆ comm_type

str comm_handler.publisher.Publisher.comm_type = "Publisher"

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