[ros-users] [Discourse.ros.org] [Next Generation ROS] Unable to publish from command line

Mikael Arguedas ros.discourse at gmail.com
Mon Sep 18 04:44:00 UTC 2017



Did you try passing a yaml dictionnary as the help message suggests?
`ros2 topic pub /test_topic std_msgs/String "data: Hello World"`

Copied from:
```$ ros2 topic pub --help
usage: ros2 topic pub [-h] topic_name message_type [values]

Publish a message to a topic

positional arguments:
  topic_name    Name of the ROS topic to publish to (e.g. '/chatter')
  message_type  Type of the ROS message (e.g. 'std_msgs/String')
  values        Values to fill the message with in YAML format (e.g. "data:
                Hello World"), otherwise the message will be published with
                default values
```





---
[Visit Topic](https://discourse.ros.org/t/unable-to-publish-from-command-line/2640/7) or reply to this email to respond.




More information about the ros-users mailing list