NeoToriyama asked to be able to emulate the Vive controllers with an xbox controller. Here is an initial script that takes the input from an xbox 360 controller and sends it to the Hydra to be used in SteamVR:

xbox_vive_emulation_v0.3.2.py.7z

This works fine with sixense_simple3d.exe but after the initial button pushing in SteamVR the xbox controller only acts as an xbox controller.

You do not have the required permissions to view the files attached to this post.

NeoToriyama wrote:Thank you for all the help, it's much appreciated. I'll give it a go. I hope this is the start of better Vive-to-Xbox controller emulation. It can only improve from here on out

I forgot to mention a setting that may need to change. On line two is "i=1". This will probably need to be changed to "i=0" for you. If you test it in sixense_simple3d.exe don't forget to copy over the fake sixence.dll to that folder as well (it's in C:\Program Files (x86)\Steam\steamapps\common\Sixense SDK\SixenseSDK\samples\win32\sixense_simple3d).

So, I was actually able to get the controller to show up in the CyberPong and Budget Cuts! I can move the left controller, but it's pointed away from the screen, but you can rotate it by holding LB and moving the left stick, the right controller works with the trigger, but you can't move at all. You have to move the left stick around sometimes for it to move into the scene. This is a great start!

EDIT: The left controller is inverted as well for rotation, but once you get used to it, it's much easier. I was actually able to start and play a game of Cyber-pong, although I was defeated pretty easily. If we could somehow map the right hand controller to the right stick and the rotation to the of the right controller to rb and get rid of the inverted controls for rotation on both controllers, it would be a huge step forward.

NeoToriyama wrote:So, I was actually able to get the controller to show up in the CyberPong and Budget Cuts! I can move the left controller, but it's pointed away from the screen, but you can rotate it by holding LB and moving the left stick, the right controller works with the trigger, but you can't move at all. You have to move the left stick around sometimes for it to move into the scene. This is a great start!

EDIT: The left controller is inverted as well for rotation, but once you get used to it, it's much easier. I was actually able to start and play a game of Cyber-pong, although I was defeated pretty easily. If we could somehow map the right hand controller to the right stick and the rotation to the of the right controller to rb and get rid of the inverted controls for rotation on both controllers, it would be a huge step forward.

This one should do as you asked. For some reason I can't seem to get it to work in SteamVR (can't even launch a VR game). The right stick was previously set to act as the Vive controller touch pad but it now controls the other controller's movement.

You do not have the required permissions to view the files attached to this post.

Okay awesome thanks, I'll test it out now. That's weird though that you can't get it working. I ran the sixense test you talked about earlier and then as it was open, I launched a game from Steam, I'm not sure if that's why it worked, but I'd say you should give it a try.

It turns out that it wasn't working for me because I was being lazy and trying to use driver_null instead of VRidge (the Hydra calibration probably can't get the position of the HMD when using driver_null).

I've mapped the Hydra bumpers (Vive grips) to the triggers (fully depressed) when RB and LB are pressed. I've also mapped the Hydra sticks (Vive touchpads) to the xbox sticks when RB or LB are pressed and the corresponding triggers are partially depressed.

I added your modification so that you won't need to re-add it.

I noticed that the pitch was assigned to horizontal stick movement and the yaw to vertical movement so I swapped them to make it more intuitive (is that what you meant earlier when you said they were inverted?). Actually, just to check, what are the sizes of the fake sixense.dll files you're using? are they 27kB and 32kB? If not then we're using different versions which behave differently.

You do not have the required permissions to view the files attached to this post.

Oh okay! Well, I'm glad you got it working. I've tested a good amount of games and had some pretty funny experiences trying to play with emulated Vive controllers. The file sizes for the fake .dlls are 16kb (sixense.dll) and 18kb (sixense_x64.dll).

Okay, cool I'll test it out now and see how it performs, and yes that's what I meant by the inverted controls. I'll do some more testing to see how well the new script works.

I've added a condition where if the A button is held down the HMD position can be moved with the left stick and d-pad up/down. Reset it with the left stick button and reset the HMD forward direction (send ctrl+shift+alt+R) with d-pad left. I "ummed-and-ahed" about adding HMD orientation control and decided to add it for completeness. It is similarly controlled by holding the B button but the roll is controlled with the d-pad left/right instead of up/down (I thought it made more sense).

