How to read quest controller input

I’m trying to setup teleop in isaac sim using the quest 3s. I installed/loaded basically every omni.kit.xr.[extension] available. I can connect the headset to isaac sim using the occulus desktop app, and I am able to navigate the stage using the controllers.

However, I am having trouble understanding how to read controller input (buttons + location). Currently, I am reading the location by reading the transform of “/_xr_gui/vr/_coord/xrdevice/xrcontroller0”. However, this seems quite gimicky, and I can’t find any way to read button (x,y,a,b) inputs. Any help or guidance on this would be greatly appreciated.

Hey @GOTWIC

Sorry to be the bearer of bad news but at this time, we don’t support custom inputs for any of the XR controllers. It’s on the roadmap for future Kit XR releases

Thanks for the confirmation. Looking forward to its implementation in the future

I was able to read controller input from omni.kit.xr.core. Specifically:

from omni.kit.xr.core import XRCore
device = XRCore.get_singleton().get_current_profile().get_device("xrcontroller0") # left controller
input_state = device.get_button_press_state() # returns dictionary with the state of all buttons/pads

This works and I’ve been able to map custom actions to the controllers via this workaround without any issue.

Curiously however, I can’t actually find any documentation about omni.kit.xr.core.XRCore; it doesn’t seem to even exist (officially). Is it some sort of beta/pre-release class?

If this situation changes in the future, I will let you know. Thanks for your inquiry.

That’s little bit complicated…

      ev_stream = self._xr_core.get_message_bus()
      self._subscription = ev_stream.create_subscription_to_pop(XRWeakMethod(self.handle_input_event))

    def handle_input_event(self, ev):
        ev.consume()
        evBody = ev.payload
        if  ev.payload["event_type"] == "press" and ev.payload["click"] == 1.0:
            carb.log_warn(f"XR event: {evBody}")
            if ev.payload["input"] == "x":
                msg = carb.events.type_from_string("EVENT_NAME")
                omni.kit.app.get_app().get_message_bus_event_stream().push(msg)
            carb.log_warn(f"Trigger event: {msg}")