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

[WIP] Re-enable PySide2 support #1526

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

rhaschke
Copy link
Contributor

This is an attempt to re-enable PySide2 support as requested in #1525. However, there are several open issues:
The wrapper code for VisualizationFrame generated by shiboken is clearly broken:

void init_rviz_VisualizationFrame(PyObject *enclosingClass)
{
    PyObject *Sbk_rviz_VisualizationFrame_Type_bases = PyTuple_Pack(0, );
...
}

@JuliusSustarevas, feel free to continue here. I don't have the time to dig deeper now.
@wjwwood, maybe you can comment on your experience on this?

@kjeremy
Copy link

kjeremy commented Feb 7, 2023

@rhaschke any chance you can rebase this?

@rhaschke
Copy link
Contributor Author

rhaschke commented Feb 7, 2023

Where should I rebase to? This is already on noetic-devel.

@Nitinsn29
Copy link

I'm trying to visualize rviz in pyside2

Kindly find the snippet of my code below importing the pyside and rviz:
setattr(sys, 'SELECT_QT_BINDING', 'pyside') # Shiboken
from python_qt_binding import QT_BINDING
from python_qt_binding.QtGui import *
from python_qt_binding.QtCore import *
from python_qt_binding.QtWidgets import *
import rviz

Error msg while executing the snippet in ros melodic
File "/scripts/test_2.py", line 16, in
import rviz
File "/opt/ros/melodic/lib/python2.7/dist-packages/rviz/init.py", line 17, in
from . import librviz_shiboken
ImportError: cannot import name librviz_shiboken

Error msg while executing the snippet in ros noetic(using python-3.8)
File "/test_2.py", line 16, in
from rviz import bindings as rviz
File "/opt/ros/noetic/lib/python3/dist-packages/rviz/init.py", line 17, in
from . import librviz_shiboken as bindings
ImportError: cannot import name 'librviz_shiboken' from partially initialized module 'rviz' (most likely due to a circular import) (/opt/ros/noetic/lib/python3/dist-packages/rviz/init.py)

I am unable to find the librviz_shiboken in the path "/opt/ros/noetic/lib/python3/dist-packages/rviz/"
Should i install librviz_shiboken seperately?

kindly help me out to solve the issue.
Thanks in advance

@rhaschke
Copy link
Contributor Author

As the title of this PR states, PySide support is currently disabled in rviz. Thus the library doesn't exist.
Trying to reenable it, resulted in errors in the code generated by shiboken. That's why the PR is not yet resolved/merged.

@Nitinsn29
Copy link

Thanks for your responce

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 this pull request may close these issues.

3 participants