Ask Your Question
0

ros2 crystal rqt_plot error: find() takes no keyword arguments

asked 2019-05-14 19:49:42 -0500

clyde gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-05-15 02:22:39 -0500

gvdhoorn gravatar image

updated 2019-05-15 02:33:48 -0500

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.

edit flag offensive delete link more

Comments

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.

clyde gravatar imageclyde ( 2019-05-15 10:04:21 -0500 )edit

I patched locally, and found 2 more bugs. Submitted https://github.com/ros-visualization/... with all 3 fixes.

clyde gravatar imageclyde ( 2019-05-15 12:36:58 -0500 )edit

Ok.

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

gvdhoorn gravatar imagegvdhoorn ( 2019-05-15 13:13:10 -0500 )edit

Whoops, my git foo is still weak. I'll work on that next time. Thanks again.

clyde gravatar imageclyde ( 2019-05-15 16:01:44 -0500 )edit

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: 2019-05-14 19:49:42 -0500

Seen: 46 times

Last updated: May 15