-
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
Realsense2-net for Unity #8347
Comments
Hi @roeelie I will tag into this discussion a person called @ogoshen who has experience in questions about interfacing with RealSense wrappers from within Unity. An example of this is a project for connecting Unity to a RealSense camera and an Android-based Oculus Quest VR headset. https://github.com/GeorgeAdamon/quest-realsense There is also this case: Hi @ogoshen Would it be possible for you to provide advice to @roeelie about the feasibility of the C# networking project proposed above, please? Thanks! |
If everything works outside Unity and you're able to use the device with C# then this should be easy enough. You'll probably want to create a custom class based on RsDevice, that creates the network device. |
Thanks so much for your time @ogoshen :) |
thanks @ogoshen @MartyG-RealSense :) I got a bit further! I managed to get a stream visible in Unity. But there are some problems arising. Sometimes I just dont get a stream in Unity, although I do see the IR emitters going on. So I think i`m enabling the devices but not correctly starting a stream. Also if i change resolution to another (for example from 640x680 to 480x270 or vice versa) it doesn't work anymore. (My setup currently has 2 net devices - in the viewer application they work fine). I think the problem has to do with that i pass a context to the pipeline. I created a custom class which is nearly the same as RsDevice like this.
In RsDevice.cs normally does cfg.EnableDevice(serial) which i can't do, so I guess thats one the issues that going wrong. I haven't figured out how to do this for a net device. Any suggestions? |
Hi @roeelie This subject is outside of my programming knowIedge - @ogoshen will be better able to answer this one. I do though recall past efforts to use multicam in Unity, in which it was found that RsDevice was acting as a singleton. So a RealSense user called frenchtouchXR developed a method for enabling multicam in the RealSense Unity wrapper. #2203 |
Glad to hear it works. If the first run works, it might be that you aren't disposing the device or other resources, and any further run fails to stream. Multi-cam in Unity should work fine, you can use multiple device components, each configured with a unique serial number. |
Hi @roeelie Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Issue Description
I am trying to use a D455 camera with a raspberry pi 4 over ethernet using this guide: https://dev.intelrealsense.com/docs/open-source-ethernet-networking-for-intel-realsense-depth-cameras
I have succesfully build the source and added C# wrapper for
rs2_device* rs2_create_net_device(int api_version, const char* address, rs2_error** error);
similar to this post This works well for a regular c# program.My question is: Is it possible to use realsense2-net devices in Unity. I've been looking into the c# wrapper code but can't figure out where to start. My endgoal is to use multiple camera's and use their pointclouds in Unity (over ethernet)
The text was updated successfully, but these errors were encountered: