alvr-org / ALVR

Stream VR games from your PC to your headset via Wi-Fi
MIT License
5.51k stars 488 forks source link

Boneworks hands work BUT they are still on sticks. #135

Closed Supplex44 closed 4 years ago

Supplex44 commented 4 years ago

I've spent the last few hours fiddling with different versions of ALVR, this is the only one where the hands function in boneworks. BUT they still don't line up with where they should be. They are ~10cm down the arm. Is the "Boneworks controllers offset" button supposed to fix it? Because as far as I can tell its not doing anything, even after restarting the server. Any help would be appreciated, I'm out of ideas.

zmerp commented 4 years ago

I implemented the fix as in the guide here: https://steamcommunity.com/sharedfiles/filedetails/?id=1980632821 I do not own Boneworks so I was not able to test if the fix actually works.

Please reset all settings in the Presets tab and try again pressing the Boneworks fix button. If the hands are still in the wrong position, try to play with x, y, z offsets in Other tab. You need to restart ALVR after every changes to make them effective. Post here the offsets you have found, so other can verify if they fix the issue.

Supplex44 commented 4 years ago

@zarik5 I went in and messed with the offsets for a couple hours, they arent quite perfect, but this is what I've got so far: Left position offset (x, y, z) 0.000 0.000 0.150 Left rotation offset (pitch, yaw, roll) -20 0 0

I will mess with this more and see if I can get it a little more accurate. I would love to know if anyone else has this problem, and if this was the solution.

LVollmilch commented 4 years ago

I can make a pull request with the optional fix. Is it just Boneworks that has this problem? The idea is to add a configurable rotation and translation offset for the controllers and to add a new tab with buttons for game specific fixes (that act as presets for other settings).

It's actually not only Boneworks. Maybe this will help you figure it out:

Dunno if anyone has that issue too, but in SteamVR Home the controllers are set off and on sticks just like Boneworks (exactly same offset, and exactly like boneworks, the pointer (to select something on the Screens ingame infront of you) IS NOT set off). They apparantly get their values somewhere else but from the same source. Except for the pointers, they work correctly.

As for other games (Blades & Sorcery, The Lab, small games, etc.) I never experienced issues, but I'm new to VR so couldn't test that much.

Also while taking the screenshots I noticed, that the gadgets seems to be in the right place (as seen in screenshot). Strange. Hope this helps.

Hands On Sticks BONEWORKS 1 Hands On Sticks BONEWORKS 2 Hands On Sticks SteamVR Home Real Life Position Gagdet SteamVR Home Offset

JackD83 commented 4 years ago

I have a suspicion about the hands: In SteamVR, you can ad a skeleton model of the "hand" to your controller. As the touch controller is no hand, we do not set those values and it did work properly so far. I do not know if the Rift S provides those inputs in some form. I can check next week. The fix could be to provide the same input as the Rift S does.

The reason why this could be the case results from my observation with the hand tracking and "Aperture Hand labs". In this game (originally made for the index but working with the Rift S) the controller are not tracked at all with ALVR and the touch controller emulation. With hand tracking and the index controller emulation, tracking of the controller and even finger movement is working. The game has other problems later on, but the tracking is working.

I have to find some time to check this out, but everyone is free to test it

JackD83 commented 4 years ago

My suspicion was right. ALVR is missing the skeletal component to make some games work. I added the component, but I don't know how to set the correct pose on the individual bones. All I get is a garbled mess. The offset can also be set using the skeleton. I'm sure a lot of controller problems are caused by this.

I was following this guide from SteamVR: https://github.com/ValveSoftware/openvr/wiki/Creating-a-Skeletal-Input-Driver

Maybe @zarik5 or @A3yuu have any idea.

I'm pretty sure Half-Life:Alyx won't work without it and a lot of issues will pop up on Monday

zmerp commented 4 years ago

I also tried to add the skeletal component, but the controllers downright disappeared. Surely there is more to do but I don't have time to experiment these days.

Did anyone owning HL:A notice any problem with the controllers?

JackD83 commented 4 years ago

Did anyone owning HL:A notice any problem with the controllers?

Its not working with ALVR for me. I can get trough the first loading screen and then freezes. Plays fine with Oculus Link.

I did some more digging about the skeletal component and got it working. I edited one of the samples to print the current pose of the hands using oculus link. Worked well and I can set that pose using ALVR.

Looks like this: m_boneTransform[0] = { {0.000000, 0.000000, 0.000000, 1}, {1.000000, -0.000000 , -0.000000 , 0.000000} }; m_boneTransform[1] = { {-0.034038, 0.036503, 0.164722, 1}, {-0.055147, -0.078608 , -0.920279 , 0.379296} }; m_boneTransform[2] = { {-0.012083, 0.028070, 0.025050, 1}, {0.464112, 0.567418 , 0.272106 , 0.623374} }; m_boneTransform[3] = { {0.040406, 0.000000, -0.000000, 1}, {0.994838, 0.082939 , 0.019454 , 0.055130} }; m_boneTransform[4] = { {0.032517, 0.000000, 0.000000, 1}, {0.974793, -0.003213 , 0.021867 , -0.222015} }; m_boneTransform[5] = { {0.030464, -0.000000, -0.000000, 1}, {1.000000, -0.000000 , 0.000000 , 0.000000} }; m_boneTransform[6] = { {0.000632, 0.026866, 0.015002, 1}, {0.644251, 0.421979 , -0.478202 , 0.422133} }; m_boneTransform[7] = { {0.074204, -0.005002, 0.000234, 1}, {0.995332, 0.007007 , -0.039124 , 0.087949} }; m_boneTransform[8] = { {0.043930, -0.000000, -0.000000, 1}, {0.997891, 0.045808 , 0.002142 , -0.045943} }; m_boneTransform[9] = { {0.028695, 0.000000, 0.000000, 1}, {0.999649, 0.001850 , -0.022782 , -0.013409} }; m_boneTransform[10] = { {0.022821, 0.000000, -0.000000, 1}, {1.000000, 0.000000 , -0.000000 , 0.000000} }; m_boneTransform[11] = { {0.002177, 0.007120, 0.016319, 1}, {0.546723, 0.541277 , -0.442520 , 0.460749} }; m_boneTransform[12] = { {0.070953, 0.000779, 0.000997, 1}, {0.980294, -0.167261 , -0.078959 , 0.069368} }; m_boneTransform[13] = { {0.043108, 0.000000, 0.000000, 1}, {0.997947, 0.018493 , 0.013192 , 0.059886} }; m_boneTransform[14] = { {0.033266, 0.000000, 0.000000, 1}, {0.997394, -0.003328 , -0.028225 , -0.066315} }; m_boneTransform[15] = { {0.025892, -0.000000, 0.000000, 1}, {0.999195, 0.000000 , 0.000000 , 0.040126} }; m_boneTransform[16] = { {0.000513, -0.006545, 0.016348, 1}, {0.516692, 0.550144 , -0.495548 , 0.429888} }; m_boneTransform[17] = { {0.065876, 0.001786, 0.000693, 1}, {0.990420, -0.058696 , -0.101820 , 0.072495} }; m_boneTransform[18] = { {0.040697, 0.000000, 0.000000, 1}, {0.999545, -0.002240 , 0.000004 , 0.030081} }; m_boneTransform[19] = { {0.028747, -0.000000, -0.000000, 1}, {0.999102, -0.000721 , -0.012693 , 0.040420} }; m_boneTransform[20] = { {0.022430, -0.000000, 0.000000, 1}, {1.000000, 0.000000 , 0.000000 , 0.000000} }; m_boneTransform[21] = { {-0.002478, -0.018981, 0.015214, 1}, {0.526918, 0.523940 , -0.584025 , 0.326740} }; m_boneTransform[22] = { {0.062878, 0.002844, 0.000332, 1}, {0.986609, -0.059615 , -0.135163 , 0.069132} }; m_boneTransform[23] = { {0.030220, 0.000000, 0.000000, 1}, {0.994317, 0.001896 , -0.000132 , 0.106446} }; m_boneTransform[24] = { {0.018187, 0.000000, 0.000000, 1}, {0.995931, -0.002010 , -0.052079 , -0.073526} }; m_boneTransform[25] = { {0.018018, 0.000000, -0.000000, 1}, {1.000000, -0.000000 , -0.000000 , -0.000000} }; m_boneTransform[26] = { {-0.006059, 0.056285, 0.060064, 1}, {0.737238, 0.202745 , 0.594267 , 0.249441} }; m_boneTransform[27] = { {-0.040416, -0.043018, 0.019345, 1}, {-0.290330, 0.623527 , -0.663809 , -0.293734} }; m_boneTransform[28] = { {-0.039354, -0.075674, 0.047048, 1}, {-0.187047, 0.678062 , -0.659285 , -0.265683} }; m_boneTransform[29] = { {-0.038340, -0.090987, 0.082579, 1}, {-0.183037, 0.736793 , -0.634757 , -0.143936} }; m_boneTransform[30] = { {-0.031806, -0.087214, 0.121015, 1}, {-0.003659, 0.758407 , -0.639342 , -0.126678} };

I have now two problems:

I can add static poses, but they will be rather jumpy. I have no Idea how to animate this.

zmerp commented 4 years ago

I think static poses would be a great first step for a next release.

If you want to make a linear interpolation between quaternions you can use the slerp function, as in this stack overflow thread using the Eigen library. I could do this, but I think there are more pressing problems, like making HL:A work.

lyndonguitar commented 4 years ago

I also tried to add the skeletal component, but the controllers downright disappeared. Surely there is more to do but I don't have time to experiment these days.

Did anyone owning HL:A notice any problem with the controllers?

Me, I have an minor issue with HL:A using ALVR. as opposed to VD and Oculus Link counterparts, the finger tracking for ALVR doesn't just work. Doing/Not soft touch on buttons should slightly curl/point individual fingers, but they don't. The fingers are just stationary up until you interact with something.

There is a mapping for it for the "Hand" section in the steamVR binding settings, and when testing the controllers, SteamVR properly detects soft touch inputs from ALVR, but it seems that the anything i set up in that section doesn't work. Weird as Oculus Rift S works fine, as well as Oculus Quest through Link and VD. image

JackD83 commented 4 years ago

Please try the attached driver dll. I added the hand skeleton and poses are the same as with link. Its missing the animation between the poses and analog trigger and joystick have no influence on the pose.

driver_alvr_server.zip

LVollmilch commented 4 years ago

I also tried to add the skeletal component, but the controllers downright disappeared. Surely there is more to do but I don't have time to experiment these days.

Did anyone owning HL:A notice any problem with the controllers?

It works damn fine, except for the finger issue already described. Pleasantly suprising.

JackD83 commented 4 years ago

@zarik5 added the missing animations. Please test the dll driver_alvr_server.zip

If it works without adding the controller offset in boneworks, we can remove the hack

LVollmilch commented 4 years ago

@zarik5 added the missing animations. Please test the dll driver_alvr_server.zip

If it works without adding the controller offset in boneworks, we can remove the hack

FUCKING NICE! Thank You!

https://youtu.be/3TWfWOn1E4U

it just works.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.