Hello ROS Developers!
In today’s video we are going to see what are ROS Topics and how they work.
Before we start, if you are new to ROS and want to Learn ROS Fast, I highly recommend you to take any of the following courses on Robot Ignite Academy:
We love feedback, so, whether you like the video or not, please leave a comment on the comments section below so that we can interact and learn from each other.
Step1. Create a project in Robot Ignite Academy(RIA)
We have the best online ROS course available in RIA. It helps you learn ROS in the easiest way without setting up ROS environment locally. The only thing you need is a browser! Create an account here and start to browse the trial course for free now! We’ll use the ROS Basics in 5 Days course as an example today.
Step2. What is a ROS topic
rqt_graph is a great tool to visualize the nodes and topics in the system. Run the command in a shell and open the graphical tool(you can find it by clicking the computer icon on the edge of the simulation). You should see the gazebo is publishing the joint state.
Then we run roslaunch publisher_example move.launch and examine the graph again. You should see that a new node called move_node pops out and publishing to the topic cmd_vel topic.
The last step is using rosrun tutorial subscriber.py command to subscribe the cmd_vel topic. You can see that another new node comes out with the name i_am_the_7th_robot. Actually you can launch as many subscribers as you want and subscribe to the same topic.
In conclusion, the topic is a way that the nodes communicate with each other.
Want to learn more?
If you are interested in this topic, please check our ROS Basics In 5 Days (Python) course. You’ll learn how to use publisher, subscriber, service, and action to control a robot.
Edit by: Tony Huang