Understand Ros Topics
Understand Ros Topics
https://www.udemy.com/user/anis-koubaa/
Topic
53
1: Run the Master ROS Node
$ roscore
55
4: Provide Publisher Info
57
8: Message Transmission
■
Example
• Publisher
• Step 1. Determine a name for the topic to publish
• Step 2. Determine the type of the messages that the
topic will publish
• Step 3. Determine the frequency of topic publication
(how many message per second)
• Step 4. Create a publisher object with parameters chosen
• Step 5. Keep publishing the topic message at the selected
frequency
Practical Tips to Write Publisher and
Subscribers for ROS Topics
• Subscriber
• Step 1. Identify the name for the topic to listen to
• Step 2. Identify the type of the messages to be
received
• Step 3. Define a callback function that will be
automatically executed when a new message is received
on the topic
• Step 4. Start listening for the topic messages
• Step 5. Spin to listen for ever (in C++)