Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
05241c15dThis file is pinned to the selected release. Download the original to open it in your design tool.
/**
* Static config for the armcade. Camera channels map to LiveKit track names the
* sim/robot publishes into the room. Until a publisher is live, these render
* as "NO SIGNAL" demo tiles.
*/
export type Channel = {
id: string;
/** LiveKit track name the publisher uses for this camera */
trackName: string;
label: string;
short: string;
accent: "cyan" | "magenta" | "amber" | "purple" | "green";
};
// Order defines the camera IDs (CHANNELS[0] = ID 1) and the default pinned/primary view. Side is
// first so it is CAM1 and pinned by default across surfaces (arcade useDirector, /control, broadcast).
export const CHANNELS: Channel[] = [
{ id: "side", trackName: "side", label: "Side view", short: "CAM1 SIDE", accent: "magenta" },
{ id: "top", trackName: "top", label: "Top view", short: "CAM2 TOP", accent: "cyan" },
{ id: "wrist_1", trackName: "wrist_1", label: "Wrist 1", short: "CAM3 WRIST1", accent: "amber" },
{ id: "wrist_2", trackName: "wrist_2", label: "Wrist 2", short: "CAM4 WRIST2", accent: "purple" },
];
/** The camera pinned before any operator picks one — the side view (CAM1), per spec. */
export const DEFAULT_CAMERA =
CHANNELS.find((c) => c.trackName === "side")?.trackName ?? CHANNELS[0].trackName;
/**
* Configured drive time per turn, in seconds. The queue ETA estimates your wait from your position and
* this value (blended with the live `remaining_s` of the current turn). Set it to match the bridge's
* configured turn length.
*/
export const QUEUE_TURN_SECONDS = 180;
/**
* Hard offline switch: set ARMCADE_OFFLINE=1 (Vercel env) while the rig is down. Every viewer
* gets the OFF AIR screen without minting tokens or holding a LiveKit connection, so the whole
* realtime layer costs zero until the flag is cleared. Wins even when real creds are present.
*/
export function isArmcadeOffline(): boolean {
return process.env.ARMCADE_OFFLINE === "1";
}
/**
* The teleop talks to a self-hosted LiveKit on the robot's Raspberry Pi (insecure
* ws://, devkey/secret) via LIVEKIT_* env vars. The Pi "control bridge" owns the queue
* and session; the browser is a thin client. Used by /api/livekit/token.
*/
export function isLiveKitConfigured(): boolean {
return (
!isArmcadeOffline() &&
Boolean(
process.env.LIVEKIT_URL &&
process.env.LIVEKIT_API_KEY &&
process.env.LIVEKIT_API_SECRET &&
process.env.LIVEKIT_ROOM,
)
);
}