Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some of the dependencies are not compatible with python3 #34

Open
jhseeingthings opened this issue Sep 21, 2020 · 6 comments
Open

Some of the dependencies are not compatible with python3 #34

jhseeingthings opened this issue Sep 21, 2020 · 6 comments

Comments

@jhseeingthings
Copy link

Like "import StringIO" in File "~/smach_viewer/smach_viewer.py", line 44, in import StringIO

I would deeply appreciate that if you can update this lib to the noetic version.

@k-okada
Copy link
Contributor

k-okada commented Sep 23, 2020

Thanks for report, interestingly "StringIO" is not used anyware in this script, so can we remote that line? @jhseeingthings

@jhseeingthings
Copy link
Author

Thank you a lot!
I have tried your advice. but it still doesn't work.
Traceback (most recent call last):
File "/opt/ros/noetic/lib/smach_viewer/smach_viewer.py", line 48, in
import wxversion
ModuleNotFoundError: No module named 'wxversion'
But i couldn't find the appropriate version(2.8) for wxversion, then i installed the python-wxgtk3.0.
However, it doesn't work out.
How could i solve this? thank you.

@hcostelha
Copy link

I have the same problem. Although it has been released into the noetic repository, it seems not to be compatible with with Ubuntu 20.04 with ROS noetic and Python 3.

@FilipHesse
Copy link

Same problem here, porting to python 3 would be appreciated a lot.

@jhseeingthings jhseeingthings changed the title Some of the dependencies are not comaptible with python3 Some of the dependencies are not compatible with python3 Nov 17, 2020
@cosmicog
Copy link

cosmicog commented Dec 13, 2020

I think updating the code according to the newer versions of the xdot and wxpython won't be possible. I downloaded the code and tried for myself but since the owner of this repository kinda wrote his own version of the dependencies, Making it work with Noetic is looking almost impossible to me. Maybe we should write a new visualization tool.

Or we would just switch to behaviour trees since it's released even for ROS2.
https://index.ros.org/p/behaviortree_cpp_v3/#noetic
Or there's a py_trees, which is also as awesome as above:
https://index.ros.org/p/py_trees_ros/github-splintered-reality-py_trees_ros/#noetic

@karl-exwzd
Copy link

For reference: I'm using ROS Noetic and SMACH visualization is something I wanted to have to display the current state of my FSM for easy introspection and bling.

I could not update it to work in Noetic for the same reasons @cosmicog mentionned, however I was able to get it working by using ROS Melodic Docker container, even though the rest of the ROS framework was run in Noetic. I don't foresee anybody updating this repo anytime soon, at least this gives a way to use the visualization in the last iteration of ROS1 without too much effort.

Some modifications were needed, this was run in a Ubuntu 20.04 machine:

docker run -it --rm --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw ros:melodic bash
apt-get update
apt-get install -y python-pyqt5 ros-melodic-executive-smach-visualization

Edit file /opt/ros/melodic/lib/python2.7/dist-packages/smach_viewer/xdot/xdot_qt.py line 44:

from python_qt_binding.QtWidgets import QWidget, QMainWindow

Change to

from PyQt5.QtWidgets import QWidget, QMainWindow

Comment out line 185 in /opt/ros/melodic/lib/smach_viewer/smach_viewer.py:

# self._local_data._data = pickle.loads(msg.local_data)

Or the terminal will be full of errors and the viewer will not update the current state (but will display it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants