[go: nahoru, domu]

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

Add suppport for Meta Quest Touch Pro controllers (fix #5138) #5139

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

dmarcos
Copy link
Member
@dmarcos dmarcos commented Oct 19, 2022

I noticed there's not a button mapping profile on the webxr repository. I'm assuming the mapping is the same as the previous touch controllers.

To test you can use the example below:

npm start and load http://localhost:9000/showcase/ui/

I haven't look at the model but if parts are separated we could also animate / highlight the buttons, trigger when pressed in a separate PR.

@cabanier Let me know if it works for you. Thanks so much for testing and congrats on the Quest Pro release. It looks awesome.

@cabanier
Copy link
Contributor

I noticed there's not a button mapping profile on the webxr repository. I'm assuming the mapping is the same as the previous touch controllers.

The new controller's buttons are a superset of the old touch controller so that should be fine

I haven't look at the model but if parts are separated we could also animate / highlight the buttons, trigger when pressed in a separate PR.

@felixtrz noticed that aframe has code to animate those. Yes, it would be awesome if we can add that. Will you (or someone you know) have access to a Quest Pro

@cabanier Let me know if it works for you. Thanks so much for testing and congrats on the Quest Pro release. It looks awesome.

Thanks!

Copy link
Contributor
@cabanier cabanier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add logic to use the fallback controller? That way if someone comes out with a new controller, aframe can still use an older controller that is compatible.

@dmarcos
Copy link
Member Author
dmarcos commented Oct 19, 2022

The laser-controls component used in the example I pointed above http://localhost:9000/showcase/ui/ has the fallback to a generic controller.

@dmarcos
Copy link
Member Author
dmarcos commented Oct 19, 2022

The new controller's buttons are a superset of the old touch controller so that should be fine

Are there any new buttons we should map?

@felixtrz noticed that aframe has code to animate those. Yes, it would be awesome if we can add that. Will you (or someone you know) have access to a Quest Pro

Not easily but can ask around. If there's a device loaner program at Meta it will make it a bit easier for this and future work.

@dmarcos
Copy link
Member Author
dmarcos commented Oct 19, 2022

Never mind. I found the button mapping profile in the meta directory. It looks it's the same than other Touch controllers. We should be good

@cabanier
Copy link
Contributor

The new controller's buttons are a superset of the old touch controller so that should be fine

Are there any new buttons we should map?

No, the other "buttons" are for drawing your index finger and thumb

Not easily but can ask around. If there's a device loaner program at Meta it will make it a bit easier for this and future work.

I will ask. :-)

@felixtrz
Copy link
Contributor

Tested http://localhost:9000/showcase/ui/ on Quest Pro, the controllers are picked up and working (trigger events are registering, target ray seems correct), but no quest pro controller model is rendered, only a sphere, is that expected?

procontrolleraframe.mp4

@felixtrz
Copy link
Contributor

@dmarcos I did some digging and found where the problem is. The isControllerPresent() in tracked-controls.js is checking and categorizing the type of controller by idPrefix, which is why meta-quest-touch-pro never gets matched as oculus-touch-controls, and that's why it gets matched into the generic control every time. You might need to make an exception in the isControllerPresent to allow meta-quest-touch to be matched as oculus-touch as well.

@dmarcos
Copy link
Member Author
dmarcos commented Oct 20, 2022

@felixtrz Sorry for the inconvenience. Thanks for testing and patience.

I generalized the logic that loads the model. I think it should work now. If it doesn't. Can you add a breakpoint here and let me know what profiles you see in controller.profiles? You'll need to enter VR so controllers show up.

@Srile
Copy link
Contributor
Srile commented Oct 20, 2022

@cabanier and I did some digging and figured out the cause of the bug.

The issue is caused by the GAMEPAD_ID_WEBXR variable for the meta devices changing from oculus-touch to meta-quest-touch, which fails in the findMatchingControllerWebXR function.

@dmarcos
Copy link
Member Author
dmarcos commented Oct 20, 2022

@cabanier and I did some digging and figured out the cause of the bug.

The issue is caused by the GAMEPAD_ID_WEBXR variable for the meta devices changing from oculus-touch to meta-quest-touch, which fails in the findMatchingControllerWebXR function.

As per WebXR profiles the profile id should be meta-quest-touch-pro. This is what this PR assumes.

@felixtrz
Copy link
Contributor

@felixtrz Sorry for the inconvenience. Thanks for testing and patience.

I generalized the logic that loads the model. I think it should work now. If it doesn't. Can you add a breakpoint here and let me know what profiles you see in controller.profiles? You'll need to enter VR so controllers show up.

The problem is in checkIfControllerPresent, this always returns false if we don't make changes to isControllerPresentWebXR() in tracked-controls.js. The breakpoint does not run because of this, but I can give you the profiles captured in tracked-controls.js: ['meta-quest-touch-pro', 'oculus-touch-v2', 'oculus-touch', 'generic-trigger-squeeze']

