ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.07k stars 1.28k forks source link

Support for Treadmill devices #937

Closed AgentMilkshake1 closed 5 years ago

AgentMilkshake1 commented 5 years ago

Hi there,

I've written about this before, but I'm still to receive any response from the development team on a timeline for treadmill device support.

Currently it seems that the new input binding system only allows for 2 controllers (left and right motion controller) for any 1 HMD.

Are there plans in the near future to add support for a third input device. This would allow a treadmill device trackpad/thumbstick input to project onto a left or right motion controllers trackpad/thumbstick whilst still being able to use both motion controllers at the same time.

This problem has been identified by many developers and we are still yet to see any feedback on the matter.

923

886

856

826

This is clearly possible as we are able to send a gamepad's input to motion controllers trackpad/thumbstick. Could we please get a patch soon to allow this as it is preventing many VR devices from working with Steam VR.

Many thanks

kbigdelysh commented 5 years ago

You can write a driver for OpenVR and achieve that (I've written a driver for our own custom controllers that works alongside of Vive controllers). It's not that hard. There is a sample driver here.

AgentMilkshake1 commented 5 years ago

Hi @kbigdelysh ,

I've written a driver for a custom device using this exact sample, but games/apps only bind to this input when one of the motion controllers are turned off (the one you are binding to) or if you give your controller a higher priority (in which case you cannot use any of the inputs on the lower priority motion controller).

There are many developers who have tried doing the same thing so if you could provide a more thorough example that would be great.

Thanks

kbigdelysh commented 5 years ago

We had a similar issue. Make sure your custom controller is not occupying the right or left controller role. To do this, change the following in the null driver example:

vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, Prop_ControllerRoleHint_Int32, TrackedControllerRole_RightHand)

to:

vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, Prop_ControllerRoleHint_Int32, TrackedControllerRole_OptOut)

This change solved our issue.

AgentMilkshake1 commented 5 years ago

Thanks for this feedback. Unfortunately this is exactly how the project has been setup for months now, and it doesn't work.

Was it only that specific change for you that got it working?

kbigdelysh commented 5 years ago

For me, yes but also make sure your json files in C:\Program Files (x86)\Steam\steamapps\common\[Your-Driver]\resources\input\ have been modified correctly.

AgentMilkshake1 commented 5 years ago

They are, Steam VR receives all of the input and I can confirm that if I were to change it to left or right hand, and then turn off said motion controller, Steam VR binds the custom device to the game.

Unfortunately, when the device is marked as opt out, SteamVR detects the input (and it shows up in the input debugger) but games do not bind.

This isn't my first rodeo :P

AgentMilkshake1 commented 5 years ago

The only way that I've found to support a treadmill device (which is very hit and miss) is as a generic tracker rather than a controller.

However, this is very unstable as sometimes you'll run SteamVR and the tracker with scalar inputs will work as expected, able to bind to trackpad/thumbstick without a problem, inputting at the same time as using motion controllers. Most the time though, the driver will not work, the tracker will not be listed as connected in the manage trackers menu, and will not bind.

A stable solution does not seem to exist currently.

JoeLudwig commented 5 years ago

The latest SDK adds the start of treadmill support: https://github.com/ValveSoftware/openvr/releases/tag/v1.1.3

Once your treadmill starts coming in as /user/treadmill it should work well in the binding UI. The game will receive analog values for whatever x/y values are furthest from 0,0, so I would expect the treadmill and trackpad to work at the same time.

AgentMilkshake1 commented 5 years ago

Hey @JoeLudwig ,

Thanks for the update to the SDK, I'll be checking out the changes soon. Ironically it comes days after finishing implementation of our driver as a generic tracker with scalar input components! haha

I'm guessing it would probably be ideal for us to transition over to this new implementation?

JoeLudwig commented 5 years ago

It will probably help, but give it a try and tell me what you think.

The treadmill role currently requires that the device in question be a controller. I'd rather stick with that unless it turns out to cause a bunch of problems.

AgentMilkshake1 commented 5 years ago

Sounds good to me - I've already made the changes back to controller and added the specifier as treadmill (controller role hint right?) - just waiting on the compiler issue for openvr_driver.h which I know you've already seen and assigned.

I'll let you know how my testing goes once that change has been submitted to openvr_driver.h

JoeLudwig commented 5 years ago

We'll try to get the driver file fixed soon. In the meantime you can hack a fix into the file yourself.

AgentMilkshake1 commented 5 years ago

From my limited tests so far, it works exactly as expected. Thank you so much for working on this feature.

2 things: 1) Can I suggest for the near future that we leave this issue open, just in case any new bugs crop up, and to give much more visibility for developers looking for this.

2) Would you like me to write a short "How to document" for creating a treadmill like device driver? I could write it on Google Docs in the next couple of days, link it here for you to look over, and then you could copy paste it onto the OpenVR wiki for community reference?

catgirlkara commented 5 years ago

Please, I would love to see a working implementation. I still haven't got my device to work.

AgentMilkshake1 commented 5 years ago

@Skaarah Hey, I'm hoping to create an example driver in the near future (next couple of weeks). Shouldn't take me long at all to put together, it's just a case of finding the time!

