Ask Your Question
0

rqt_plot does not display topic

asked 2021-09-21 01:57:55 -0600

jessievd gravatar image

updated 2021-09-28 01:38:47 -0600

When running my simulation on ros noetic, rqt_plot cannot display any topics anymore because of the following error:

Traceback (most recent call last):   File "/opt/ros/noetic/lib/python3/dist-packages/rqt_plot/plot_widget.py", line 230, in on_subscribe_topic_button_clicked
    self.add_topic(str(self.topic_edit.text())) File "/opt/ros/noetic/lib/python3/dist-packages/rqt_plot/plot_widget.py", line 290, in add_topic
    self._rosdata[topic_name] = ROSData(topic_name, self._start_time)  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_plot/rosplot.py", line 108, in __init__
    self.field_evals = generate_field_evals(fields)   File "/opt/ros/noetic/lib/python3/dist-packages/rqt_plot/rosplot.py", line 207, in generate_field_evals
    raise RosPlotException("cannot parse field reference [%s]: %s" % (fields, str(e))) rqt_plot.rosplot.RosPlotException: cannot parse field reference [['external_torques[0]']]: module 'string' has no attribute 'atoi' Traceback (most recent call last):   File "/opt/ros/noetic/lib/python3/dist-packages/rqt_plot/rosplot.py", line 201, in generate_field_evals
    slot_num = string.atoi(rest[:rest.find(']')]) AttributeError: module 'string' has no attribute 'atoi'

So it is mostly about the last line concerning rosplot.py. I have found the cause of this problem on this forum: https://github.com/ros-visualization/rqt_plot/pull/57 Which seems to be a bug in rqt_plot.

And a solution on this forum: https://answers.ros.org/question/362951/rqt_plot-noetic-does-not-display-arrays-fields/ Which is to replace string.atoi with int(). However, I cannot edit the file rosplot.py since it is read only and also, I read everywhere that you shouldn't just edit files in ros rqt. How can I fix this bug then? Or is there a way to edit this file safely?


Solution: updating from rqt_plot 0.4.12 to 0.4.13.

edit retag flag offensive close merge delete

Comments

1

So you solved #q385758?

gvdhoorn gravatar image gvdhoorn  ( 2021-09-21 02:15:38 -0600 )edit

sorry yes!

jessievd gravatar image jessievd  ( 2021-09-21 02:19:33 -0600 )edit

Then please post an answer there to explain what you did to solve it.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-21 02:23:35 -0600 )edit

yes, done!

jessievd gravatar image jessievd  ( 2021-09-21 03:47:59 -0600 )edit

You have to write the answer and its explanation in below answer box.

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2021-09-21 05:15:41 -0600 )edit

That is what I did right, I don't understand?

jessievd gravatar image jessievd  ( 2021-09-21 05:17:03 -0600 )edit

You are writing your answer in the question section.

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2021-09-21 05:29:35 -0600 )edit

changed it

jessievd gravatar image jessievd  ( 2021-09-21 06:38:16 -0600 )edit

@jessievd Both of the links in your description are 13 months old. I find it hard to believe this bug is still in there after all that time. What version of rqt_plot are you using?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-09-21 13:31:44 -0600 )edit

@Mike Scheutzow When I use apt list rqt_plot -a it says;

 Listing... Error!
E: input:0-8: error: Expected pattern
   rqt_plot
   ^^^^^^^^

However, if I use apt list python3 -a (as you can see in the error message in my question, rqt_plot is within python3 directory) it says:

   python3/focal,now 3.8.2-0ubuntu2 amd64 [installed]

python3/focal 3.8.2-0ubuntu2 i386

I already did sudo apt-get update python3 and sudo apt-get upgrade python3, but did not work.

jessievd gravatar image jessievd  ( 2021-09-22 01:15:15 -0600 )edit

The apt package name would be ros-noetic-rqt-plot:

$ apt list ros-noetic-rqt-plot
Listing... Done
ros-noetic-rqt-plot/focal 0.4.13-1focal.20210727.072847 amd64

@Mike Scheutzow wrote:

@jessievd Both of the links in your description are 13 months old. I find it hard to believe this bug is still in there after all that time. What version of rqt_plot are you using?

there is a chance it's actually old, seeing as @jessievd mentioned not using a regular install, but "a company installation of ROS" in #q385758.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-22 02:42:14 -0600 )edit

This is what I get.

ros-noetic-rqt-plot/focal,now 0.4.12-1focal.20201017.004142 amd64 [installed]

How do I get it to 0.4.13 as you have? Already ran sudo apt-get upgrade ros-noetic-rqt-plot but did not help

jessievd gravatar image jessievd  ( 2021-09-22 02:48:33 -0600 )edit

I would suggest to ask whoever manages that installation method you're using at the company you work.

It could be they're using the wiki/SnapshotRepository, in which case lagging behind is actually a feature.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-22 03:05:12 -0600 )edit

@jessievd: I realise you got some confusing input previously, but: if you solve your problem, and there is no answer which already describes the solution, post your solution as an answer and accept your own answer.

Do not edit your original post to add the solution. That has close to zero visibility.

In this case however, @Mike Scheutzow already posted the answer and he was right (as you confirmed with your edit).

So please accept @Mike Scheutzow's answer by clicking the checkmark to the left of his answer.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-28 01:43:29 -0600 )edit

Did it now!

jessievd gravatar image jessievd  ( 2021-09-28 02:46:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-09-22 06:00:10 -0600

Mike Scheutzow gravatar image

Both of the links in your description are 13 months old. You need to upgrade your ros-noetic-rqt-plot apt package to version 0.4.13.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-09-21 01:57:55 -0600

Seen: 46 times

Last updated: Sep 28 '21