@dmarcos
Copy link
Member Author
dmarcos commented Oct 20, 2022

@felixtrz Sorry for the inconvenience. Thanks for testing and patience.
I generalized the logic that loads the model. I think it should work now. If it doesn't. Can you add a breakpoint here and let me know what profiles you see in controller.profiles? You'll need to enter VR so controllers show up.

The problem is in checkIfControllerPresent, this always returns false if we don't make changes to isControllerPresentWebXR() in tracked-controls.js. The breakpoint does not run because of this, but I can give you the profiles captured in tracked-controls.js: ['meta-quest-touch-pro', 'oculus-touch-v2', 'oculus-touch', 'generic-trigger-squeeze']

Logic works across touch for rift, Quest 1 and Quest 2. Wonder what's different about Quest Pro. No changes should be needed to checkIfControllerPresent. The profile id is passed to that logic from here in line 275. Can you add a breakpoint there and let me know what id is passed to the component? Thanks for the help and the patience.

@Srile
Copy link
Contributor
Srile commented Oct 20, 2022

The id passed is always oculus-touch, which does not match with the prefix for the meta quest pro, as the prefix was changed due to the rebranding.

@felixtrz
Copy link
Contributor

@felixtrz Sorry for the inconvenience. Thanks for testing and patience.
I generalized the logic that loads the model. I think it should work now. If it doesn't. Can you add a breakpoint here and let me know what profiles you see in controller.profiles? You'll need to enter VR so controllers show up.

The problem is in checkIfControllerPresent, this always returns false if we don't make changes to isControllerPresentWebXR() in tracked-controls.js. The breakpoint does not run because of this, but I can give you the profiles captured in tracked-controls.js: ['meta-quest-touch-pro', 'oculus-touch-v2', 'oculus-touch', 'generic-trigger-squeeze']

Logic works across touch for rift, Quest 1 and Quest 2. Wonder what's different about Quest Pro. No changes should be needed to checkIfControllerPresent. The profile id is passed to that logic from here in line 275. Can you add a breakpoint there and let me know what id is passed to the component? Thanks for the help and the patience.

I've put up my fix that have the quest controller show up here: #5140

@dmarcos
Copy link
Member Author
dmarcos commented Oct 20, 2022

@felixtrz I made a change to iterate through the profiles instead of stopping at first one:

https://github.com/aframevr/aframe/pull/5139/files#diff-2ee48b207a426377ea32a1749d345fd8c9b1adbe0b9d971eccb7860e1fb41cd2R280

Can you let me know if it now works as expected? Thanks so much

@felixtrz
Copy link
Contributor

@felixtrz I made a change to iterate through the profiles instead of stopping at first one:

https://github.com/aframevr/aframe/pull/5139/files#diff-2ee48b207a426377ea32a1749d345fd8c9b1adbe0b9d971eccb7860e1fb41cd2R280

Can you let me know if it now works as expected? Thanks so much

Still does not work, in your fix, checkIfControllerPresent still returns false in oculus-touch-controls

@felixtrz
Copy link
Contributor

@felixtrz I made a change to iterate through the profiles instead of stopping at first one:

https://github.com/aframevr/aframe/pull/5139/files#diff-2ee48b207a426377ea32a1749d345fd8c9b1adbe0b9d971eccb7860e1fb41cd2R280

Can you let me know if it now works as expected? Thanks so much

Would it be helpful if we jump on a call to debug together live? Happy to do so if you are available

@dmarcos
Copy link
Member Author
dmarcos commented Oct 20, 2022

@felixtrz I made a change to iterate through the profiles instead of stopping at first one:
https://github.com/aframevr/aframe/pull/5139/files#diff-2ee48b207a426377ea32a1749d345fd8c9b1adbe0b9d971eccb7860e1fb41cd2R280
Can you let me know if it now works as expected? Thanks so much

Would it be helpful if we jump on a call to debug together live? Happy to do so if you are available

Sure. Are you available now?

@felixtrz
Copy link
Contributor

available

yes, I will shoot you an email at your gmail address for a quick zoom call

@dmarcos
Copy link
Member Author
dmarcos commented Oct 20, 2022

available

yes, I will shoot you an email at your gmail address for a quick zoom call

Perfect, thanks!

@felixtrz
Copy link
Contributor

available

yes, I will shoot you an email at your gmail address for a quick zoom call

Perfect, thanks!

On the call now, let me know if you don't see my email

@dmarcos
Copy link
Member Author
dmarcos commented Oct 20, 2022

@felixtrz Thanks so much for jumping and helping debug so quickly. I just incorporated your changes. Let me know if it works now. Fingers crossed!

@dmarcos dmarcos merged commit c9e4172 into aframevr:master Oct 20, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants