ros2publisher
Description
Use the ros2publisher object to publish messages on a topic. When messages are published on that topic, ROS 2 nodes that subscribe to that topic receive those messages directly.
Creation
Syntax
Description
creates a publisher, pub
= ros2publisher(node
,topic
)pub
, for a topic with name
topic
that already exists on the ROS 2 network.
node
is the ros2node
object handle to which the
publisher should attach. The publisher gets the topic message type from the network topic
list.
Note
The topic must be on the network topic list.
specifies additional options using one or more name-value pair arguments. Specify
name-value pair arguments after all other input arguments.pub
= ros2publisher(___,Name,Value
)
[
returns a message, pub
,msg
]
= ros2publisher(___)msg
, that you can send with the publisher,
pub
. The message is initialized with default values. You can also
get the ROS message using the ros2message
function.
Input Arguments
Properties
Object Functions
ros2message | Create ROS 2 message structures |
send | Publish ROS 2 message to topic |
Examples
Extended Capabilities
Version History
Introduced in R2019b