You do not have the required permissions to view the files attached to this post.

Think you can help? It's the same problem many people seem to be having with IMU emulation in SteamVR. After a few minutes, the screen goes black and creates an unfortunate disappointment. The only solution was to create an environment variable to disable the 64 bit version of SteamVR. Can you make a tutorial on how to do so? I'm able to create an environment variable, but what folder/and or file do I target? Any help would be appreciated. I've asked everywhere I could think of with no response.

NeoToriyama wrote:Think you can help? It's the same problem many people seem to be having with IMU emulation in SteamVR. After a few minutes, the screen goes black and creates an unfortunate disappointment. The only solution was to create an environment variable to disable the 64 bit version of SteamVR. Can you make a tutorial on how to do so? I'm able to create an environment variable, but what folder/and or file do I target? Any help would be appreciated. I've asked everywhere I could think of with no response.

How long does it take to go black? If you have it morrored on your monitor do both go black? I haven't been able to replicate this but only have the VRidge trial so am limited to 10 minutes. Does this only happen in games or can it happen if only SteamVR is running?

Are all your drivers for the Hydra and SteamVR up to date?

edit: I found your reddit post. Does this only happen with Leap Motion or does it also happen with the Hydra emulation? PSMoveService is now using a x64 bit version so maybe that's what's needed of the Leap Motion implementation. I don't have a Leap Motion so I can't try it out.

It happens in random intervals and yes it happens with both Hydra emulation and Leap Motion after some time. Different games tend to go black at different times. It only happens with SteamVR games when I'm using IMU emulation. Even if I'm emulating Hydra or Leap Motion during Oculus Rift titles, the screen never goes black. Also, yes they're up to date, but the Leap Motion driver hasn't been updated for almost a month, so I'm assuming you're correct that it isn't using x64 bit version and that's causing the black screen. If I uninstall all the drivers, the SteamVR games never go black. You must be right about the 64bit implementation. As far as disabling the 64bit server, do you know how to do it?

NeoToriyama wrote:It happens in random intervals and yes it happens with both Hydra emulation and Leap Motion after some time. Different games tend to go black at different times. It only happens with SteamVR games when I'm using IMU emulation. Even if I'm emulating Hydra or Leap Motion during Oculus Rift titles, the screen never goes black. Also, yes they're up to date, but the Leap Motion driver hasn't been updated for almost a month, so I'm assuming you're correct that it isn't using x64 bit version and that's causing the black screen. If I uninstall all the drivers, the SteamVR games never go black. You must be right about the 64bit implementation. As far as disabling the 64bit server, do you know how to do it?

I'm not certain how to do it but HipsterSloth posted the following before he pushed the x64 version of PSMoveservice (I never tried it myself).

HipsterSloth wrote:IMPORTANT STEAM VR NOTE
SteamVR just updated today (7/5/2016) making the 64-bit vrserver the default. The problem with this is that I'm not currently building 64-bit version of the plugin yet, though I'm going to fix that soon.

Damn, no dice. It seems as though the issue isn't SteamVR. It may be the actual Leap Motion drivers. It's weird that no one is actively working on them. Unless it's actually that difficult that it isn't worth it. I'm unsure. It seemed to fix the issue with the Hydra emulation so, it must be the Leap Motion drivers that are conflicting with SteamVR.

EDIT: It's definitely the Leap Motion drivers now, tested a few games with Hydra emulation and no black screen after multiple playthroughs.

NeoToriyama wrote:Damn, no dice. It seems as though the issue isn't SteamVR. It may be the actual Leap Motion drivers. It's weird that no one is actively working on them. Unless it's actually that difficult that it isn't worth it. I'm unsure. It seemed to fix the issue with the Hydra emulation so, it must be the Leap Motion drivers that are conflicting with SteamVR.

EDIT: It's definitely the Leap Motion drivers now, tested a few games with Hydra emulation and no black screen after multiple playthroughs.

Just to let you know, I've been trying to build the x64 version but I keep getting errors. I ordered one of those HP keyboards with the LM built in because I found a cheap one so hopefully I'll be able to make some progress.

