bigheadG / mmWave

mmWave SDK examples based on Batman Kit mmWave Sensor module
http://www.joybien.com
123 stars 30 forks source link

What is the version of requirement such as pyqtgraph or pyopengl, on RaspberryPi 4 4G #17

Closed Aknifejackzhmolong closed 2 years ago

Aknifejackzhmolong commented 2 years ago

I have met the error like:

Traceback (most recent call last):
  File "/home/zdj/.local/lib/python3.9/site-packages/pyqtgraph/opengl/GLViewWidget.py", line 234, in paintGL
    self.setProjection(region=region)
  File "/home/zdj/.local/lib/python3.9/site-packages/pyqtgraph/opengl/GLViewWidget.py", line 157, in setProjection
    glMatrixMode(GL_PROJECTION)
  File "/usr/lib/python3/dist-packages/OpenGL/error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.error.GLError: GLError(
    err = 1282,
    description = b'invalid operation',
    baseOperation = glMatrixMode,
    cArguments = (GL_PROJECTION,)
bigheadG commented 2 years ago

the original program is use PyQtGraph: 0.11.0 and numpy: 1.22.2.

I think your issues is here. You can modify paint subroutine to avoid the error

        class CustomTextItem(gl.GLGraphicsItem.GLGraphicsItem):
        def paint(self):
                a = 0
                '''
                # For some version gl is ok some get following error
                #Error while drawing item <__main__.CustomTextItem object at 0x7fe379b51a60>

                self.GLViewWidget.qglColor(QtCore.Qt.cyan)
                self.GLViewWidget.renderText(round(self.X), round(self.Y), round(self.Z), self.text)
                '''