ros-visualization / rqt_graph

http://wiki.ros.org/rqt_graph
26 stars 27 forks source link

error when saving to dot format #85

Closed RoeschFlo closed 12 months ago

RoeschFlo commented 1 year ago

Hello together, when I try to save a rqt_graph to a dot file, i get a empty dot file and the following error occurs: Traceback (most recent call last): File "/opt/ros/noetic/lib/python3/dist-packages/rqt_graph/ros_graph.py", line 414, in _save_dot handle.write(self._current_dotcode) TypeError: write(self, Union[QByteArray, bytes, bytearray]): argument 1 has unexpected type 'str'

Edit: i found out i have 2 different python versions 2.7 and 3.8 i will check if thats my problem Edit: cant solve the problem the problem is not system dependent, i have thins problem on my working pc and on a new virtual machine

mjs973 commented 1 year ago

This is a bug in rqt_graph. It was created when noetic switched to using python3. The problem is that the code is not consistent about the type of the internal variable self._current_dotcode.

Please provide detailed instructions on how to trigger this bug, as I don't use the rqt_graph tools.

mjs973 commented 1 year ago

This problem was previously reported as #67 and fixed for ros2 (although looking at the patch, it doesn't seem to me like it correctly fixes the underlying issue.)

RoeschFlo commented 1 year ago

I trigger this bug, when i want to save a bunch of running ros nodes as a dot file. Exept sending you a crash file, i have no other or better instructions on how i trigger the bug. As i said, it happens every time when saving to the dot format. Do you wish other instructions on how to trigger this bug? _opt_ros_noetic_lib_rqt_gui_rqt_gui.1001.TXT

Thank you, with this help it works: https://github.com/ros-visualization/rqt_graph/issues/67

mjs973 commented 1 year ago

You have not told us which rqt_graph app you are using. What steps do you take to save a dot file? What do you click? What do you type?

RoeschFlo commented 1 year ago

Screenshot from 2023-04-25 11-35-14

it happens in every rqt app that has the function to save the node graph to a dot file. in the picture you can see where i click.

The following part is the package xml:

rqt_graph 0.4.14 rqt_graph provides a GUI plugin for visualizing the ROS computation graph.
Its components are made generic so that other packages where you want to achieve graph representation can depend upon this pkg (use rqt_dep to find out the pkgs that depend. rqt_dep itself depends on rqt_graph too).
Dirk Thomas Aaron Blasdel BSD http://wiki.ros.org/rqt_graph https://github.com/ros-visualization/rqt_graph https://github.com/ros-visualization/rqt_graph/issues Dirk Thomas catkin python_qt_binding python-rospkg python3-rospkg qt_dotgraph rosgraph rosgraph_msgs roslib rosnode rospy rosservice rostopic rqt_gui rqt_gui_py
alexvaut commented 1 year ago

In file "/opt/ros/noetic/lib/python3/dist-packages/rqt_graph/ros_graph.py", line 414, in _save_dot I just modified handle.write(self._current_dotcode) by handle.write(self._current_dotcode.encode('utf-8'))

and it's working fine.

RoeschFlo commented 12 months ago

Thank you :D