Interface IPublisher
Sends IMessage payloads on a named topic.
Namespace: Unity.SimulationPro.Foundation
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
public interface IPublisher
Remarks
Obtain an IPublisher by calling RegisterPublisher<T>(string) on an active connector.
Properties
MessageTypeId
Gets the ROS message type identifier associated with this publisher.
Declaration
MessageTypeId MessageTypeId { get; }
Property Value
| Type | Description |
|---|---|
| MessageTypeId |
Topic
Gets the topic name this publisher sends messages to.
Declaration
string Topic { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Publish(IMessage)
Sends a message on the publisher's topic.
Declaration
void Publish(IMessage msg)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessage | msg | The message to publish. |
SetMessagePool(IMessagePool)
Attaches a message pool to this publisher to reduce garbage collection pressure.
Declaration
void SetMessagePool(IMessagePool messagePool)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessagePool | messagePool | The pool to use for message allocation. |