ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rqt_plot does not display topic

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

jessievd gravatar image

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

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 -0500 )edit

sorry yes!

jessievd gravatar image jessievd  ( 2021-09-21 02:19:33 -0500 )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 -0500 )edit

yes, done!

jessievd gravatar image jessievd  ( 2021-09-21 03:47:59 -0500 )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 -0500 )edit

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

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

You are writing your answer in the question section.

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

changed it

jessievd gravatar image jessievd  ( 2021-09-21 06:38:16 -0500 )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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

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

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

Question Tools

1 follower

Stats

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

Seen: 439 times

Last updated: Sep 28 '21