Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

DEPRECATED - C++ library to fetch Hololens 2 sensors data and be used in Unity applications thanks to C# bindings.

License

Notifications You must be signed in to change notification settings

SolarFramework/SolARUnityClientHololens2Plugin

Repository files navigation

DEPRECATED - This repo is no longer maintained


SolARUnityClientHololens2Plugin

License

Description

This project is a C++ library which retrieves Hololens 2 sensor data: images, poses and timestamp from the cameras. It also provides a C# binding which makes it usable in Unity.

This project is based on HoloLens2-ResearchMode-Unity (MIT license), and HoloLens2ForCV StreamRecorderApp (MIT license)

How to use in Unity

Build native plugin and import to Unity

  • Build this project (ARM64,Release) and copy the .dll and .winmd files into Assets/Plugins/WSA/ARM64 folder of your Unity project.
  • Change the architecture in your Unity build settings to be ARM64.
  • After building the visual studio solution from Unity, go to App/[Project name]/Package.appxmanifest and add the restricted capability to the manifest file.
<?xml version="1.0" encoding="utf-8"?>
<Package 
...
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" 
...
IgnorableNamespaces="... rescap ..." 
...
>
... 
<Capabilities>
...
<rescap:Capability Name="perceptionSensorsExperimental" />
<DeviceCapability Name="webcam" />
...
</Capabilities>
...
</Package>
  • Save the changes and deploy the solution to your HoloLens 2.

Use in your app

  • Instanciate the SolARHololens2ResearchMode object by calling its default constructor.
  • Start by calling the Enable*() methods corresponding to the sensors to be used and then Init(), in your Start() method for example
  • Call Update() periodically to fetch new frames
  • Frame data are returned by calling the Get*Data() methods for each sensor.

About

DEPRECATED - C++ library to fetch Hololens 2 sensors data and be used in Unity applications thanks to C# bindings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published