ROS v0.1.0 ROS.Publisher View Source

A ROS Publisher is a sender in asynchronous, one-to-many communication.

ROS Publishers are best modeled by OTP Dynamic Supervisors. Dynamic Supervisors allow spawning of child processes on demand, which is perfect because a ROS Subscriber node can connect to any publisher on demand (depending on when it is spun up).

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Publish a message from a publisher

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function publish(publisher, message) View Source
publish(atom(), struct()) :: [:ok]

Publish a message from a publisher.

This is asynchronous. A list of :ok atoms will be received, one for each TCP connection to the publisher.

Examples

iex> ROS.Publisher.publish(:mypub, %StdMsgs.String{data: "hello!"})
[:ok]