-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to build pyrealsense2_net #9946
Comments
Hi @colinmsnow The ethernet guide recommends including the CMake build flag -DFORCE_RSUSB_BACKEND=ON when building the SDK from source on Raspberry Pi. This advice is also applicable to building the SDK from source on Jetson, as demonstrated by the Jetson Nano compatible installation guide at #6964 (comment) |
I tried again building with:
It builds successfully but I still have the same problem with missing methods in pyrealsense_net. I have been following the instructions in #20 and have moved the init.py file to the directory that holds the python package. This makes pyrealsense2 work but there is no equivalent init.py for the net module. I tried it with the same init file as pyrealsense2 and also a blank init and neither caused any change. The build put the python packages in
This seems like it should be correct but I have no way of verifying whether these files are flawed or whether they are not being imported properly. |
The instructions in IntelRealSense/meta-intel-realsense#20 (comment) relate to a branch of Linux called Yocto and not Ubuntu. After having installed the pyrealsense2 wrapper and included net support in the build with -DBUILD_NETWORK_DEVICE=ON, what happens if you then attempt to launch the net_viewer.py example? |
I built it using the flags:
Running
If I run
This makes sense because there is no folder for pyrealsense2_net and python does not know how to find it, but the folder for pyrealsense2 appears to contain the net libraries. Is this the expected behavior? And if so how do I get python to recognize these pyrealsense2-net.cpython files as a library? |
Another RealSense user in #7606 also encountered the ModuleNotFoundError: No module named 'pyrealsense2_net' error when trying to import pyrealsense2-net. A RealSense team member asked whether they had rs-server running on Linux. I therefore wonder whether rs-server should be active first before the net-viewer.py example program is run. Thanks very much for your patience during this case! |
After reading the link you provided it seems like the problem encountered in the issue was that rs-server only supports Linux and so it is not possible to compile pyrealsense2_net on windows. I am working on Linux and building the SDK successfully builds rs-server and puts it in
Running rs-server has no effect on the python modules and I still get the same error. |
If this were the open source ethernet networking project then I would expect to have to make an SSH connection to rs-server from the host computer before being able to stream data from the remote camera to the host. The net-viewer.py Python example has no accompanying documentation to indicate what prerequisites and procedures are needed in order to establish a network connection though. As the available investigative leads about this subject have been covered already in this discussion, since you are using Linux and Python it may be worth considering using EtherSense instead, which was a RealSense networking project designed for Python that was the predecessor of rs-server. |
I think my last post might have been a bit confusing... I have a remote device (Raspi 4) which is running rs-server and streaming data to the Jetson. I know this works as I can access the stream both through the realsense-viewer and the c++ API. The I would like to avoid using EtherSense as my server computer is already set up and working reliably and future plans for this project will likely depend on using both c++ and python to access the remote device which is only possible with realsense-net. |
In the ethernet networking white-paper, Intel provide a download link for a pre-built 3 GB Raspberry Pi 4 SD card image containing librealsense 2.34.0 and the networking files for testing purposes and to compare the file structure to your own installation. |
I am using that image on my remote device and to my knowledge, while it does build the net device, it does not build python bindings so does not have pyrealsense2 or pyrealsense2_net. |
I reviewed the case again from the beginning but did not find any further leads that mat be helpful unfortunately, as rs_viewer.py was introduced relatively recently in SDK 2.49.0 and so there are few references about it at the time of writing this. I do apologize. |
I tried the same set of actions on another computer (Dell Latitude running Ubuntu 18.04) and got exactly the same result so I suspect it is not an issue with my machine or configuration but rather in either how the installer places files or a lack of documentation on how to use them after they are built. I noticed that @maloel wrote the net_viewer example and a few others including @lramati seem to be actively developing the python net module. Would any of you be able to provide some clarity on this or @MartyG-RealSense do you know anyone else who might have knowledge about it? Assuming this is not a computer-specific issue it seems like it is something that is pretty essential to the use of the pyrealsense2_net project. |
I'm having the same issue on a Windows machine: I successfully compiled both
which means initialization routine of the DLL failed. I tried to include also I also noticed that installing the pip version of pyrealsense2 includes pyrealsense2-net into the package so I tried importing that one (after renaming): import pyrealsense2 as rs
import pyrealsense2.pyrealsense2_net as rsnet Same error appears |
I have highlighted this case to Intel to seek advice. Thanks very much for your patience. |
Hi @colinmsnow and @michezio Intel are still investigating this issue. Thanks very much for your patience! |
There is currently no further information from Intel to report about this issue. |
I am also having the exact same issue on window. Is there any new update regarding the situation? |
Hi @Adamskiiiiii The most recent discussion of the ModuleNotFoundError: No module named 'pyrealsense2_net' error was a week ago at the time of writing this at #10218 though that was again an Ubuntu related case. The next version of the RealSense networking API is being worked on and due "soon", though I do not have an estimate of a release timetable to provide. |
I have no further information from Intel to provide at the time of writing this. @colinmsnow @michezio @Adamskiiiiii Could each of you update me about whether you are still experiencing problems with pyrealsense2.net please. Thanks! |
@MartyG-RealSense Hi, I decided to switch to C++ code in order to use the network module. In C++ it builds fine and works correctly up to version 47, as I described here #9971 |
@michezio Thanks for the information! |
@MartyG-RealSense pyrealsense2.net still doesn't work, so I have switched to C++ networking instead (and encountered a different issue, at #10262). Thank you for the update anyway! |
Thanks very much @Adamskiiiiii for your update! I have replied to #10262 @colinmsnow I will close this case after 7 days from the time of writing this if I do not hear from you. Thanks! |
I was never able to resolve this issue or get pyrealsense2.net working in any capacity. We have moved on to another solution. |
Thanks very much @colinmsnow for the update! As everyone involved in this case has either moved to C++ or chose another solution, I will close this case. Thanks again! |
Hello MartyG, |
Hi @deepak-asink There is no update to provide regarding issues with pyrealsense2.net. Intel are working on the next version of RealSense networking, although I do not have a time estimate available for its release. You could explore whether the Python EtherSense ethernet networking project in the link below that was the predecessor of the current networking system can meet your needs. |
Thanks @MartyG-RealSense , I am able to use Ethersense for my project but the frames I am getting are at very low fps on client side. Can you suggest some fix for that. |
A general rule for RealSense ethernet networking will be that the connection will have a faster data transfer rate than USB 2 but slower than USB 3 due to the speed limitations of ethernet cables compared to USB cables. This is described in the table below,. At #8213 (comment) there was also a case with a Python ethernet setup resembling the EtherSense project where connection problems were found to be caused by use of USB 2 cabling instead of USB 3. |
I am asking about the existing compression strategies used by Intel in rs-server which I didn't get with Ethersense. |
The white paper document for the networking system based around rs-server states that it makes use of LZ4 for depth compression and the libjpeg-turbo open-source library for infrared compression. Versions of LZ4 for Python can be found by visiting https://lz4.github.io/lz4/ and scrolling down to the section headed Interoperable LZ4 ports and bindings |
I solved the problem by replacing |
Excellent to hear, @Adamskiiiiii - thanks so much for sharing the solution that worked in your particular case :) |
@Adamskiiiiii, @MartyG-RealSense
Could you please tell me how you managed to install the |
Hi @CharmingZh |
@maloel Okay, that's soooo sad ; ( |
Hi @CharmingZh Switching to C++ would not help unfortunately as the deprecation of realsense2-net applies to C++ too. An alternative RealSense networking tool for Python called EtherSense remains available. |
Issue Description
Hi,
I am trying to build the Python realsense library pyrealsense2_net and run the net_viewer.py example to get frames from a networked realsense device. The remote device is a Raspberry Pi 4 setup via the guide to ethernet networking.
I am building realsense from source using the commands:
I have also tried with only the first two flags but added shared_libs and python_executable based on comments on some similar issues.
Running the above commands successfully builds pyrealsense2 and a folder for pyrealsense2_net but the network library has almost no methods and does not implement net_device which is critical for using networked cameras.
Here is what happens if I import the two libraries and see their methods:
I have tried SDK versions 2.47.0 and 2.49.0 and they seem to work the same.
Is there something I am missing here? Additional flags I need to set or libraries to install?
Thanks,
Colin
The text was updated successfully, but these errors were encountered: