[ROS in 5 mins] 041 – What is rqt_graph

Written by Ruben Alves

24/09/2018

In today’s video we’re going to see what is rqt_graph and how to use it.

Step 0. 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 in 5 Days unit 9  as an example today.

Step 1. rqt_graph

The rqt_graph is a debugging tool in ROS. To show how it works, we’ll create some node first. Please type the following command to create a publisher

rostopic pub /news std_msgs/String "data: 'Welcome to ROSCon 2018'" -r1 __name:=news_pub

This command will create a publisher node named new_pub which publishes the string type message: Welcome to ROSCon 2018 to the topic called /news.

Then we create a subscriber node named news_sub subscribes to the topic news

rostopic echo /news __name:=news_sub

You should see the subscriber prints out the message published by the news_pub node.

If you have some problem and you want to debug, then you can use the following tools:

rosnode list

This command prints out the name of all nodes.

You can see more detailed information with

rosnode info /news_sub

This command will show not only the name of the node but also the topic published of subscribed by this node.

The last one is

rqt_graph

This tool will plot the relationship between each node and the topics that they communicated with. In this example, if you’ve done correctly, you should see the /news_pub and /news_sub nodes and in between is the /news topic on the arrow.

Want to learn more?

If you are new to ROS, I highly recommend you to take any of the following courses on Robot Ignite Academy:

ROS Basics In 5 Days (Python) 
ROS Basics In 5 Days (C++)

 

We love feedback, so, whether you like the video or not, please share your thoughts on the comments section below.

Thanks for watching.

 

Edited by: Tony Huang

Masterclass 2023 batch2 blog banner

Check Out These Related Posts

129. ros2ai

129. ros2ai

I would like to dedicate this episode to all the ROS Developers who believe that ChatGPT or...

read more

0 Comments

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This