jdber1 / opendrop

OpenDrop pendant drop tensiometry software
GNU General Public License v3.0
30 stars 18 forks source link

opendrop on Raspberry Pi 3B #47

Open Ludnie opened 1 year ago

Ludnie commented 1 year ago

I am currently working on building a drop shape analyzer. I have a Raspberry Pi 3B and picamera2-compatible bw camera. Would it be possible to run opendrop on a Raspberry Pi? On a Raspberry Pi 4B >2GB it should be possible to run it under Ubuntu. But would it be possible to run it under Raspberry Pi OS 32bit? Could the videostream from the Camera be used via the picamera2 library?

eugenhu commented 1 year ago

Sounds like an interesting project, I don't see any barriers but there are some sources that need to be compiled, these just depend on Boost and SUNDIALS, which you should be able to install. RPi os repos should be similar to the debian repos.

Since you are using picamera2, it should work as a video capture source for OpenCV. A limitation to keep in mind (although this doesn't affect you) is that there won't be GenICam support since we use the python genicam bindings which is closed source and has no ARM binaries.

To install, you probably need apt-get install libboost-dev libsundials-dev python-gi python-opencv and then:

pip3 install git+https://github.com/jdber1/opendrop.git@development
Ludnie commented 1 year ago

Thank you for the instructions. I messed around a little bit and got opendrop to install successfully.

I needed to install python3-opencv and cmake.

After this I downloaded and installed SUNDIALS 5.8.0 tar -xvf sundials-5.8.0.tar.gz cd sundials-5.8.0/ mkdir build cd build/ cmake \ -DEXAMPLES_INSTALL=OFF \ -DBUILD_ARKODE=ON \ -DBUILD_CVODE=OFF \ -DBUILD_CVODES=OFF \ -DBUILD_IDA=OFF \ -DBUILD_IDAS=OFF \ -DBUILD_KINSOL=OFF \ -DBUILD_STATIC_LIBS=OFF \ -DCMAKE_BUILD_TYPE=Release \ .. sudo make sudo make install

Then I installed Boost.Math sudo apt install libboost-dev

I tried installing opendrop with pip3 install git+https://github.com/jdber1/opendrop.git but "Could not find glib-compile-resources", so I installed glib sudo apt install libglib2.0-dev-bin

Then I tried again and the installation was succesfull, but when I tried to start opendrop, I got this error: ~ $ python3 -m opendrop Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/drop/.local/lib/python3.9/site-packages/opendrop/__main__.py", line 30, in <module> from opendrop.app import OpendropApplication File "/home/drop/.local/lib/python3.9/site-packages/opendrop/app/__init__.py", line 36, in <module> from . import main_menu, ift, conan, common File "/home/drop/.local/lib/python3.9/site-packages/opendrop/app/ift/__init__.py", line 29, in <module> from . import ift_experiment, image_processing, physical_parameters, report File "/home/drop/.local/lib/python3.9/site-packages/opendrop/app/ift/ift_experiment.py", line 37, in <module> from .services.progress import IFTAnalysisProgressHelper File "/home/drop/.local/lib/python3.9/site-packages/opendrop/app/ift/services/progress.py", line 6, in <module> from opendrop.app.ift.services.analysis import PendantAnalysisJob File "/home/drop/.local/lib/python3.9/site-packages/opendrop/app/ift/services/analysis.py", line 46, in <module> from .younglaplace import YoungLaplaceFitService, YoungLaplaceFitResult File "/home/drop/.local/lib/python3.9/site-packages/opendrop/app/ift/services/younglaplace.py", line 7, in <module> from opendrop.fit import YoungLaplaceFitResult, young_laplace_fit File "/home/drop/.local/lib/python3.9/site-packages/opendrop/fit/__init__.py", line 4, in <module> from .younglaplace import * File "/home/drop/.local/lib/python3.9/site-packages/opendrop/fit/younglaplace/__init__.py", line 7, in <module> from .model import YoungLaplaceModel File "/home/drop/.local/lib/python3.9/site-packages/opendrop/fit/younglaplace/model.py", line 36, in <module> from .shape import YoungLaplaceShape ImportError: libsundials_arkode.so.4: cannot open shared object file: No such file or directory Is there something wrong with the SUNDIALS-Installation?

eugenhu commented 1 year ago

Apologies for the late reply, I've been a bit busy recently.

Looks like you've done all the steps necessary, I can't think of what could have gone wrong.

Can you try cloning the repo and running scons in the project root, e.g.:

$ git clone https://github.com/jdber1/opendrop.git
$ cd opendrop
$ scons

and then try running ./tests/c/test_younglaplace, to test the compiled part of opendrop that uses SUNDIALS.

Maybe you can also try installing the SUNDIALS examples and testing if they run, and if libsundials_arkode.so.4 exists in /usr/lib.

Also the development branch of opendrop supports SUNDIALS version 6 and above. Possibly you can try building and installing SUNDIALS v6 instead and hope the same problem doesn't happen.