Can you drop me an email at the following email address:

sam [AT] relative-dimensions.com

Got a few people already interested so I'll do an email to all when it's ready.

catgirlkara commented 5 years ago

I managed to get it working! I missed that there was a new controller role for treadmill. Now my software finally works.

AgentMilkshake1 commented 5 years ago

@Skaarah Fantastic, great to hear!

JoeLudwig commented 5 years ago

@Skaarah @AgentMilkshake1 @kbigdelysh @SamRelativeDimensions

Where do we stand with overall treadmill support now that we have the treadmill controller role? What remains to make treadmills be a smooth experience for users?

cwlmyjm commented 5 years ago

I have done a sample with latest openvr, trackpad is workable. But fail on creating system click component, wiki said that component is not available to applications. I have tried to create binding file to bind that component to /actions/legacy/in/left_system_press (also try right_system_press) like what vive controller does but not work. Inside input debugger, it get the signal but dashboard not summon.

AgentMilkshake1 commented 5 years ago

@JoeLudwig I've been speaking with some developers who use/intend to use the treadmill functionality. There has been some interest in whether it would be possible to allow game developers to utilise all 3 "thumbstick" paths for true treadmill support.

For instance, game developers might want to setup a treadmill mode in their game where the treadmill thumbstick input feeds into the movement of the character, the right controller thumbstick/trackpad feeds into rotating the character, and the left thumbstick/trackpad acts as a radial menu.

I'm not sure how possible this is (would probably require some new features in both UE4 and Unity's SteamVR SDK) but there is some interest.

The only other mention I've seen so far about things not working as expected is cwlmyjm's post above.

peroht commented 5 years ago

@JoeLudwig thanks guys for this implementation - we've (Omnifinity) have been waiting for this for a long time before the inception of the Vive and the initial efforts on this topic in OSVR. Glad this work is taken further in the Khronos Group and we do not have to hack/overwrite device values using the fantastic work done by matzman666 in https://github.com/matzman666/OpenVR-InputEmulator.

What remains to make treadmills a smooth experience for users?

This is how I see a path forward - please feel free to comment on how you see it @Skaarah @AgentMilkshake1 @kbigdelysh @SamRelativeDimensions.

The first step toward this is now implemented in openvr/steamvr - this is greate news. As a second step this means that we - as hardware manufacturers - can begin to adress our fragmentation of how character movement in games is implemented. The thirds step is for us to agree on a set of typical scenarios/recommendations on how game developers should go about when implementing locomotion driven by our various locomotion devices. The forth step is not rocket science. It basically constitutes of us manufacturers being a unified force. This will hopefully make it easier and more interesting for game developers to implement treadmill locomotion in their standard locomotion options. This is something that I belive has stifled support due to this being super niche.

From the perspective of the Omnideck a game developer using e.g. Unity would typically implement the simplest form of character movement by moving the [CameraRig] using X/Y Axis analogue values representing [m/s]. It is clear to see that the key for us is to match the "real" locomotion speed of the human with the virtual speed in the game. For this reason we do not recommend e.g. discrete input such as WASD on our devicer or excessive movement multiplication factors.

Today, games like Onward/Pavlov allows the player to alter/rotate their forward direction. For the Omnideck this is a negative and undesired functionality. The same goes for snap turning. As I see it, we should - for each locomotion device - recommend to the game developers on how to best implement support for each device, just as @AgentMilkshake1 describes in the post above.

As a good reference, the game "Talos Principle" has got a locomotion called "Fixed Playspace". This mode is quite representative of how our device would control a game. The calibrated playspace and the in-game coordinate systems are always aligned with no hand controllers affecting the camera/character rotation.

Thanks.

peroht commented 5 years ago

@JoeLudwig I've managed to dive into this on a technical level and implement this for the Omnideck. Will report on progress later.

AgentMilkshake1 commented 5 years ago

Hey everyone!

A new potential feature request for Treadmill devices - allowing for input "curve editing" of the joystick component in the same way that you can edit the deadzone etc. for Gamepad's in Big Picture Mode.

@JoeLudwig Is this something we could expect to see in the near future? Thanks!

AgentMilkshake1 commented 5 years ago

Hi all,

Myself and other developers have recently started noticing that Treadmill support has been compromised in recent updates.

I've personally not been very active with OpenVR development over the past few months, but I've recently had reports that since the Valve Index has launched many games have updated their SteamVR input systems (a requirement to support Valve Index). As a part of this, game developers are now able to filter actions depending on source (right hand, left hand, any). This means that actions created by game developers are only usable by Treadmill devices in the case that the game developer chooses ANY. This is a massive step back for Treadmill developers, as many game developers won't realise the impact their choice at dev level is having at the wider market level. A lot of games previously supported by treadmills are beginning to dwindle in numbers due to this oversight.

We had a brief period where Treadmill devices were becoming quite universal in terms of compatibility, but these recent updates have really damaged the support Treadmill device developers can offer!

@JoeLudwig What is being done by the OpenVR team to remedy this? Were the team aware that this would be a problem?

JoeLudwig commented 5 years ago

This issue is giant and mostly has nothing to do with SteamVR Input games filtering input by device. Please open a new issue.