Git Product home page Git Product logo

hololens2-unity-researchmodestreamer's Introduction

HoloLens2-Unity-ResearchModeStreamer

Unity Plugin for accessing HoloLens2 Research Mode sensors and video camera, and streaming them to desktop. It builds upon the official HoloLens2ForCV and HoloLensForCV repos.

Currently, only Depth AHAT and video camera streams are enabled, but an extension to other RM sensors should be straight forward and will probably be added in the future. The image, as well as rig2world transforms for AHAT and and pv2world, fx and fy for video camera are transmitted for each frame.

Dependencies

Plugin

Using the Plugin

  1. Open the plugin solution in Visual Studio
  2. Add path to Eigen under Project -> Properties -> C/C++ -> General -> Additional Include Directories or copy the folder containing Eigen headers to HL2RmStreamUnityPlugin/Dependencies.
  3. Build the solution for Release, ARM64.
  4. In your Unity Project, create a folder Assets/Plugins/WSAPlayer/ARM64.
  5. Copy the HL2RmStreamUnityPlugin.dll from HL2RmStreamUnityPlugin/ARM64/Release/HL2RmStreamUnityPlugin into the folder from step 3.
  6. To call the Initialize function from the DLL, add this statement to one of your Unity scripts:
[DllImport("HL2RmStreamUnityPlugin", EntryPoint = "Initialize", CallingConvention = CallingConvention.StdCall)]
public static extern void InitializeDll();
  1. You can call InitializeDll() from Unity. An example can be found in UnityHL2RmStreamer.
  2. Before building the Unity Project, go to Build Settings -> Player Settings the following Capabilities are enabled:
    • InternetClient, InternetClientServer, PrivateNetworkClientServer, WebCam, SpatialPerception.
  3. Build the Unity Project and open the solution in Visual Studio.
  4. After building the Unity Project for the first time: Open the package.appxmanifest in the solution in a text editor to enable the research mode sensors:
    • add the rescap package to Package: xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
    • add rescap to the Ignorable Namespaces: IgnorableNamespaces="... rescap"
    • add rescap to Capabilities: <rescap:Capability Name="perceptionSensorsExperimental" />
    • save and close Package.appxmanifest
  5. Build solution for Release, ARM64 and deploy to HoloLens2.

Python Client

A simple client written in python for receiving and displaying the frames is available in hololens2_simpleclient.py.

hololens2-unity-researchmodestreamer's People

Contributors

cgsaxner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.