Rosanswers logo

Hi to all,

I'm not able to use rqt_plot with some topics (I'm using ROS Indigo). I this it's because I can't find the correct field name and so I'm not able to correctly specify the path in rqt_plot.

This is my bag file and, for example, it outputs the following data for /robo/io topic:

data: 1511957429.218142138,0,0,0,0,3416,1441,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6551
data: 1511957429.318112290,0,0,0,0,3442,1169,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,6552
data: 1511957429.418157183,0,0,0,0,3345,1283,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,6553
data: 1511957429.518295379,0,0,0,0,3294,1374,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6554
data: 1511957429.618295945,0,0,0,0,3294,1306,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6555
data: 1511957429.718757851,0,0,0,0,3258,1366,0,0,0,0,0,1,1,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6556
data: 1511957429.818196624,0,0,0,0,3307,1473,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6557

This is the result of rostopic type:

rostopic type /robo/io

All the topics included in the bag file come out from a ROS node which I wrote.

I'd like to plot columns 6 and 7 of /robo/io by using rtq_plot or any other tool available under ROS. Can you help me, please?

Originally posted by Marcus Barnet on ROS Answers with karma: 287 on 2017-12-03

Post score: 0

Original comments

Comment by gvdhoorn on 2017-12-04:
Random comment: using std_msgs/String for this seems like a really strange thing to do. And I would be surprised if the answer by @jayess works immediately. I'm not sure if rqt_plot will plot anything but numeric data and / or can index into strings like what is suggested.

Comment by jayess on 2017-12-04:
@gvdhoorn Good point, I somehow missed that std_msgs/String part at the end.


1 Answer 1


Rosanswers logo

rqt_plot will only plot one entry in an array so, if you want to use it, you need to specify which entry you want to plot. Therefore, you should try something like:

rqt_plot /robo/io[5]


rqt_plot /robo/io[6]

Alternatively, you can start rqt_plot and at the top enter the topic name and index of the array.

[Note that I didn't download your bag file because I don't download random files from random sites on the internet. So, you may have to play around with what you need to type in order to get the plot but this should be a starting point for you.]


As @Dirk Thomas pointed out in the comments you can combine the two commands:

rqt_plot /robo/io[5] /robo/io[6]

Update 2:

As @gvdhoorn noted in the comments, you're trying to plot an std_msgs/String value which will not work. Plotting numbers makes sense. Plotting strings? Not so much.

If you're publishing the data then maybe you want to re-think how you're doing it (i.e., publish numerical data types). If you're not publishing and only subscribing, then you'll want to transform this data from a string into a numerical data type.

Originally posted by jayess with karma: 6155 on 2017-12-03

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by Dirk Thomas on 2017-12-03:
You can also pass multiple topics to plot multiple lines at the same time: e.g. rqt_plot /robo/io[5] /robo/io[6].

Comment by jayess on 2017-12-03:
@Dirk Thomas: thanks, I'll add that.

Comment by Marcus Barnet on 2017-12-04:
You have reason, I cannot plot string data. I need to change the code for my node in order to publish numerical values.

Comment by jayess on 2017-12-04:
Great. If this solved your problem then please click the checkmark button to accept it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.