Add command to send messages on a topic with gz

#2951 Merged at 5a350c5
Repository
ocrave
Branch
gz_topic_publish
Repository
osrf
Branch
default
Author
  1. Olivier Crave
Reviewers
Description

This pull request adds a new command to gz topic to publish messages on a topic. It is quite similar to gz topic -r but works for general topics instead of ~/request.

Its prototype is: gz topic -p <topic_name> [-m <message>] [-f <file>]

Optional data can be sent with options -m <message> or -f <file> where message is a message to send and file is the path to a file containing the message to send.

Some command line examples:

To modify the temperature:

$ gz topic -p /gazebo/default/atmosphere -m temperature:300

The following works as well:

$ gz topic -p "~/atmosphere" -m temperature:300

To undo the last command:

$ gz topic -p /gazebo/default/undo_redo -m undo:true

To stop the server:

$ gz topic -p /gazebo/server/control -m stop:true

Comments (2)