Ralith/openxrs

Action is inactive even immediately after a call to sync_actions

NickDriscoll opened this issue · 3 comments

I'm having an issue where a Pose action is always considered inactive no matter the state of the XR hardware.

This code snippet is from initialization. Just creating an actionset with a single pose action:
image

Later, we attach the actionset to the session:
image

This code is in the main loop. I'm calling sync actions with the previously created actionset and just printing out if the controller pose action is active or not:
image

My application prints "Sync actions returned ok" followed by "false" every frame, regardless of the state of the hardware. I don't know how this can be as I'm calling sync_actions right beforehand. It looks like I'm doing things right by the openxr API itself, so I'm wondering if I'm just using this crate wrong.

Any thoughts would be appreciated.

How do you expect the OpenXR runtime to know which tracked device's pose you want?

left_hand_path is constructed from xr::USER_HAND_LEFT
image

That's how.

The path passed to Action<Posef>::is_active is a sub-action path. It does not associate the action with a particular device, but disambiguates when an action is associated with multiple devices. The code you've posted does not arrange for binding to any devices at all. You need to configure a binding manually in your OpenXR runtime and/or suggest a default one.