Connections - {robot.id}
{#if error}
{error}
{/if}
Room Management
(showRoomManagement = !showRoomManagement)} class="text-xs text-blue-400 hover:text-blue-300" > {showRoomManagement ? "Hide" : "Show"} Rooms
{#if showRoomManagement}
{#if roomsLoading}
Loading... {:else}
Refresh Rooms {/if}
{rooms.length} room{rooms.length !== 1 ? "s" : ""} available
Available Rooms:
Create New Room
Create a room for collaboration
{#if connecting}
Creating... {:else} Create {/if}
{#if connecting}
Creating... {:else} Create & Join {/if}
{#if rooms.length === 0}
{roomsLoading ? "Loading..." : "No existing rooms available"}
{:else} {#each rooms as room}
{room.id}
{room.participants?.total || 0} participants
{ selectedRoomId = room.id; joinRoomAsConsumer(); }} disabled={connecting} class="flex-1 rounded bg-purple-600 px-2 py-1 text-xs text-white hover:bg-purple-700 disabled:cursor-not-allowed disabled:opacity-50" > Join as Consumer
{ selectedRoomId = room.id; joinRoomAsProducer(); }} disabled={connecting} class="flex-1 rounded bg-orange-600 px-2 py-1 text-xs text-white hover:bg-orange-700 disabled:cursor-not-allowed disabled:opacity-50" > Join as Producer
{/each} {/if}
{/if}
Consumer (Receive Commands) - Single
{#if hasConsumer}
{consumer?.name || "Consumer Active"}
{consumer?.status.isConnected ? "🟢 Connected" : "🔴 Disconnected"}
{connecting ? "Disconnecting..." : "Disconnect"}
{:else}
{connecting ? "Connecting..." : "Connect USB Consumer"}
{connecting ? "Connecting..." : "Remote Consumer"}
Remote Consumer: Receive commands from transport server
{/if}
Producers (Send Commands) - {outputDriverCount} connected
{connecting ? "Connecting..." : "Add USB Producer"}
{connecting ? "Connecting..." : "Add Remote Producer"}
Remote Producer: Send commands to transport server. Uses Robot ID: {remoteRobotId}
{#each producers as producer}
{producer.name}
{producer.status.isConnected ? "🟢 Connected" : "🔴 Disconnected"}
disconnectProducer(producer.id)} disabled={connecting} class="rounded bg-red-600 px-2 py-1 text-xs text-white hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-50" > {connecting ? "Removing..." : "Remove"}
{/each}
Robot ID for Remote Connections:
{#if showUSBCalibration}
USB Calibration Required {#if pendingUSBConnection}
(for {pendingUSBConnection === "consumer" ? "Consumer" : "Producer"})
{/if}
✕
Before connecting USB drivers, the robot needs to be calibrated to map its physical range to software values.
{/if}