docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)