NVlabs / BundleSDF

[CVPR 2023] BundleSDF: Neural 6-DoF Tracking and 3D Reconstruction of Unknown Objects
https://bundlesdf.github.io/
Other
992 stars 109 forks source link

How can i get pyrealsense2.so ? #136

Closed kevinDrawn closed 6 months ago

kevinDrawn commented 7 months ago

Ubuntu 20.04 Python 3.8

Hello.

I want to import pyrealsense2.

So, I tried the below process.


cmake 
cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3

make -j6

sudo make install

All process was clear. But In my /usr/local/lib,

There isn't library related to pyrealsense2.so

(base) park@park-MS-7D42:/usr/local/lib$ ls cmake librealsense2-gl.so.2.54.2 librealsense-file.a libfw.a librealsense2.so librsutils.a librealsense2-gl.so librealsense2.so.2.50 pkgconfig librealsense2-gl.so.2.50 librealsense2.so.2.50.0 python3.8 librealsense2-gl.so.2.50.0 librealsense2.so.2.54 librealsense2-gl.so.2.54 librealsense2.so.2.54.2

How can i install the pyrealsense2.so?

@MartyG-RealSense

MartyG-RealSense commented 7 months ago

Hi @kevinDrawn Do you have a path called librealsense/build/wrappers/python please? If you do, are the .so files located there?

image

kevinDrawn commented 7 months ago

no one..

kevinDrawn commented 7 months ago

Screenshot from 2024-01-26 17-52-45

MartyG-RealSense commented 7 months ago

If you are able to use pip install commands on your computer then another way to install the wrapper is with the command pip install pyrealsense2

MartyG-RealSense commented 7 months ago

Great! Please do let me know if you have any further problems.

MartyG-RealSense commented 7 months ago

You would only need to know the location of the .so file if you wanted to copy the file into the same folder as your Python script. If pyrealsense2 is able to find your Python 3 installation then copying the file is not necessary.

A pip install builds the wrapper from packages rather than source code (.so)

Please try running a pyrealsense2 test script to see whether it works. A script with one line should be enough to test whether pyrealsense2 and Python 3 can talk to each other correctly.

import pyrealsense2 as rs

MartyG-RealSense commented 7 months ago

You are very welcome :)

wenbowen123 commented 7 months ago

Hi, another tip is the data collection with realsense could be separated from this repo. You can prepare your own video like the demo data's structure beforehand if you have trouble setting up realsense env inside docker.