rqt_plot does not display topic
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.
So you solved #q385758?
sorry yes!
Then please post an answer there to explain what you did to solve it.
yes, done!
You have to write the answer and its explanation in below answer box.
That is what I did right, I don't understand?
You are writing your answer in the question section.
changed it
@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 When I use
apt list rqt_plot -a
it says;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:I already did
sudo apt-get update python3
andsudo apt-get upgrade python3
, but did not work.The
apt
package name would beros-noetic-rqt-plot
:@Mike Scheutzow wrote:
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.
This is what I get.
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 helpI 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.
@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.
Did it now!