openvr icon indicating copy to clipboard operation
openvr copied to clipboard

Combination of openvr.h and openvr_driver.h

Open tomassykora opened this issue 7 years ago • 5 comments
trafficstars

I'm building an application based on openvr.h. In the application I need to exit the whole steamVR app. I found here 473 how to do it:

vr::VREvent_Reserved_t data = { 0, 0 };
vr::VRServerDriverHost()->VendorSpecificEvent(m_unObjectId, vr::VREvent_DriverRequestedQuit, (VREvent_Data_t&)data, 0);

The problem is, that this function is from openvr_driver.h and my project won't build with it because there are lots of redefinitions in the header. Is there a way how to solve this? Is there a different way of exitting steamVR?

By exitting the steamVR I'm solving a situation, when my application is running with let's say 2 connected Vive trackers, then I close the application and start it with only 1 tracker. But in steamVR (which was still running when my application wasn't) there are still two trackers present, which I don't want to. I need the steamVR application to be clean like it is when I newly start it. That's why I want to exit steamVR. So if you know about another solution for this situation, I'd really appreciate it.

tomassykora avatar Jul 05 '18 10:07 tomassykora

The driver header is for drivers, so you won't be able to use it. You could make a trivial "do nothing" driver that your app can talk to via the debugRequest() API to get it to send the event. Or, if that's too complicated you can go for something like "AdvancedSettings" is doing (download the source and explore).

TheDeveloperGuy avatar Jul 05 '18 10:07 TheDeveloperGuy

@TheDeveloperGuy What do you mean by "AdvancedSettings"? I searched the code and I'm not still sure what that should be.

tomassykora avatar Jul 09 '18 07:07 tomassykora

https://github.com/matzman666/OpenVR-AdvancedSettings

TheDeveloperGuy avatar Jul 09 '18 07:07 TheDeveloperGuy

I am having similar issue. I created my own driver through openvr_driver.h.

Now, I need to know total number of controller devices in the system. Which can be easly done via VRInit through openvr.h. But, due to the redefinitions I didnt manage it.

I also tried to create another DLL project that returns the number of connected controllers. If I trigger the DLL through my driver, VRInit returning error.

I understand that it is not possible. My intention is to keep my controller as the third device always since it doesnt have enough functionality to control my avatar. I want to have HTC controllers to be the controllers the first and second.

Is there a way to get my controller as third device in the system Or wait until first two controllers linked?

farabiahmed avatar Mar 06 '19 22:03 farabiahmed

I've encountered this issue too, the fact that we can get the pose from other devices with their handle from openvr-driver.h but not any information about them that could help us identify what they are is mind-boggling to me. The fact that we can't include both openvr_driver.h and openvr.h locks us in a situation where we can get the data but we're compeltely blind...

Kanken6174 avatar Mar 20 '22 08:03 Kanken6174