Skip to content

Scene automation

The SDK can add visual diagnostic markers and discover authored doors and windows. Markers are stable visual helpers; room-opening actuation is currently experimental.

Draw and remove diagnostic markers

from sim2bot import Robot


def main() -> None:
    with Robot(auto_bridge=True, wait_for_sim=True) as sim:
        sim.marker(
            "goal",
            "sphere",
            position=[0.45, 0.0, 0.35],
            scale=0.06,
            color=[0.36, 0.54, 0.92, 1.0],
        )

        sim.marker(
            "approach",
            "arrow",
            from_=[0.25, 0.0, 0.35],
            to=[0.45, 0.0, 0.35],
            color=[0.2, 0.8, 0.4, 1.0],
        )

        input("Markers are visible. Press Enter to remove them...")
        sim.clear_markers()


if __name__ == "__main__":
    main()

Markers affect only the interactive viewport. They do not change physics and are intentionally excluded from simulated camera images.

Inspect room devices

from sim2bot import Robot


with Robot(auto_bridge=True, wait_for_sim=True) as sim:
    for device in sim.room_devices():
        print(device.id, device.kind, device.motion, device.max_open_deg)

Experimental room actuation

set_room_opening() may not reliably actuate every authored mechanism while browser-side door and window control is being revised. Use discovery safely, but do not make room actuation part of critical automated tests yet.

Relevant APIs