The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/wmr: fix controller activation in SteamVR

SteamVR requires the serial number to be set. Otherwise after creating
the controller it will fail to activate it.

Before:

...
monado: Creating Controller WMR Left Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number:
Driver 'monado' attempted to add tracked device with no serial number
monado: Added left Controller: WMR Left Controller
monado: Creating Controller WMR Right Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number:
Driver 'monado' attempted to add tracked device with no serial number
monado: Added right Controller: WMR Right Controller
...

After:

monado: Creating Controller WMR Left Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number: Left Controller
Driver 'monado' started activation of tracked device with serial number 'Left Controller'
monado: Added left Controller: WMR Left Controller
monado: Creating Controller WMR Right Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number: Right Controller
Driver 'monado' started activation of tracked device with serial number 'Right Controller'
monado: Added right Controller: WMR Right Controller

With this change the HP Reverb G2 controller is recognized and activated
fine in SteamVR for me. "Active Controller" nows says:
"monado_hp_mixed_reality_controller". The SteamVR controller test page
now works and recognizes button presses. The controllers can also
(kind of) be used in the home environment.

Several issues still exist to be fully useable:

* middle finger button not recognized in the SteamVR test page
(all other buttons seem to work)
* high gyro drift
* no positional tracking

The serial is set to "Left Controller" and "Right Controller" for now,
just like for the Rift S controller. This should probably be updated to
a proper serial number once read_controller_config() can parse it from
the firmware.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>

authored by

Linus Lüssing and committed by
Ryan Pavlik
7e14d7eb 948d78fb

+4
+4
src/xrt/drivers/wmr/wmr_controller_base.c
··· 535 535 536 536 if (controller_type == XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER) { 537 537 snprintf(wcb->base.str, ARRAY_SIZE(wcb->base.str), "WMR Left Controller"); 538 + /* TODO: use proper serial from read_controller_config()? */ 539 + snprintf(wcb->base.serial, XRT_DEVICE_NAME_LEN, "Left Controller"); 538 540 } else { 539 541 snprintf(wcb->base.str, ARRAY_SIZE(wcb->base.str), "WMR Right Controller"); 542 + /* TODO: use proper serial from read_controller_config()? */ 543 + snprintf(wcb->base.serial, XRT_DEVICE_NAME_LEN, "Right Controller"); 540 544 } 541 545 542 546 wcb->base.get_tracked_pose = wmr_controller_base_get_tracked_pose;