Jump to content

Missing OpenGL library for IMU 3.0 3D view


cl-

Recommended Posts

I don't have macOS 12 at hand for testing. It works on macOS 10.15.7.

We're using just Qt with directly loading the low level operating system OpenGL library. This is due to problems with the wrapping of the QtOpenGL module in PyQt at the time of developing this code.

You can find the relevant code here:

https://github.com/Tinkerforge/brickv/blob/master/src/brickv/render_widget.py

Try running this two lines in Python on you Mac:

import ctypes.util
ctypes.util.find_library('OpenGL')

I assume that the find_library call returns None for you, meaning it cannot find the system's OpenGL library. It's unclear to me why.

In the long run we might just switch from OpenGL to Qt3D for this.

Link to comment
Share on other sites

Are you using the pre-build .dmg we provide for download? Or are you running brickv from source?

If you're using the pre-build .dmg this might be some kind of packaging bug.

If you're running from source, then I'm confused.

On 11/24/2021 at 12:05 PM, cl- said:

The current macOS Brick Viewer version (2.4.20) can't find the OpenGL library to display the 3D view of the IMU 3.0 Bricklet.

Does it say "OpenGL library not found. Disabling 3D view." in the bottom on the brickv window?

You can see from the code here, that this message is triggered by the ctypes.util.find_library('OpenGL') call returning None:

https://github.com/Tinkerforge/brickv/blob/2e4a03ec4d5429144febe7d4a4eb2ed3e0503dd8/src/brickv/render_widget.py#L42

https://github.com/Tinkerforge/brickv/blob/2e4a03ec4d5429144febe7d4a4eb2ed3e0503dd8/src/brickv/render_widget.py#L100

So I don't really understand why that call works if you try it by hand, but doesn't seem to work in brickv.

If you're currently using the pre-build .dmg, could you try running from source to see if this makes a difference?

Link to comment
Share on other sites

Unfortunately, I can't run Brick Viewer from source, as installing the requirements (pip3 install -r src/requirements.txt) fails.

It has a problem with tzlocal

Quote

Collecting tzlocal
  Using cached tzlocal-4.1-py3-none-any.whl (19 kB)
ERROR: Could not find a version that satisfies the requirement PyQt5_sip<4.20,>=4.19.11 (from pyqt5) (from versions: 12.7.0, 12.7.1, 12.7.2, 12.8.0, 12.8.1, 12.9.0)
ERROR: No matching distribution found for PyQt5_sip<4.20,>=4.19.11

I'm using a Homebrew Python3 version and it seems that the dependencies cannot be made compatible.

I'll try fixing it and get back to you asap.

Link to comment
Share on other sites

Sorry, you are right, tzlocal was not the problem indeed.

I changed the PyQt5 dependency in requirements.txt to

PyQt5

and that fixed it. I can now see the 3D view for the IMU v3 Bricklet.

On 11/30/2021 at 1:12 PM, photron said:

Does it say "OpenGL library not found. Disabling 3D view." in the bottom on the brickv window?

Yes that was exactly what it said.

Screenshot 2021-12-01 at 16.38.20.png

Link to comment
Share on other sites

Okay, so it can work.

But we still don't know if it is because of the packaging or the different PyQt5 version.

You could try building the Brick Viewer .dmg file. For that you need to run "build_pkg.py --no-sign" in the virtualenv. The --no-sign option tells it to not sign the binaries, as you cannot do that on our behalf. Afterwards try the resulting .dmg file that is created in the same directory as the build_pkg.py file.

If Brick Viewer from that .dmg has the same OpenGL problem, then it is triggered by the packaging.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

There are two small things which might be worth improving in the next version, I guess:

The dark mode uses bright font colours in the plot area, but the plot background does not adapt to the dark mode settings (it should be dark too).
Hence, you cannot read the labels and measurements anymore, especially for magnetic field, Euler angles, etc. (see the arrow in the screenshot)

One small problem with macOS: I cannot change the window dimensions while the plot is being filled with data.
For the period of dragging the window to the new size, the plot stays unreadable, also after the dragging was done (see the rectangle in the screenshot)

I can empty the plot, of course, and the data is ok again.

bv_2421_macos.png

Link to comment
Share on other sites

I've fixed the contrast issues with the plot widget. This was due to some hardcoded color choices.

I can reproduce the plot overlapping itself when resizing the window. I need to look into more detail their why that happens. Alsmost looks like one misplaced datapoint that makes the plot jump back and forth once.

Thanks for reporting.

Link to comment
Share on other sites

The erroneous graphs are gone now. Great!

What I do it (macOS 12.2) now is dark vertical lines in the plot whenever I switch to another tab in the Brick Viewer.
I used two Accelerometers here for example and switched from the one to the other Bricklet many times.
Each time the tab changed, the graphs plotted new vertical lines at the correlated time point.

Or is that a feature that I don't understand?

Cheers!

Screenshot 2022-02-01 at 14.58.26.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...