New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Treadmill devices #937

Open
AgentMilkshake1 opened this Issue Nov 15, 2018 · 23 comments

Comments

Projects
None yet
6 participants
@AgentMilkshake1
Copy link

AgentMilkshake1 commented Nov 15, 2018

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

This comment has been minimized.

Copy link

kbigdelysh commented Nov 15, 2018

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

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Nov 15, 2018

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

This comment has been minimized.

Copy link

kbigdelysh commented Nov 15, 2018

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

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Nov 16, 2018

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

This comment has been minimized.

Copy link

kbigdelysh commented Nov 16, 2018

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

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Nov 16, 2018

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

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Nov 22, 2018

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

This comment has been minimized.

Copy link
Contributor

JoeLudwig commented Nov 27, 2018

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

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Nov 27, 2018

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

This comment has been minimized.

Copy link
Contributor

JoeLudwig commented Nov 27, 2018

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

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Nov 27, 2018

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

This comment has been minimized.

Copy link
Contributor

JoeLudwig commented Nov 27, 2018

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

@AgentMilkshake1

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Nov 27, 2018

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?

@Skaarah

This comment has been minimized.

Copy link

Skaarah commented Dec 1, 2018

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

@AgentMilkshake1

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Dec 2, 2018

@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.

@Skaarah

This comment has been minimized.

Copy link

Skaarah commented Dec 3, 2018

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

@AgentMilkshake1

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Dec 3, 2018

@Skaarah Fantastic, great to hear!

@JoeLudwig

This comment has been minimized.

Copy link
Contributor

JoeLudwig commented Dec 3, 2018

@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

This comment has been minimized.

Copy link

cwlmyjm commented Dec 5, 2018

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

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Dec 5, 2018

@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

This comment has been minimized.

Copy link

peroht commented Dec 5, 2018

@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

This comment has been minimized.

Copy link

peroht commented Dec 6, 2018

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

@AgentMilkshake1

This comment has been minimized.

Copy link
Author

AgentMilkshake1 commented Feb 21, 2019

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment