Rosanswers logo

I'm using rqt_plot and having trouble. I noticed that there are a lot of these error messages generated when I'm trying to add a field to the plot:

$ ros2 run rqt_plot rqt_plot
Traceback (most recent call last):
  File "/opt/ros/crystal/lib/python3.6/site-packages/rqt_plot/plot_widget.py", line 256, in on_topic_edit_textChanged
    plottable, message = is_plottable(self._node, topic_name)
  File "/opt/ros/crystal/lib/python3.6/site-packages/rqt_plot/plot_widget.py", line 151, in is_plottable
    fields, message = get_plot_fields(node, topic_name)
  File "/opt/ros/crystal/lib/python3.6/site-packages/rqt_plot/plot_widget.py", line 135, in get_plot_fields
    slot_type, is_array, array_size = _parse_type(slot_type)
  File "/opt/ros/crystal/lib/python3.6/site-packages/rqt_plot/plot_widget.py", line 57, in _parse_type
    end_array_idx = topic_type_str.find(']', start=array_idx + 1)
TypeError: find() takes no keyword arguments

It seems that plot_widget.py expects topic_type_str to be of type string, but it's of type str instead. Am I missing some dependency? Thanks.

Originally posted by clyde on ROS Answers with karma: 1247 on 2019-05-14

Post score: 0


1 Answer 1


Rosanswers logo

It seems that plot_widget.py expects topic_type_str to be of type string, but it's of type str instead.

I'm not sure that's the problem: str is what string (if you're talking about the ROS2 idl type) is mapped to afaik in Python clients.

The last line in the traceback shows this:

topic_type_str.find(']', start=array_idx + 1)

start is a "keyword argument" here. That is not supported. See this question on SO fi.

It seems to have been introduced in ros-visualization/rqt_plot#17 when rqt_plot was ported to ROS 2.

It looks like it's a copy-pasta or mistake (as it doesn't appear elsewhere in the file).

Submitted ros-visualization/rqt_plot#29 to remove the start there.

Originally posted by gvdhoorn with karma: 86574 on 2019-05-15

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by clyde on 2019-05-15:
Thanks for the response. I'll track the bug. Re: string, I was referring to the Python string module. But now I see that the string.find() method is not part of Python 3. So, a mis-formed question.

Comment by clyde on 2019-05-15:
I patched locally, and found 2 more bugs. Submitted https://github.com/ros-visualization/rqt_plot/pull/30 with all 3 fixes.

Comment by gvdhoorn on 2019-05-15:

Would've been nice to just base your PR on my commit, but nice to see things got fixed in the end.

Comment by clyde on 2019-05-15:
Whoops, my git foo is still weak. I'll work on that next time. Thanks again.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.