Coder Social home page Coder Social logo

omnifinity / openvr-tracking-example Goto Github PK

View Code? Open in Web Editor NEW
118.0 118.0 21.0 13.12 MB

C++ example on how to connect to OpenVR as a background process and acquire tracking data and controller states.

License: BSD 3-Clause "New" or "Revised" License

C++ 98.03% C 1.97%

openvr-tracking-example's People

Contributors

peroht avatar petethor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openvr-tracking-example's Issues

Can't install

Getting following error:
unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? HTC Lighthouse Tracking Example d:\openvr-tracking-example-master\openvr-tracking-example-master\htc lighthouse tracking example\lighthousetracking.cpp 445

Sampling frequency

Thanks for your helpful contribution!
We're writing some of the output to a file, in order to analyze it later. By doing so, it looks like the sampling frequency is around 10Hz. Are we right? If so, is it possible to increase this easily?
I'm only starting to work with OpenVR/C++ - so bear with me if this is an uninformed question.
Thanks a bunch!

Potential MIT License?

Hi! I'd like to use your code but there currently isn't any form of licensing. Is there any chance you would consider a permissible license like MIT?

Unable to compile..

I am getting error LNK2019 when trying to compile, here are the steps I have taken:

  1. Downloaded and extracted the source code
  2. Downloaded openvr source code and extracted it to the "HTC Lighthouse Tracking Example" project folder
  3. Copied openvr_api.dll from PlaySpaceMover to the "HTC Lighthouse Tracking Example" project folder
  4. Changed line #6 of LightHouseTracking.h to #include "headers\openvr.h"
  5. Disabled Precompiled Header in Properties > C/C+ > Precompiled Headers
    082646
    Any help is much appreciated, I would love to get this working.

Getting Error: 3

Hello, thank you very much for sharing this project.
After following all steps I get an error message: Error: 3.
This error seems to correspond to VRInputError_InvalidHandle = 3, defined in openvr.h.
The handle you pass in line 723 of LighthouseTracking.cpp is vr::k_ullnvalidInputValueHandle:

0723: inputError = vr::VRInput()->GetPoseActionDataForNextFrame(m_actionDemoHandLeft, vr::TrackingUniverseStanding, &poseData, sizeof(poseData), vr::k_ulInvalidInputValueHandle);

To fix this problem I am tempted to pass a valid handle. However, I suspect your code is all right.
Do you have a guess what I am doing wrong?

You find the command shell output below.

with my build

C:\1_Projekte\61_SteamVR\2_OpenVR_Example\OpenVR-Tracking-Example-master\Debug>"HTC Lighthouse Tracking Example.exe" --calccontrollerdeltapos 1

vive_debugger v1.5 by Omnifinity in 2020
Using openvr 1.9.16

Showing data for all devices
Successfully initialized VR Compositor
Successfully set manifest path: C:/1_Projekte/61_SteamVR/2_OpenVR_Example/OpenVR - Tracking - Example - master/Release/win32/vive_debugger_actions.json
Successfully got /actions/demo action set handle: 297
Successfully got /actions/demo/in/Hand_Left handle: 298
Successfully got /actions/demo/in/Hand_Right handle: 299
Successfully got /actions/demo/in/AnalogInput handle: 300
Successfully got /actions/demo/in/HideCubes handle: 301
Successfully got /actions/demo/in/TouchAction handle: 302
Successfully got /actions/demo/in/ClickAction handle: 303
Successfully got /user/hand/left input handle: 9
Successfully got /user/hand/right input handle: 10

Device list:
Device 0: Class: [HMD] HTC - VIVE_Pro MV [LHR-FAD0DC88] can power off: 0
Device 1: Class: [TrackingReference] Valve Corporation - Valve SR [LHB-2B0740F3] can power off: 0
Device 2: Class: [TrackingReference] Valve Corporation - Valve SR [LHB-2085BA6B] can power off: 0
End of device list

Press 'q' to quit. Starting capture of tracking data...

/actions/demo | UpdateActionState(): Ok
/actions/demo/in/AnalogInput | GetAnalogActionData() Not Ok. Error: 3
/actions/demo/in/HideCubes | GetDigitalActionData() Not Ok. Error: 3
/actions/demo/in/TouchAction | GetDigitalActionData() Not Ok. Error: 3
/actions/demo/in/ClickAction | GetDigitalActionData() Not Ok. Error: 3
/actions/demo/in/Hand_Left | GetPoseActionData() Call Not Ok. Error: 3
(lx, ly, lz) = (0.000, 0.000, 0.000) | (rx, ry, rz) = (0.000, 0.000, 0.000) | (dX, dY, dZ) = (0.000, 0.000, 0.000)

with your build

C:\1_Projekte\61_SteamVR\2_OpenVR_Example\OpenVR-Tracking-Example-master\Binary\Release_openvr1.9.16\Release\win32>vive_debugger.exe

vive_debugger v1.5 by Omnifinity in 2020
Using openvr 1.9.16

Showing data for all devices
Successfully initialized VR Compositor
Successfully set manifest path: C:/Users/pt/Documents/Visual Studio 2013/Projects/HTC Lighthouse Tracking Example/Release/win32/vive_debugger_actions.json
Successfully got /actions/demo action set handle: 472
Successfully got /actions/demo/in/Hand_Left handle: 473
Successfully got /actions/demo/in/Hand_Right handle: 474
Successfully got /actions/demo/in/AnalogInput handle: 475
Successfully got /actions/demo/in/HideCubes handle: 476
Successfully got /user/hand/left input handle: 9
Successfully got /user/hand/right input handle: 10

Device list:
Device 0: Class: [HMD] HTC - VIVE_Pro MV [LHR-FAD0DC88] can power off: 0
Device 1: Class: [Controller] HTC - VIVE Controller Pro MV [LHR-889DEB56] can power off: 1
Device 2: Class: [TrackingReference] Valve Corporation - Valve SR [LHB-2085BA6B] can power off: 0
Device 3: Class: [TrackingReference] Valve Corporation - Valve SR [LHB-2B0740F3] can power off: 0
Device 4: Class: [Controller] HTC - VIVE Controller Pro MV [LHR-E8B85D51] can power off: 1
End of device list

Press 'q' to quit. Starting capture of tracking data...

/actions/demo | UpdateActionState(): Ok
/actions/demo/in/AnalogInput | GetAnalogActionData() Not Ok. Error: 3
/actions/demo/in/HideCubes | GetDigitalActionData() Not Ok. Error: 3
/actions/demo/in/Hand_Left | GetPoseActionData() Call Not Ok. Error: 3

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.