Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

KinectToVR/k2vr-application

Repository files navigation

DEPRECATED, WILL BE REPLACED WITH AMETHYST

The K2QT projects and wikis were removed, stick back to K2EX for now
This repo is gonna hold KinectToVR's SteamVR driver & K2API until then

Don't worry, removed files are still in the commit history


KinectToVR API (w/ OpenVR driver)

Current KinectToVR API is also a bit deprecated and not version-interchangeable,
due to boost serialization dependency. If you really really wanna use it, please try
looking around in the wiki and find out how to use it for yourself.
(Though I may help a bit when asked to... Don't guarantee how much is a bit tho, heh)
The OpenVR/SteamVR driver protocol has also changed in amethyst (KinectToVR >1.0)

Build instructions

  1. Note: Repository may be chaotically updated, please check out
    repository before posting an issue with building or missing files.

  2. Prerequisites

    • Visual Studio 2019 (Personally, I'm on VS2019 Preview, probably latest)
  3. Set up the project

    • Take a deep breath and make yourself some coffee,
      it's gonna take some time to set up all vcpkg packages.
      (About 1-1.5 hour if you have 300-500mbps internet and a hdd)

    • Clone the latest OpenVR, GLM and Eigen3 into external/:
      git clone https://github.com/ValveSoftware/openvr external/openvr
      git clone https://gitlab.com/libeigen/eigen external/eigen git clone https://github.com/g-truc/glm external/glm

    • Fix min/max error in GLM (unresolved with NOMINMAX for now) sed -i '/#include <limits>/c\#include <limits>\n\n#undef min\n#undef max' external/glm/glm/gtx/component_wise.inl

    • Install vcpkg and its Visual Studio integration
      git clone https://github.com/Microsoft/vcpkg.git
      cd vcpkg
      ./bootstrap-vcpkg.sh
      ./vcpkg integrate install

    • Install needed libraries (You should choose one linking method for all packages)
      vcpkg install boost:x64-windows opencv3[world]:x64-windows cppzmq:x64-windows curlpp:x64-windows
      (Now you may rest a bit, also consider using a drive other than C:/, it'll be about 6-7GB)

    • Setup GLog
      git clone https://github.com/google/glog.git external/glog
      git reset --hard f8c8e99fdfb998c2ba96cfb470decccf418f0b30
      cd external/glog
      mkdir vcbuild; cd vcbuild
      cmake -DBUILD_SHARED_LIBS=ON ..
      msbuild glog.vcxproj "/p:Configuration=Release;Platform=x64
      WindowsTargetPlatformVersion=10.0"

    • Setup GFlags
      git clone https://github.com/gflags/gflags.git external/gflags
      git reset --hard 827c769e5fc98e0f2a34c47cef953cc6328abced
      cd external/gflags
      mkdir vcbuild; cd vcbuild
      cmake -DBUILD_SHARED_LIBS=ON ..
      msbuild gflags.vcxproj "/p:Configuration=Release;Platform=x64;WindowsTargetPlatformVersion=10.0"

  4. Build and deploy

    • Make sure you're building for x64 platform in release mode

    • Click Build → build all and wait for the build to finish

    • All needed dlls from vcpkg should be automatically moved to deploy directory
      (For general it's x64/Release/ and for driver x64/Release/driver/
      You can find there KinectToVR driver fully set-up and ready to be registered.)

Debugging OpenVR driver

  1. Change run command in project properties, selecting your SteamVR installation path.
    (Must be the path to vrserver.exe file in current SteamVR installation directory)

  2. Remove driver dll from [K2Driver]/bin/win64 and create a hard link:
    ([K2Driver] stands for driver's deployment directory, it possibly is k2vr-application/x64/Release/driver/KinectToVR)

    • Open cmd and navigate to OutDir
      (Where you've built your binaries, possibly in x64/Release)
    • Delete driver_KinectToVR.dll from [K2Driver]/bin/win64 and keep the rest
    • Create a hard link: New-Item -ItemType HardLink -Name "[K2Driver]/bin/win64\driver_KinectToVR.dll" -Value driver_KinectToVR.dll where [K2Driver] possibly stands for ./driver/KinectToVR
  3. Click on driver_KinectToVR project and select Debug→Start New Instance
    You may turn on profiling tools (mostly for CPU) and experiment with the debugger right after.