Closed jagg3127 closed 1 year ago
In points: 1) Download this driver 2) Modify the device (HMD) and controller ( make movements in separate threads ) 3) Don't touch cserverdriver_sample
how would i setup visual studio?
IDK that, I'm working on Linux. With CMake file. If you have CLion I recommend you to use it, if not try QtCreator.
i figured it out there's a project folder in the driver folder i missed it
Install proporties:
ok now I'm lost again, can you be more specific or link me to an article for step number two?
- Modify the device (HMD) and controller ( make movements in separate threads )
@jagg3127 I know it from checking a OpenVR samples. You have: csamplecontrollerdriver - controller class, csampledevicedriver - head motion device. Only these two classes are important for you right now IMO. You need to create new threads for one in each class in which will be:
if (m_unObjectId != vr::k_unTrackedDeviceIndexInvalid) {
vr::VRServerDriverHost()->TrackedDevicePoseUpdated(m_unObjectId, GetPose(), sizeof(DriverPose_t));
}
Where GetPose() is already created function in this code. In GetPose() you write a keyboard movement for a controllers and the same with HMD.
I suggest you to create another thread for controller to capture keys for hand buttons.
If you have more questions, ask ;)
a few questions: how do i define each axis, each button/trigger/touchpad to a keypress? how do i set the mouse to control the axis of the hmd, and use keys to alter front back up down how do i set those keypresses in a different file?
It will be easier for you to change the HalfLifeAlyxNoVR driver, everything is already adapted to the keyboard and mouse https://github.com/r57zone/Half-Life-Alyx-novr hmd and controllers there are immediately attached to the keyboard and mouse, you can also change the buttons under in the configuration file
@r57zone I thought it would be easier but the problem is visual studios has like a billion errors with your cpp code. And the current controls of your half life driver doesnt even control some axis's of things, im trying to use this for vr chat if that helps
IMO it is easier because you have full control over your driver
@jagg3127 in order for the errors to disappear, you need to change the tools and sdk, in the project settings, to yours, then all errors will disappear.
Like this one
its yelling about double to float
These errors are not critical, select "release" and x64 (x86 is usually not used in OpenVR) and press F5, you will have a dll.
i tried adding the driver to steam and it has "connect vr headset" did i set it up wrong?
A) You don't installed your driver B) Driver crashed
i put the driver both into windows 32 and 64 i dont know what im doing so maybe i just did it wrong
those 2 folders replacing the previous
i checked and the driver isnt disabled either
Emm, can you add a cout's in code and start steam from CMD? When you turn on a SteamVR then you will se the cout outputs only with other steam out's ( DebugLog won't show, this is visible only in the web console )
idk what any of that is, just so your aware linux is a billion times better than windows
Do you have basics knowledge of C++ and windows?
never used cpp but i have enough coding knowledge to understand it plus ive also programmed arduinos so i understand that too. Windows is new to me i used to exclusively use linux so getting used to how windows installs things is a challenge at times
actually i should just download linux
Probably, bulidng on windows is hard. cout are a members of
Is saving the library files the same? In both linux and windows
What do you mean?
Like adding the driver to steam
Yes, this is the same
went back to windows with a new pc and now have this error
how would i fix it
wait now no error an no vr screen since i fixed all the float errors
Emm, can you add a cout's in code and start steam from CMD? When you turn on a SteamVR then you will se the cout outputs only with other steam out's ( DebugLog won't show, this is visible only in the web console )
i did that and GetHMDData isnt running at all
"Program Files (x86)"\Steam\steamapps\common\SteamVR\bin\win64\vrcmd.exe --watchdog run DLLMain (line 639) run DLLMain case (line 644) run DLLMain return True (line 727) run DLLMain (line 639) run DLLMain return True (line 727) Unable to init watchdog mode: VRInitError_Init_LowPowerWatchdogNotSupported
i have only written print statements for DLLMain and GetHMDData so far
You have some rarer in code. I Guess that main part of code works, only part of device has home error in it.
how does one fix that?
its only running DLLMain, i added print statements in all other functions DLLMain only runs
I DID IT!! Thank you
I'm trying to make a driver with the ability to map keys kind of like your HalfLifeAlyx driver, but I want to map the keys to control every aspect of the controllers and have the mouse control the HMD (some keyboard buttons too) I just can't figure out where to even start programming my own driver. I'm on windows using visual studio.