Skip to content
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

Streaming Sensor Data #113

Open
task-master98 opened this issue Jun 3, 2024 · 6 comments
Open

Streaming Sensor Data #113

task-master98 opened this issue Jun 3, 2024 · 6 comments

Comments

@task-master98
Copy link

Hi,
Firstly thanks a lot for this work as this has immensely benefitted me. I am currently working on a Unity research project using the Hololens 2. Now my task is simple, I would like to stream the sensor data (grayscale cameras and the depth sensor) on a renderer such as the Quad object. I have been going through the hl2ss api but have been struggling with understanding the core logic. Can you tell me which functions I would need to call to simply get the sensor data so that I can stream it?

@jdibenes
Copy link
Owner

jdibenes commented Jun 4, 2024

Hello,
For your task, you would need a hl2ss Unity client to receive and decode the stream data, which we don't have.
For Unity apps that don't run on the HoloLens, I can only suggest to take the hl2ss C++ client and make a Unity plugin with it.
The functions that you would need to expose to Unity are mainly in the hl2ss multithreaded module (hl2ss_mt).
These are the start(), status(), stop(), and get_packet() methods of hl2ss::mt::source.
For each sensor you want to stream, create an instance of hl2ss::mt::source in the Unity plugin.
Then create wrapper functions for the methods of each instance, which Unity can call (e.g., using extern "C" __declspec(dllexport) if on Windows).
For an example of the hl2ss multithreaded module, see the hl2ss matlab client and main.cpp in the C++ client folder.

@task-master98
Copy link
Author

Hi,
I'd just like to be clear, the application would be running on Hololens. Essentially I would like to recreate something like this
image

You see this example they are broadcasting the data on a window which is a holographic object on the Hololens 2 device. I would essentially like to recreate this. I want to stream data from the depth sensor and the 4 grayscale cameras on separate windows like this. Please guide me for the same.

Thanks!

@jdibenes
Copy link
Owner

jdibenes commented Jun 4, 2024

Ah, in that case this repo does that https://github.com/petergu684/HoloLens2-ResearchMode-Unity
We also have a prototype in https://github.com/jdibenes/hl2da

@task-master98
Copy link
Author

Hi so I am checking out the prototype you pointed out https://github.com/jdibenes/hl2da. However, I do not see any objects in the hierarchy, can you tell me which script is attached to which component? Are you streaming the data somewhere?

@jdibenes
Copy link
Owner

jdibenes commented Jun 4, 2024

Open the SampleScene in the Scenes folder.
The main script HoloLens2DA is attached to the Main Camera under the MixedRealityPlayspace object.
SlateBlank contains the quads on which the streams are displayed.

@task-master98
Copy link
Author

I understand now! Thanks a lot for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants