Skip to content
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

GetControllerState giving axis values of 0 #1183

Closed
Hokage3211 opened this issue Aug 22, 2019 · 4 comments
Closed

GetControllerState giving axis values of 0 #1183

Hokage3211 opened this issue Aug 22, 2019 · 4 comments

Comments

@Hokage3211
Copy link

I'm attempting to make a program with the openVR plugin for steamVR in Unity, and the program I want to make in the end requires that hand position/controller inputs are still monitored while the steamVR dashboard is visible, and sadly steamVR prefabs don't work, as whenever I open the steamVR dashboard the hands and headset stop tracking, so I've had to go deeper and use OpenVR functions myself to get this data, and the tracking does work, but I'm having trouble getting the controller state, specifically the finger flexes of the valve index/knuckles controllers.

OpenVR.System.GetControllerState(deviceIndex, ref state, (uint)System.Runtime.InteropServices.Marshal.SizeOf(state));

is my main code line for it, and when attempting to get the state.rAxis0.x or .y and the other axises, it only returns zeros, and I know that I am using the correct device index because I am getting the correct tracking data with the same index value.

Any advice? Or any tips if I'm barking up the wrong tree on how to track hands/controllers/fingers even while dashboard is open?

I would very much appreciate any help or ideas with a fresh set of eyes.

@JoeLudwig
Copy link
Contributor

Hi @Hokage3211

We do not currently support input (using SteamVR Input or the legacy API) going to applications whille the dashboard is visible.

I don't know when or if that will change, but it would help to know more about your use case. Can you tell us what you're using the input for?

Joe

@Hokage3211
Copy link
Author

Essentially, and hoping this isn't going to be stolen as many people have told me this is a good idea, I'm wishing to make a better keyboard by using an Overlay for steamVR desktop/any game that could use the keyboard while in VR, one that uses the finger flexing with the new index controllers to allow people to type multiple keys with different fingers, like natural typing, because right now the steamVR dash keyboard is super slow and clunky, while mine could be used to type at decent words per minute.

I have modified some of the steamVR code so that the overlay works as an actual constant overlay, since right now the plugin doesn't allow working overlays like OVRDrop without modification, but I couldn't have messed up anything like input processing, I don't believe. I used this "fix" which seems to have worked well for allowing the overlay to work without starting up steamVR and making it just a standalone useless application. ValveSoftware/steamvr_unity_plugin#336

Just to humor me, my method does not return the correct axis values even when the steamVR dashboard is closed, so how does steamVR get the finger curl values array populated properly? I've tried looking into the code but I couldn't figure out how to get a proper "handle" value for the getskeletonsummary on openVR, so I couldn't try to reproduce the code/behavior.

@JoeLudwig
Copy link
Contributor

I've heard lots of people suggest the same thing, so if somebody steals it, they probably didn't actually steal it.

A few things:

  1. The SteamVR keyboard isn't currently replaceable. So getting the input from your keyboard into apps might be challenging.
  2. Finger curl values aren't supported any more. The skeleton API is the new way to get this data. You would need to create an action manifest and skeletal actions, and then use the handles for those actions to fetch skeleton or curl data from IVRInput.
  3. Once you can get data from the skeleton API you'll find that it also turns off when the dashboard is up.

I know none of that is good news...

@Hokage3211
Copy link
Author

Well I'm not neccesarily looking to replace the keyboard directly, more just provide an overlay that pops up only when the desktop dashboard thing is open, so people can type fast while in VR finally.

I only need to access the data coming directly from the openvr api/the controllers, which seems to be updated always as far as my tracking workaround has shown, yet getControllerState doesn't seem to work, I'm assuming you mean the function I'm using is not supported anymore? How does steamVR itself get the axis data from the controller, then? It has to, somehow, surely?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants