Class PublisherFactory

java.lang.Object
org.ros.internal.node.topic.PublisherFactory

public class PublisherFactory extends Object
A factory for Publisher instances.
Author:
damonkohler@google.com (Damon Kohler)
  • Constructor Details

  • Method Details

    • newOrExisting

      public <T> Publisher<T> newOrExisting(TopicDeclaration topicDeclaration, org.ros.message.MessageSerializer<T> messageSerializer)
      Gets or creates a Publisher instance. Publishers are cached and reused per topic. When a new Publisher is generated, it is registered with the master.
      Type Parameters:
      T - the message type associated with the Publisher
      Parameters:
      topicDeclaration - TopicDeclaration that is being published
      messageSerializer - the MessageSerializer used for published messages
      Returns:
      a new or cached Publisher instance