Studio¶
bt.studio(scene) serves the 3D studio on 127.0.0.1 and opens a browser. The
UI and your Python session share one scene: dragging the TCP gizmo runs IK and
the new joint values are visible from Python, and scene.set_tcp_target(...)
moves the robot in the browser.
bt.studio(scene) # blocks until Ctrl-C
server = bt.studio(scene, block=False) # or keep working in the same script
print(server.url)
server.stop()
The studio assets must be present
Wheels bundle the built UI. In a source checkout, run
./scripts/build_studio.sh first, or point BOTRAIL_STUDIO_DIR at a built
studio dist directory.
studio
¶
studio(
scene: Scene,
*,
host: str = "127.0.0.1",
port: int = 0,
open_browser: bool = True,
block: bool = True,
) -> Optional[StudioServer]
Serves the studio UI for scene and (by default) opens a browser.
With block=True (default) this runs until Ctrl-C. With
block=False it returns a :class:StudioServer handle; the server
stops when the handle is garbage collected or stop() is called.
StudioServer¶
The handle returned by studio(..., block=False). The server also stops when
the handle is garbage-collected.