fjp / frenet

Transform Frenet (s,d) to local Cartesian (x,y) coordinates.
https://fjp.at/posts/optimal-frenet/
MIT License
225 stars 66 forks source link

There is an error about Qt when running #1

Closed bryanibit closed 4 years ago

bryanibit commented 4 years ago
python main.py 
['/home/ugv-yu/bryan/Frenet/frenet/python', '/usr/local/lib/python2.7/dist-packages/cryptography-2.4.2-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/cffi-1.11.5-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/asn1crypto-0.24.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/idna-2.8-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pycparser-2.19-py2.7.egg', '/home/ugv-yu/catkin_ws/devel/lib/python2.7/dist-packages', '/home/ugv-yu/Autoware/ros/devel/lib/python2.7/dist-packages', '/opt/ros/kinetic/lib/python2.7/dist-packages', '/usr/share/qgis/python', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/ugv-yu/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2']
['/home/ugv-yu/bryan/Frenet/frenet/python', '/usr/local/lib/python2.7/dist-packages/cryptography-2.4.2-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/cffi-1.11.5-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/asn1crypto-0.24.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/idna-2.8-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pycparser-2.19-py2.7.egg', '/home/ugv-yu/catkin_ws/devel/lib/python2.7/dist-packages', '/home/ugv-yu/Autoware/ros/devel/lib/python2.7/dist-packages', '/opt/ros/kinetic/lib/python2.7/dist-packages', '/usr/share/qgis/python', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/ugv-yu/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2']
Create Frenet Main Window
('create DynamicsWidget', <PySide2.QtWidgets.QWidget object at 0x7f231cc6df80>)
(u'new MplWidget', <PySide2.QtWidgets.QWidget object at 0x7f231cc6df80>)
Traceback (most recent call last):
  File "main.py", line 24, in <module>
    oFrenetMainWindow = fmw.FrenetMainWindow()
  File "/home/ugv-yu/bryan/Frenet/frenet/python/gui/frenet_main_window.py", line 7, in __init__
    self.setupUi(self)
  File "/home/ugv-yu/bryan/Frenet/frenet/python/gui/ui/frenet_main_window_ui.py", line 25, in setupUi
    self.dynamics_widget = DynamicsWidget(self.centralwidget)
  File "/home/ugv-yu/bryan/Frenet/frenet/python/gui/widgets/dynamics_widget.py", line 18, in __init__
    super(DynamicsWidget, self).__init__(self.oFig, parent)
  File "/home/ugv-yu/bryan/Frenet/frenet/python/gui/widgets/mplwidget.py", line 25, in __init__
    self.canvas = MplCanvas(i_oFig)                  # Create canvas object
  File "/home/ugv-yu/bryan/Frenet/frenet/python/gui/widgets/mplwidget.py", line 17, in __init__
    Canvas.setSizePolicy(self, QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
TypeError: arguments did not match any overloaded call:
  QWidget.setSizePolicy(QSizePolicy): argument 2 has unexpected type 'PySide2.QtWidgets.QSizePolicy.Policy'
  QWidget.setSizePolicy(QSizePolicy.Policy, QSizePolicy.Policy): argument 2 has unexpected type 'PySide2.QtWidgets.QSizePolicy.Policy'

When I use python main.py in terminal, the above is unfolded there. I think there is an mismatch for PySide2 library maybe. The following is shown in my terminal.

>>> import PySide2
>>> print(PySide2.__version__)
2.0.0~alpha0
fjp commented 4 years ago

Hi @bryanibit thank you for reporting the issue. I haven't used the GUI in a while but I'll check if I get the same error.

Please note that the GUI is not really functional yet unfortunately. At the moment, you are better off using the frenet.ipynb notebook, where the transformation is used too.

However, I am planning to re-implement the GUI allowing one to create trajectories from frenet polynomials.

fjp commented 4 years ago

@bryanibit I used a conda environment with python3. I'll add the environment.yml file. After you've activated the environment which should install the required dependencies you can execute frenet.sh which will compile the ui design file with uic and run main.py for you.

These are the dependencies that are needed to run the GUI.

But as I mentioned, it is not functional yet. Only pressing the Set lateral button will draw a line, nothing more.