Vuer

Movable

The Movable component wraps objects to make them draggable and repositionable. This is essential for:

  • Creating interactive robot teleoperation interfaces
  • Building drag-and-drop 3D editors
  • Allowing users to reposition objects in VR/AR
  • Implementing interactive demonstrations

Basic Usage

A minimal example that creates a draggable gripper:

python
import asyncio
from vuer import Vuer, VuerSession
from vuer.schemas import DefaultScene, Movable, Gripper, Sphere, OrbitControls

app = Vuer()

@app.add_handler("OBJECT_MOVE")
async def handler(event, session):
    print(f"Movement Event: key-{event.key}", event.value)

@app.spawn(start=True)
async def main(session: VuerSession):
    session.set @ DefaultScene(
        Movable(
            Gripper(key="gripper"),
            Sphere(args=[0.15], position=[0.3, 0, 0], key="sphere"),
            key="movable-gripper",
            position=[0, 0.5, 0],
        ),
        bgChildren=[OrbitControls(key="OrbitControls")]
    )

    while True:
        await asyncio.sleep(1.0)

Key Parameters

ParameterTypeDefaultDescription
keystr-Unique identifier for the movable wrapper
offsetlist[0,0,0]Optional [x, y, z] offset from the position
positionlist[0,1,-1]Initial [x, y, z] position in world coordinates
quaternionlist-Optional [x, y, z, w] quaternion rotation
rotationlist-Optional [x, y, z] Euler rotation
scalefloat/list0.1Float or [x, y, z] scale factor
handlefloat/list-Optional handle size (overrides scale for handle geometry)
showFrameboolTrueShow coordinate frame visualization
wireframeboolFalseEnable wireframe rendering
localRotationboolFalseUse local rotation instead of world rotation