{"id":649,"date":"2019-07-08T15:14:55","date_gmt":"2019-07-08T15:14:55","guid":{"rendered":"https:\/\/roboticsbackend.com\/?p=649"},"modified":"2021-09-28T20:21:38","modified_gmt":"2021-09-28T20:21:38","slug":"rqt-plot-easily-debug-ros-topics","status":"publish","type":"post","link":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/","title":{"rendered":"rqt plot &#8211; Easily Debug ROS topics"},"content":{"rendered":"<p>In this tutorial I\u2019ll show you what is ROS rqt plot and how to use it efficiently, through some examples.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69fc73641761d\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69fc73641761d\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#What_is_rqt_plot_and_what_to_do_with_it\" >What is rqt plot and what to do with it<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#Install_rqt_plot\" >Install rqt plot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#Launch_rqt_plot\" >Launch rqt plot<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#Visualize_your_topic_data_with_rqt_plot\" >Visualize your topic data with rqt_plot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#Change_the_rqt_plot_settings\" >Change the rqt_plot settings<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#Plotting_2_topics_on_the_same_graph_with_rqt_plot\" >Plotting 2 topics on the same graph with rqt_plot<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#Create_a_sinus_publisher\" >Create a sinus publisher<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#Plot_2_topics_with_rqt_plot\" >Plot 2 topics with rqt_plot<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#rqt_plot_with_Turtlesim\" >rqt_plot with Turtlesim<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#rqt_plot_a_nice_debugging_tool\" >rqt_plot, a nice debugging tool<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_is_rqt_plot_and_what_to_do_with_it\"><\/span>What is rqt plot and what to do with it<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Rqt is a very useful ROS tool to help you during your ROS development. It\u2019s based on the Qt framework and includes a lot of plugins. In this post we\u2019ll focus on the rqt_plot plugin.<\/p>\n<p>With rqt_plot you can plot (what a surprise) any numeric values published by <a href=\"https:\/\/roboticsbackend.com\/what-is-a-ros-topic\/\">ROS topics<\/a>. You can also have multiple plots on the same graph.<\/p>\n<p>That\u2019s great to visually monitor the data created by a node or multiple nodes. For example, you could plot the position\/speed\/acceleration of your mobile base to see if there is any jerk and if the trajectory is smooth. You could monitor the temperature sensor data to see any rising value, etc.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Install_rqt_plot\"><\/span>Install rqt plot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you have already installed the \u201cDesktop\u201d or \u201cDesktop-Full\u201d version of ROS (see the <a href=\"http:\/\/wiki.ros.org\/melodic\/Installation\/Ubuntu\" target=\"_blank\" rel=\"noopener\">installation guide<\/a> from ROS Wiki), rqt should already be installed. As I explained above, rqt plot is a part of Rqt.<\/p>\n<p>Here\u2019s the package to install for rqt:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ sudo apt install ros-melodic-rqt<\/pre>\n<p>After that make sure to run <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">source ~\/.bashrc<\/code>. Your .bashrc file should already contain the command line <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">source \/opt\/ros\/melodic\/setup.bash<\/code>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Launch_rqt_plot\"><\/span>Launch rqt plot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To start any rqt plugin you first need to get a ROS master running. Execute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">roscore<\/code> in a terminal.<\/p>\n<p>Then to start rqt_plot, you can run either<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ rosrun rqt_plot rqt_plot<\/pre>\n<p>Or directly<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ rqt_plot<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-653 aligncenter\" src=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png\" alt=\"rqt_plot empty window\" width=\"600\" height=\"480\" srcset=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png 600w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty-300x240.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>When you install Rqt there is an executable created for some of the plugins. Basically the rqt_plot executable will just start the rqt_plot node from the rqt_plot package, just like we did with the \u201crosrun\u201d command.<\/p>\n<p>If you want to dig deeper and see where is the executable, use the \u201cwhich\u201d command line tool:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ which rqt_plot\r\n\/opt\/ros\/melodic\/bin\/rqt_plot<\/pre>\n<p>When you start rqt_plot (with rosrun or the executable), an <a href=\"https:\/\/roboticsbackend.com\/ros-anonymous-node\/\">anonymous node<\/a> is created, you can find it using rosnode list:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ rosnode list\r\n\/rosout\r\n\/rqt_gui_py_node_18748<\/pre>\n<p>Thus you could create multiple rqt_plot windows if you wanted to, by starting a rqt_plot node in different terminals. For this tutorial we\u2019ll use only one window, in which we\u2019ll plot multiple topics.<\/p>\n<p>Note: if you try to launch rqt_plot without a running ROS master, you\u2019ll get an error similar to this<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ rqt_plot # no roscore started\r\nPluginManager._load_plugin() could not load plugin \"rqt_plot\/Plot\": RosPyPluginProvider._init_node() could not find ROS master<\/pre>\n<p><b>Plot topic values with rqt_plot<\/b><\/p>\n<p>Before we can plot anything, let\u2019s create a basic node with a publisher. In this tutorial I\u2019ll use Python only, the goal is to show you how to use rqt_plot and not to spend too much time on the code itself.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">import rospy\r\nfrom std_msgs.msg import Int64\r\nimport random\r\n\r\nif __name__ == '__main__':\r\n    rospy.init_node(\"random_number_publisher\")\r\n    pub = rospy.Publisher(\"\/random_number\", Int64, queue_size=10)\r\n\r\n    # publish on topic at 10Hz (+ lien)\r\n    rate = rospy.Rate(10)\r\n\r\n    while not rospy.is_shutdown():\r\n        # this will generate a random number\r\n        # between 0 and 9\r\n        random_number = random.random() * 10\r\n        pub.publish(random_number)\r\n        rate.sleep()<\/pre>\n<p>This code will simply publish a random number &#8211; between 0 and 9 &#8211; at 10Hz, on the \u201c\/random_number\u201d topic.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Visualize_your_topic_data_with_rqt_plot\"><\/span>Visualize your topic data with rqt_plot<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>After you\u2019ve started a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">roscore<\/code>, in another terminal execute this script (either directly with python or with rosrun).<\/p>\n<p>Check out the running topics to see your new topic:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ rostopic list\r\n\/random_number\r\n\/rosout\r\n\/rosout_agg<\/pre>\n<p>Let\u2019s check the data coming from this \/random_number topic:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ rostopic echo \/random_number\r\ndata: 3\r\n---\r\ndata: 8\r\n---\r\ndata: 1\r\n---\r\ndata: 7\r\n---\r\ndata: 0<\/pre>\n<p>OK, now comes the interesting part. Let\u2019s actually plot those values with rqt_plot. From now, for simplicity, I\u2019ll only use the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">rqt_plot<\/code> executable instead of rosrun <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">rqt_plot rqt_plot<\/code>.<\/p>\n<p>You can directly give the topic name as a parameter in the rqt_plot command line<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ rqt_plot \/random_number<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-654 aligncenter\" src=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_random_number.png\" alt=\"Rqt plot random number\" width=\"1019\" height=\"736\" srcset=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_random_number.png 1019w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_random_number-300x217.png 300w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_random_number-768x555.png 768w\" sizes=\"auto, (max-width: 1019px) 100vw, 1019px\" \/><\/p>\n<p>Don\u2019t forget to click on the \u201cautoscroll\u201d checkbox so you can see the evolution of the values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Change_the_rqt_plot_settings\"><\/span>Change the rqt_plot settings<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Maybe the axis on the plot are not correctly set up, or you want a bigger x range to see more data. You can modify all that with the available settings options.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-661 aligncenter\" src=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_toolbox_settings.png\" alt=\"rqt_plot Toolbox Settings\" width=\"392\" height=\"49\" srcset=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_toolbox_settings.png 392w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_toolbox_settings-300x38.png 300w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/p>\n<p>Click on this icon above to modify the x and y axis settings.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-655 aligncenter\" src=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_settings.png\" alt=\"rqt_plot settings window\" width=\"428\" height=\"566\" srcset=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_settings.png 428w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_settings-227x300.png 227w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/p>\n<p>In this case I\u2019ve set X from 0 to 10 so we can see a 10 seconds window. As the autoscroll option is checked, this window will automatically adjust to show the latest available data.<\/p>\n<p>I\u2019ve also set the Y axis to show values between 0 and 10, as the published data on the topic is between those 2 numbers.<\/p>\n<p>Take a few seconds to experiment on the different rqt_plot settings. They are pretty easy to use. With the 2 arrows icons on the toolbox, you can switch between different view settings.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Plotting_2_topics_on_the_same_graph_with_rqt_plot\"><\/span>Plotting 2 topics on the same graph with rqt_plot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Let\u2019s create another publisher so we can visualize two plots on the same window.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Create_a_sinus_publisher\"><\/span>Create a sinus publisher<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Create a new Python file for a new ROS node.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">import rospy\r\nfrom std_msgs.msg import Float64\r\nimport math\r\n\r\nif __name__ == '__main__':\r\n    rospy.init_node(\"sinus_publisher\")\r\n    pub = rospy.Publisher(\"\/sinus\", Float64, queue_size=10)\r\n\r\n    x = 0\r\n    rate = rospy.Rate(20)\r\n\r\n    while not rospy.is_shutdown():\r\n        # Increase the value by 0.1 rad\r\n        x += 0.1\r\n        # Multiply the sinus value by 10\r\n        # so it's nicer for the plot example\r\n        pub.publish(math.sin(x) * 10)\r\n        rate.sleep()<\/pre>\n<p>The structure of the code is the same as for the random number publisher. Here we publish data on the \/sinus topic at 20Hz. The sinus value will be between -1 and 1, and we multiply it by 10, so we have a value between -10 and +10.<\/p>\n<p>As you can see, here we don\u2019t publish integer numbers, but float numbers. As long as it\u2019s a number, you can use rqt_plot it without any problem.<\/p>\n<p>Run this node and plot the topic data with rqt_plot<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ rqt_plot \/sinus<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-656 aligncenter\" src=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_sinus.png\" alt=\"rqt_plot sinus\" width=\"1019\" height=\"736\" srcset=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_sinus.png 1019w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_sinus-300x217.png 300w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_sinus-768x555.png 768w\" sizes=\"auto, (max-width: 1019px) 100vw, 1019px\" \/><\/p>\n<p>If needed, adjust the axis min and max in the window settings.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Plot_2_topics_with_rqt_plot\"><\/span>Plot 2 topics with rqt_plot<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let\u2019s keep this window open and add the data from \/random_number.<\/p>\n<p>To do so, first, launch the random_number_publisher node in another terminal.<\/p>\n<p>In the rqt_plot window, on the top text input box, write \u201c\/random_number\u201d and press ENTER.<\/p>\n<p>You\u2019ll see both topics plotted on the screen.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-652 aligncenter\" src=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_2_topics.png\" alt=\"Rqt plot with 2 topics\" width=\"1019\" height=\"736\" srcset=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_2_topics.png 1019w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_2_topics-300x217.png 300w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_2_topics-768x555.png 768w\" sizes=\"auto, (max-width: 1019px) 100vw, 1019px\" \/><\/p>\n<p>Note that the data used from the \/random_number topic is in fact \/random_number\/data, and the data used for the \/sinus topic is \/sinus\/data.<\/p>\n<p>If you look at the message definition for <a href=\"http:\/\/docs.ros.org\/api\/std_msgs\/html\/msg\/Int64.html\" target=\"_blank\" rel=\"noopener\">std_msgs\/Int64<\/a> and <a href=\"http:\/\/docs.ros.org\/api\/std_msgs\/html\/msg\/Float64.html\" target=\"_blank\" rel=\"noopener\">std_msgs\/Float64<\/a>, you\u2019ll see that they have a field named \u201cdata\u201d. You can\u2019t just print a topic, you need to print one of the specific fields that corresponds to a number. In this example, the only possible field is \u201cdata\u201d.<\/p>\n<p>In the input text box, when you typed \/random_number, rqt_plot automatically chose \/random_number\/data, as you can see on the graph legend.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"rqt_plot_with_Turtlesim\"><\/span>rqt_plot with Turtlesim<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>With rqt_plot you can plot any number data coming from any topic. Let\u2019s use one of the existing ROS package, Turtlesim, and see what data we can plot.<\/p>\n<p>After starting a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">roscore<\/code>, launch the turtlesim node.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ rosrun turtlesim turtlesim_node<\/pre>\n<p>Launch the teleop node so you can control the turtle on the screen with your keyboard.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ rosrun turtlesim turtle_teleop_key<\/pre>\n<p>And now, let\u2019s see which topic data we can use.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ rostopic\u00a0 list\r\n\/rosout\r\n\/rosout_agg\r\n\/turtle1\/cmd_vel\r\n\/turtle1\/color_sensor\r\n\/turtle1\/pose<\/pre>\n<p>The \/turtle1\/pose topic contains information about the current turtle pose in the workspace. What data can we use from there? Let\u2019s find out.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ rostopic info \/turtle1\/pose\r\nType: turtlesim\/Pose\r\n\r\nPublishers:\r\n\u00a0* \/turtlesim (http:\/\/ed-pc:37099\/)\r\n\r\nSubscribers: None<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\">$ rosmsg show turtlesim\/Pose\r\nfloat32 x\r\nfloat32 y\r\nfloat32 theta\r\nfloat32 linear_velocity\r\nfloat32 angular_velocity<\/pre>\n<p>OK, it seems that we could monitor any of those fields, as they\u2019re all numbers. Let\u2019s monitor the x position of the turtle.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">$ rqt_plot \/turtle1\/pose\/x<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-657 aligncenter\" src=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_turtlesim-1024x478.png\" alt=\"rqt_plot Turtlesim\" width=\"1024\" height=\"478\" srcset=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_turtlesim-1024x478.png 1024w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_turtlesim-300x140.png 300w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_turtlesim-768x359.png 768w, https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_turtlesim.png 1130w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>If you want to monitor other topics through rqt_plot, just add them from the input text box. Remember to always precise which field you\u2019re monitoring. If you just type \u201cturtle1\/pose\u201d, rqt_plot won\u2019t know which field you want to plot. In this case it might create a plot for each of the 5 available fields on the topic (x, y, theta, linear velocity, and angular velocity)<\/p>\n<h2><span class=\"ez-toc-section\" id=\"rqt_plot_a_nice_debugging_tool\"><\/span>rqt_plot, a nice debugging tool<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>As you saw in this post, using rqt_plot is not that hard, and you can easily plot one or multiple topic data (only numbers).<\/p>\n<p>This can be really useful for debugging, for example if you want to monitor a position drift on a robot wheel, or if you want to compare two data streams from 2 different sensors, or&#8230; anything else you want.<\/p>\n<p>Now that you have the basics, take some time to experiment more with rqt_plot!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial I\u2019ll show you what is ROS rqt plot and how to use it efficiently, through some examples. What is rqt plot and what to do with it Rqt is a very useful ROS tool to help you during your ROS development. It\u2019s based on the Qt framework and includes a lot of &#8230; <a title=\"rqt plot &#8211; Easily Debug ROS topics\" class=\"read-more\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\" aria-label=\"Read more about rqt plot &#8211; Easily Debug ROS topics\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-649","post","type-post","status-publish","format-standard","hentry","category-ros"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>rqt plot - Easily Debug ROS topics - The Robotics Back-End<\/title>\n<meta name=\"description\" content=\"Master rqt plot to plot ROS topics and debug your ROS program. rqt_plot is a very useful tool that will save you a huge amount of time...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"rqt plot - Easily Debug ROS topics - The Robotics Back-End\" \/>\n<meta property=\"og:description\" content=\"Master rqt plot to plot ROS topics and debug your ROS program. rqt_plot is a very useful tool that will save you a huge amount of time...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\" \/>\n<meta property=\"og:site_name\" content=\"The Robotics Back-End\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-08T15:14:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-28T20:21:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png\" \/>\n<meta name=\"author\" content=\"ed\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@RoboticsBackend\" \/>\n<meta name=\"twitter:site\" content=\"@RoboticsBackend\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ed\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\"},\"author\":{\"name\":\"ed\",\"@id\":\"https:\/\/roboticsbackend.com\/#\/schema\/person\/a20832f15e39847d8eea5be981767353\"},\"headline\":\"rqt plot &#8211; Easily Debug ROS topics\",\"datePublished\":\"2019-07-08T15:14:55+00:00\",\"dateModified\":\"2021-09-28T20:21:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\"},\"wordCount\":1272,\"publisher\":{\"@id\":\"https:\/\/roboticsbackend.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png\",\"articleSection\":[\"ROS Tutorials\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\",\"url\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\",\"name\":\"rqt plot - Easily Debug ROS topics - The Robotics Back-End\",\"isPartOf\":{\"@id\":\"https:\/\/roboticsbackend.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png\",\"datePublished\":\"2019-07-08T15:14:55+00:00\",\"dateModified\":\"2021-09-28T20:21:38+00:00\",\"description\":\"Master rqt plot to plot ROS topics and debug your ROS program. rqt_plot is a very useful tool that will save you a huge amount of time...\",\"breadcrumb\":{\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage\",\"url\":\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png\",\"contentUrl\":\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png\",\"width\":600,\"height\":480,\"caption\":\"rqt_plot empty window\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/roboticsbackend.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"rqt plot &#8211; Easily Debug ROS topics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/roboticsbackend.com\/#website\",\"url\":\"https:\/\/roboticsbackend.com\/\",\"name\":\"The Robotics Back-End\",\"description\":\"Program Robots, Step by Step\",\"publisher\":{\"@id\":\"https:\/\/roboticsbackend.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/roboticsbackend.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/roboticsbackend.com\/#organization\",\"name\":\"Robotics Back-End\",\"url\":\"https:\/\/roboticsbackend.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/roboticsbackend.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2020\/02\/logo_hd.png\",\"contentUrl\":\"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2020\/02\/logo_hd.png\",\"width\":2500,\"height\":1875,\"caption\":\"Robotics Back-End\"},\"image\":{\"@id\":\"https:\/\/roboticsbackend.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/RoboticsBackend\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/roboticsbackend.com\/#\/schema\/person\/a20832f15e39847d8eea5be981767353\",\"name\":\"ed\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/roboticsbackend.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7b666620f11fb12df5674e1e1ee525afe3d4ceecdaa57f8c60f6a937a33e3427?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7b666620f11fb12df5674e1e1ee525afe3d4ceecdaa57f8c60f6a937a33e3427?s=96&d=identicon&r=g\",\"caption\":\"ed\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"rqt plot - Easily Debug ROS topics - The Robotics Back-End","description":"Master rqt plot to plot ROS topics and debug your ROS program. rqt_plot is a very useful tool that will save you a huge amount of time...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/","og_locale":"en_US","og_type":"article","og_title":"rqt plot - Easily Debug ROS topics - The Robotics Back-End","og_description":"Master rqt plot to plot ROS topics and debug your ROS program. rqt_plot is a very useful tool that will save you a huge amount of time...","og_url":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/","og_site_name":"The Robotics Back-End","article_published_time":"2019-07-08T15:14:55+00:00","article_modified_time":"2021-09-28T20:21:38+00:00","og_image":[{"url":"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png","type":"","width":"","height":""}],"author":"ed","twitter_card":"summary_large_image","twitter_creator":"@RoboticsBackend","twitter_site":"@RoboticsBackend","twitter_misc":{"Written by":"ed","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#article","isPartOf":{"@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/"},"author":{"name":"ed","@id":"https:\/\/roboticsbackend.com\/#\/schema\/person\/a20832f15e39847d8eea5be981767353"},"headline":"rqt plot &#8211; Easily Debug ROS topics","datePublished":"2019-07-08T15:14:55+00:00","dateModified":"2021-09-28T20:21:38+00:00","mainEntityOfPage":{"@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/"},"wordCount":1272,"publisher":{"@id":"https:\/\/roboticsbackend.com\/#organization"},"image":{"@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage"},"thumbnailUrl":"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png","articleSection":["ROS Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/","url":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/","name":"rqt plot - Easily Debug ROS topics - The Robotics Back-End","isPartOf":{"@id":"https:\/\/roboticsbackend.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage"},"image":{"@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage"},"thumbnailUrl":"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png","datePublished":"2019-07-08T15:14:55+00:00","dateModified":"2021-09-28T20:21:38+00:00","description":"Master rqt plot to plot ROS topics and debug your ROS program. rqt_plot is a very useful tool that will save you a huge amount of time...","breadcrumb":{"@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#primaryimage","url":"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png","contentUrl":"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2019\/07\/rqt_plot_empty.png","width":600,"height":480,"caption":"rqt_plot empty window"},{"@type":"BreadcrumbList","@id":"https:\/\/roboticsbackend.com\/rqt-plot-easily-debug-ros-topics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/roboticsbackend.com\/"},{"@type":"ListItem","position":2,"name":"rqt plot &#8211; Easily Debug ROS topics"}]},{"@type":"WebSite","@id":"https:\/\/roboticsbackend.com\/#website","url":"https:\/\/roboticsbackend.com\/","name":"The Robotics Back-End","description":"Program Robots, Step by Step","publisher":{"@id":"https:\/\/roboticsbackend.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/roboticsbackend.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/roboticsbackend.com\/#organization","name":"Robotics Back-End","url":"https:\/\/roboticsbackend.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/roboticsbackend.com\/#\/schema\/logo\/image\/","url":"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2020\/02\/logo_hd.png","contentUrl":"https:\/\/roboticsbackend.com\/wp-content\/uploads\/2020\/02\/logo_hd.png","width":2500,"height":1875,"caption":"Robotics Back-End"},"image":{"@id":"https:\/\/roboticsbackend.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/RoboticsBackend"]},{"@type":"Person","@id":"https:\/\/roboticsbackend.com\/#\/schema\/person\/a20832f15e39847d8eea5be981767353","name":"ed","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/roboticsbackend.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7b666620f11fb12df5674e1e1ee525afe3d4ceecdaa57f8c60f6a937a33e3427?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7b666620f11fb12df5674e1e1ee525afe3d4ceecdaa57f8c60f6a937a33e3427?s=96&d=identicon&r=g","caption":"ed"}}]}},"_links":{"self":[{"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/posts\/649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":0,"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/posts\/649\/revisions"}],"wp:attachment":[{"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/categories?post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roboticsbackend.com\/wp-json\/wp\/v2\/tags?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}