Skip to content

Commit 75ef7a9

Browse files
author
Hugo Boyer
committed
rewording
1 parent 59e7d82 commit 75ef7a9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

gazebojs_pubsub/tutorial.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@ Type in the following to publish a message:
5050
gazebo.publish('gazebo.msgs.WorldControl', '~/world_control', { pause: true});
5151
~~~
5252

53-
The arguments to publish are the message type, the topic name, and the message (in JSON format) . Once published, the message is going to be received by each subscriber for this topic.
54-
55-
56-
Subscribers provide a callback function for a specific type of message on a certain topic. Each time a new message is published by a publisher, the callback is invoked for every subscriber to this topic.
57-
58-
For example, this command displays the world_stats messages by subscribing to the `~/world_stats` topic with the `console.log` message, that prints the messages to the console. You can substitue `console.log` with any function that takes `(error, result)` as arguments.
53+
Type the following to subscribe to the `~/world_stats` topic and send the ouput to `console.log`.
5954

6055
~~~
6156
gazebo.subscribe('gazebo.msgs.WorldStatistics', '~/world_stats', console.log)
6257
~~~
6358

59+
60+
The arguments to publish are the message type, the topic name, and the message (in JSON format) . Once published, the message is going to be received by each subscriber for this topic.
61+
62+
63+
Subscribers provide a callback function for a specific type of message on a certain topic. Each time a new message is published by a publisher, the callback is invoked for every subscriber to this topic.
64+
6465
It is possible to unsubscribe to a topic. When `unsubscribe` is called, all subscriptions to that topic are removed.
6566

6667

0 commit comments

Comments
 (0)