That's an awesome idea for emulation. I was thinking of making a similar script with a similar approach, but with a standard gamepad. How did you finally tackle the problem of 2x6dof which is 12 axes vs the 4 axes available on the Xbox (and standard) controllers? I was thinking of assuming you always move the Vive/Hydra wands somewhere from your elbows, then you have only 4 dof in total to cover in most cases.

konstantin_lozev wrote:That's an awesome idea for emulation. I was thinking of making a similar script with a similar approach, but with a standard gamepad. How did you finally tackle the problem of 2x6dof which is 12 axes vs the 4 axes available on the Xbox (and standard) controllers? I was thinking of assuming you always move the Vive/Hydra wands somewhere from your elbows, then you have only 4 dof in total to cover in most cases.

In my script the two analogue sticks default to x and y position of the Hydra controllers. When a bumper is held down the corresponding stick controls the yaw and pitch of the corresponding controller. The d-pad is set to change the roll and z position of a controller also when the corresponding bumper is held down.

It seems to work reasonably well and can easily be modified to use the generic `joystick` instead of `xbox360`. One interesting thing to note is that when in the SteamVR menu the real xbox controller input is detected as well as the emulated Vive controllers which can lead to unintentional things happening. I was going to use a DS4 controller instead to try to circumvent this behaviour but then found that the DS4 is also recognised by Steam. I can't find a way to turn off controller support in Steam (which I thought was rather ironic).

Sorry about the late response, I actually haven't been able to fix it, although I'm assuming after research the issue is Riftcat/Vridge. Many people I know that have the actual Rift or Vive don't experience black screens. I even have a friend that has OSVR and he gets no black screens using Leap Motion. I reached out to the devs at Riftcat and they'e aware of the issue and say they will work on the issue in August as they're currently working on the GearVR version.

I've figured why the initialisation of the emulated Hydra controllers does not always work. I had the initial and reset positions set for both controllers as (0,0,0). This meant that they were in exactly the same place which would be impossible if they are supposed to be either side of your head. Ihave now set them to have an offset of +/- 65 in the x direction (eg side by side).

To further help initialisation I have modified the behaviour of the start and back buttons. Now when the either of the bumpers are held, if either the start or back buttons are pressed the start button on both Hydra controllers will be pressed.

I have also swapped the forwards / back positional movement of the controllers because it was anoying me (sorry if anyone liked that configuration).

The default real xbox controller is also now set to use the first instead of the second (i = 0) so hopefully that will be better for most people.

You do not have the required permissions to view the files attached to this post.

Hi, After a lot of trial and error I have kind of got my xbox controller thinking its a Hydra thinking its a vive wand. When Steam VR starts it tells me to point my controller at the base station, i press the left trigger and then the right trigger. Steam then tells me to put the controllers to my head and press both system buttons. the green controller icons then blink and vrserver crashes.

what buttons on the 360 controller do i need to press for the hydra system buttons?

egglego wrote:Hi, After a lot of trial and error I have kind of got my xbox controller thinking its a Hydra thinking its a vive wand. When Steam VR starts it tells me to point my controller at the base station, i press the left trigger and then the right trigger. Steam then tells me to put the controllers to my head and press both system buttons. the green controller icons then blink and vrserver crashes.

what buttons on the 360 controller do i need to press for the hydra system buttons?

any help would be gratefully received.

thanks

Neil.

Like I said in the previous post, to simultaneously press both system buttons hold one bumper and press either start or back. I don't know why it's crashing though because it shouldn't have a time limit for performing this action. Check your log files to see if there's a clue to why it crashes.

it also seems the hydra wont start, program error with steam. i suppose that is normal until everything is setup, or at least normal for those without actual hydras.

hopefully not some other conflict.

will test this shortly.

thank you again

EDIT---
Did the sixsens swap, still nothing show up in steam vr as a usable controller.

Is that normal or should I see "working" controllers in the steam VR window?

SteamVR should believe the Hydra controllers are connected even if the FreePIE script isn't running. To check, did you replaced the DLLs in the folder Steam/steamapps/common/SteamVR Driver for Razer Hydra/hydra/bin?