Vuer

MotionControllers

The MotionControllers component enables VR motion controller tracking. This is essential for:

  • VR controller input in WebXR applications
  • Building VR interaction interfaces
  • Robot teleoperation with VR controllers
  • Creating immersive VR experiences

Basic Usage

A minimal example that enables motion controller tracking:

python
import asyncio
from vuer import Vuer, VuerSession
from vuer.schemas import MotionControllers

app = Vuer()

@app.add_handler("CONTROLLER_MOVE")
async def handler(event, session):
    print(f"Controller Event:", event.value)

@app.spawn(start=True)
async def main(session: VuerSession):
    session.upsert(
        MotionControllers(
            stream=True,
            key="controllers",
        ),
        to="bgChildren",
    )

    while True:
        await asyncio.sleep(1.0)

Key Parameters

ParameterTypeDefaultDescription
keystr-Unique identifier for the controllers
streamboolFalseEnable streaming of controller pose data
leftboolTrueEnable left controller tracking
rightboolTrueEnable right controller tracking

Controller Data Format

The CONTROLLER_MOVE event returns pose and button data for each controller.

SSL Requirement

WebXR requires HTTPS. Use ngrok or localtunnel for development:

Learn More

For detailed examples of using MotionControllers, see: