ros-visualization / visualization_tutorials

Tutorials related to using and extending RViz and interactive_markers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rviz PySide not working

JuliusSustarevas opened this issue · comments

I am trying to run rviz via python pyside (because of the better licence).

import rospy
import sys

setattr(sys, 'SELECT_QT_BINDING', 'pyside')
import rviz

from PySide2 import QtCore, QtGui, QtWidgets
app = QtWidgets.QApplication(sys.argv)
frame=rviz.VisualizationFrame()
frame.setSplashPath("")
frame.initialize()

I get:
>>> import rviz Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/ros/melodic/lib/python2.7/dist-packages/rviz/__init__.py", line 17, in <module> from . import librviz_shiboken

Part of this: #51
Part of this: #52

I am using:
Ubuntu 18.04. melodic
Pyqt4/5 installed
PySide and Pyside2 installed

More background:

  • Im trying to write an application using QT5 in python
  • I want to use pyside2 bindings for the LGPL licence
  • I used to nest rviz windows inside my application successfully when I used pyqt bindings.
  • I am now trying to import rviz when setattr(sys, 'SELECT_QT_BINDING', 'pyside') is set.
  • this is what causes the crash

Whoops I just realised I posted in the wrong repo