paddy-data's picture
Upload paddy-data-sample (2026-11-16)
259137d verified
Raw History Blame Contribute Delete
61.1 kB
/* Paddy data sample: landing page and episode explorer. Plain JS, no build step.
Routes: #/ overview, the landing page (sections: #/#tasks, #/#download, ...)
#/details full specification, only what the overview leaves out (#/details#rig, ...)
#/explore?ep=ep_014&t=31.4&outcome=failure&q=wall (t: start at that second)
Every number on the page comes from data/index.json (facts, episodes, downloads, clips) and
data/schema.json (features, cameras, conventions), which build/build_assets.py computes from the
datasets. Nothing here depends on build/ at runtime.
*/
"use strict";
// ---- Edit these before publishing -------------------------------------------------------
const CONFIG = {
// The two Hugging Face dataset repos ("org/name"), one entry each. null shows that release as
// "coming soon" (no download command, no links).
repos: {
sample: "PaddyDataCollection/cable_sorting_sample", // three cameras, color only
full: "PaddyDataCollection/cable_sorting_sample_full", // 4 of the episodes, every stream as recorded, lossless
},
// Where "Contact" goes (https://... or mailto:...).
contactUrl: "https://paddydata.ai",
// Shown in the footer and the download cards. null shows "licence to be announced".
license: "CC BY 4.0",
};
// What each release is called on the page (the repo name is shown beside it when set).
const RELEASES = {
sample: { title: "Sample: every episode, three cameras", folder: "cable_sorting_sample",
blurb: "All the episodes with the overhead camera and both wrist cameras in standard-quality color video, and every numeric stream. The download for training on the standard views." },
full: { title: "Full: everything as recorded, lossless", folder: "cable_sorting_sample_full",
blurb: "A few of the episodes with all the data captured at recording: the scene camera, the overhead camera at its recorded size, its infrared stereo pair, and depth from every camera, aligned and raw. Every frame is stored without loss.",
note: "This release keeps everything the rig captured, at full quality. It was recorded on a workstation with an NVIDIA GeForce RTX 5090 graphics card. Future datasets may be reduced, with fewer streams, lower resolutions or lossy compression, to suit the recording hardware or a customer's requirements." },
};
// The overview is the landing page at #/; #/details carries only what the overview leaves out.
// Nav entries: [href, label, keepOnTablet]; the last one links the other page and stays on phones too.
const PAGES = {
main: {
path: "/",
sections: ["hero", "overview", "tasks", "overlay", "download", "contact", "footer"],
nav: [["#/#tasks", "Task", true], ["#/#overview", "Specs", false],
["#/#download", "Download", true], ["#/details", "Full spec →", true]],
},
details: {
path: "/details",
sections: ["spec-head", "tasks", "rig", "streams", "features", "episode-meta", "files", "conventions", "quality", "code", "footer"],
nav: [["#/details#rig", "Rig", false], ["#/details#features", "All features", false],
["#/details#files", "Files", false], ["#/details#code", "Load it", true], ["#/", "← Overview", true]],
},
};
// Scene ids as recorded, in words.
const SCENE = {
Paddy_Office: { label: "Bins lower on the wall", desc: "Source bin and the two-compartment target bin hung lower on the bin wall." },
Paddy_Office_binwall_2_lowlight: { label: "Bins higher on the wall, light reduced", desc: "The bins hung higher on the bin wall, with the room light reduced." },
};
const CAMERA_WORD = { overhead: "overhead", scene: "scene", wrist: "wrist" };
// ------------------------------------------------------------------------------------------
const $ = (s, el = document) => el.querySelector(s);
const $$ = (s, el = document) => [...el.querySelectorAll(s)];
const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }[c]));
const pretty = (s) => String(s).replace(/_/g, " ");
const fmtDur = (s) => (s >= 60 ? `${Math.floor(s / 60)}:${String(Math.round(s % 60)).padStart(2, "0")}` : `${s.toFixed(1)} s`);
const fmtT = (s) => `${Math.floor(s / 60)}:${(s % 60).toFixed(1).padStart(4, "0")}`;
const sceneLabel = (s) => SCENE[s]?.label || pretty(s);
const sceneDesc = (s) => SCENE[s]?.desc || "";
const stepWord = (instr) => (instr || "").split(" ")[0] || "";
const visualizer = (repo) => `https://huggingface.co/spaces/lerobot/visualize_dataset?path=/${repo}/episode_0`;
let INDEX = null;
let SCHEMA = null;
let F = {}; // INDEX.facts
const epCache = new Map();
let player = null; // active explorer player, torn down on route change
const f = (key) => {
if (F[key] === undefined || F[key] === null) { console.warn("missing fact", key); return "–"; }
return F[key];
};
const subtaskName = (i) => INDEX.task.subtasks.find((s) => s.index === i)?.instruction || `step ${i + 1}`;
// ---- theme -------------------------------------------------------------------------------
(function theme() {
let saved = null;
try { saved = localStorage.getItem("paddy-theme"); } catch (e) { /* storage blocked */ }
if (saved) document.documentElement.dataset.theme = saved;
$("#theme").addEventListener("click", () => {
const dark = document.documentElement.dataset.theme
? document.documentElement.dataset.theme === "dark"
: matchMedia("(prefers-color-scheme: dark)").matches;
const next = dark ? "light" : "dark";
document.documentElement.dataset.theme = next;
try { localStorage.setItem("paddy-theme", next); } catch (e) { /* ignore */ }
if (player) player.redraw();
});
})();
// ---- routing -----------------------------------------------------------------------------
function parseHash() {
const h = location.hash.replace(/^#/, "") || "/";
const [pathAndQuery, anchor] = h.split("#");
const [path, query] = pathAndQuery.split("?");
return { path: path || "/", params: new URLSearchParams(query || ""), anchor: anchor || "" };
}
function tellParent() {
// Hugging Face shows Spaces in an iframe; keep the outer URL's hash in step for deep links.
try { window.parent.postMessage({ hash: location.hash || "#/" }, "https://huggingface.co"); } catch (e) { /* not embedded */ }
}
let currentPath = null;
let page = "main";
async function route() {
const { path, params, anchor } = parseHash();
if (!INDEX) {
[INDEX, SCHEMA] = await Promise.all([fetch("data/index.json"), fetch("data/schema.json")].map((p) => p.then((r) => r.json())));
F = INDEX.facts;
}
// Any unknown path (including the earlier /compact and /detailed) lands on a page rather than nothing.
page = path === "/details" || path === "/detailed" ? "details" : "main";
const view = path === "/explore" ? "/explore" : page;
renderNav(view);
if (view === "/explore") {
if (currentPath !== "/explore") renderExplore();
selectFromParams(params);
} else {
if (currentPath !== view) renderLanding(page);
if (anchor) requestAnimationFrame(() => document.getElementById(anchor)?.scrollIntoView());
else window.scrollTo(0, 0);
}
currentPath = view;
tellParent();
}
function renderNav(view) {
const nav = PAGES[view === "/explore" ? "main" : view].nav;
$("#nav-links").innerHTML = `<a href="#/explore" class="${view === "/explore" ? "on" : ""}">Explore episodes</a>` +
nav.map(([href, label, keep], i) => `<a class="${i === nav.length - 1 ? "page-link" : keep ? "" : "opt"}" href="${href}">${esc(label)}</a>`).join("");
}
window.addEventListener("hashchange", route);
route();
// ---- landing -----------------------------------------------------------------------------
const quadTags = () => `<div class="quad-tags">${["camera_top", "camera_bottom", "camera_left", "camera_right"].map((c) => `<span>${c}</span>`).join("")}</div>`;
const vid = (src, label = "", poster = "") => `<video src="${esc(src)}" ${poster ? `poster="${esc(poster)}"` : ""} autoplay muted loop playsinline preload="metadata"${label ? ` aria-label="${esc(label)}"` : ""}></video>`;
function renderLanding(which) {
if (player) { player.destroy(); player = null; }
const view = $("#view");
view.innerHTML = "";
for (const s of PAGES[which].sections) view.appendChild($(`#sec-${s}`).content.cloneNode(true));
$$("[data-only]", view).forEach((el) => { if (el.dataset.only !== which) el.remove(); });
$$("[data-f]", view).forEach((el) => (el.textContent = f(el.dataset.f)));
const compact = which === "main";
const fill = (id, fn) => { const el = document.getElementById(id); if (el) fn(el); };
const eps = INDEX.episodes;
const clips = INDEX.clips || {};
const camByName = Object.fromEntries(SCHEMA.cameras.map((c) => [c.name, c]));
const camWord = (name) => { const c = camByName[name]; return c ? (c.role === "wrist" ? `${name.split("_")[1]} wrist` : CAMERA_WORD[c.role] || c.role) : name; };
fill("mosaic", (el) => {
el.innerHTML = (clips.loops || []).slice(0, 4).map((l) => `
<div class="tile">${vid(l.file)}<span class="tag">${esc(camWord(l.camera))} · <code>${esc(l.camera)}</code></span></div>`).join("");
});
fill("stats", (el) => {
const stats = [
[f("episodes"), `episodes: ${f("successes")} successes, ${f("failures")} failures, none trimmed`],
[`${f("minutes")} min`, `${f("frames")} rows at ${f("fps")} fps`],
[f("subtasks"), "subtasks per episode, marked live; the failed step labelled"],
[`${f("cameras_full")} + depth`, "cameras recorded with depth; all of it lossless in the full release"],
[`${f("servo_hz")} Hz`, "joint setpoints to each arm; the action is the joint command"],
[`${f("sync_worst")} ms`, "camera-to-camera spread, worst episode (median)"],
];
el.innerHTML = stats.map(([b, s]) => `<div class="stat"><b>${esc(b)}</b><span>${esc(s)}</span></div>`).join("");
});
const camList = SCHEMA.cameras.map((c) => `${c.role === "wrist" ? `${c.name.split("_")[1]} wrist` : c.role} ${c.model.replace("Intel ", "")}`).join(", ").replace(/^./, (x) => x.toUpperCase());
fill("glance", (el) => {
const scenes = INDEX.scenes.map((s) => `${sceneLabel(s.id)}, ${s.episodes.length} episodes`).join("; ");
const rows = [
["Created by", "Paddy Data"],
["Task", `“${INDEX.task.instruction}”: ${f("subtasks")} subtasks (${INDEX.task.subtasks.map((s) => stepWord(s.instruction).toLowerCase()).join(", ")}), ${f("successes")} successes and ${f("failures")} failures`],
["Recorded", `${f("sessions")} sessions within ${f("hours_span")} hours (${f("utc_first")} to ${f("utc_last")} UTC) on Paddy's bimanual collection station, real hardware`],
["Environment", `Office, bins hung on a bin wall; ${f("scenes")} scenes (${scenes})`],
["Embodiment", `${f("arms")} × UFACTORY xArm7 (${f("dof")}-DoF), mounted ${f("mount")} · ${f("arms")} × Gripper G2 parallel jaws, 0 to ${f("gripper_mm")} mm · ${f("ft_axes")}-axis force-torque sensor on the right wrist`],
["Cameras", `${camList} · color at ${f("cam_fps")} fps; the sample has three of them at ${f("resolution")}, the full release all four at their recorded size (overhead ${f("top_recorded")}), with depth from each and the overhead camera's infrared stereo pair`],
["Control", `VR teleoperation: one Meta Quest hand controller per arm, deadman per hand; the arms follow in servo mode, ${f("servo_hz")} Hz joint setpoints`],
["Action", `Joint command per arm (${f("dof")} joints, absolute, then the gripper); the operator's TCP target beside it`],
["Operators", `${f("operators")} operator (anonymous id), not a trained expert`],
["Labels", "Task instruction, operator-marked subtasks with outcomes, episode outcome and the operator's note, scene"],
["Format", `${f("format")} · parquet + H.264 MP4 · in the full release lossless H.264 and FFV1 ${f("depth_bits")}-bit depth`],
["Releases", `Sample: all ${f("episodes")} episodes, ${f("size_sample")} · Full: episodes ${f("full_episode_list")}, everything as recorded, ${f("size_full")}`],
["Licence", CONFIG.license || "To be announced with the release"],
];
el.innerHTML = rows.map(([k, v]) => `<div><dt>${esc(k)}</dt><dd>${esc(v)}</dd></div>`).join("");
});
fill("task-instruction", (el) => (el.textContent = `${INDEX.task.instruction}.`));
fill("subtask-gallery", (el) => {
el.innerHTML = (clips.subtasks || []).map((c) => {
const s = INDEX.task.subtasks.find((x) => x.index === c.index);
const id = `ep_${String(c.episode).padStart(3, "0")}`;
return `
<figure class="taskcard">
<div class="quad">${vid(c.file, `Step ${c.index + 1} in all four views`)}${quadTags()}</div>
<figcaption>
<div class="kicker">Step ${c.index + 1} · <code>paddy.subtask_index = ${c.index}</code></div>
<h3>${esc(stepWord(s.instruction))}</h3>
<p class="instr">“${esc(s.instruction)}”</p>
<div class="chips"><span class="chip">median ${s.median_s} s</span><span class="chip ok">${s.success} success</span>${s.failure ? `<span class="chip fail">${s.failure} failure</span>` : ""}</div>
<p class="fine">Clip: episode ${c.episode}, ${c.start_s} s to ${(c.start_s + c.seconds).toFixed(1)} s · <a href="#/explore?ep=${id}&t=${c.start_s}">Open the episode →</a></p>
</figcaption>
</figure>`;
}).join("");
});
fill("scenes", (el) => {
const showcase = new Set((clips.subtasks || []).map((c) => c.episode).concat((clips.loops || []).map((l) => l.episode)));
el.innerHTML = INDEX.scenes.map((s) => {
const ep = s.episodes.find((i) => showcase.has(i)) ?? s.episodes[0];
const id = `ep_${String(ep).padStart(3, "0")}`;
return `<figure class="scene-card"><img src="media/${id}/poster.jpg" alt="Overhead view of the scene ${esc(sceneLabel(s.id))}" loading="lazy">
<figcaption><b>${esc(sceneLabel(s.id))}</b><span>${esc(sceneDesc(s.id))}</span>
<span class="dim">episodes ${s.episodes[0]} to ${s.episodes[s.episodes.length - 1]} (${s.episodes.length}) · scene id <code>${esc(s.id)}</code></span>
<a href="#/explore?q=${encodeURIComponent(sceneLabel(s.id))}">Explore these →</a></figcaption></figure>`;
}).join("");
});
fill("failure-lede", (el) => {
el.innerHTML = `${f("failures")} of ${f("episodes")} episodes (${f("failure_pct")} %, ${f("failure_time_pct")} % of the recorded
time) end in failure, one at each step. Every trial the operator kept that day is in; none was filtered on quality.
The failed step is labelled <code>failure</code>, the episode's outcome is in <code>meta/episodes</code> and the
operator's note in its sidecar. Each clip is the last seconds of the failed step.`;
});
fill("failure-gallery", (el) => {
el.innerHTML = (clips.failures || []).map((c) => `
<figure class="taskcard failcard">
<div class="quad">${vid(c.file, `Episode ${c.episode}: the failed step in all four views`)}${quadTags()}</div>
<figcaption>
<div class="kicker">Episode ${c.episode} · ${esc(sceneLabel(INDEX.episodes[c.episode].scene))}</div>
<h3>Failed at step ${c.step + 1}: ${esc(stepWord(subtaskName(c.step)).toLowerCase())}</h3>
${c.note ? `<p class="instr">Operator's note: “${esc(c.note)}”</p>` : ""}
<p class="fine">Clip: ${c.start_s} s to ${(c.start_s + c.seconds).toFixed(1)} s · <a href="#/explore?ep=${c.id}&t=${c.start_s}">Open the episode →</a></p>
</figcaption>
</figure>`).join("");
});
fill("subtask-table", (el) => {
el.innerHTML = `<thead><tr><th class="n">Index</th><th>Instruction</th><th class="n">Labelled in</th><th class="n">Success</th><th class="n">Failure</th><th class="n">Median (success)</th></tr></thead><tbody>` +
INDEX.task.subtasks.map((s) => `<tr><td class="n">${s.index}</td><td>${esc(s.instruction)}</td><td class="n">${s.episodes}</td>
<td class="n">${s.success}</td><td class="n">${s.failure}</td><td class="n">${s.median_s} s</td></tr>`).join("") + "</tbody>";
});
fill("episode-table", (el) => {
el.innerHTML = `<thead><tr><th class="n">Ep.</th><th>Scene</th><th class="n">Length</th><th>Outcome</th><th>Steps</th>
<th class="n">Lag L / R</th><th class="n">Camera spread</th><th class="n">Live command L / R</th></tr></thead><tbody>` +
eps.map((e) => `<tr class="link" data-ep="${e.id}"><td class="n"><a href="#/explore?ep=${e.id}">${e.index}</a></td><td>${esc(sceneLabel(e.scene))}</td>
<td class="n">${e.duration_s.toFixed(1)} s</td><td>${e.outcome === "failure" ? `<span class="chip fail">failure</span>` : `<span class="chip ok">success</span>`}</td>
<td class="steps">${e.subtasks.map((s) => `<span class="${s.outcome === "failure" ? "bad" : "good"}" title="${esc(s.instruction)}: ${esc(s.outcome)}">${s.outcome === "failure" ? "✗" : "✓"}</span>`).join("")}</td>
<td class="n">${e.command_lag_ms.left} / ${e.command_lag_ms.right} ms</td><td class="n">${e.camera_sync_ms} ms</td>
<td class="n">${Math.round(e.action_valid_pct.left)} / ${Math.round(e.action_valid_pct.right)} %</td></tr>`).join("") + "</tbody>";
$$("tr.link", el).forEach((tr) => tr.addEventListener("click", (ev) => { if (!ev.target.closest("a")) location.hash = `#/explore?ep=${tr.dataset.ep}`; }));
});
fill("rig-views", (el) => {
el.innerHTML = (clips.loops || []).slice(4, 8).map((l) => `<figure>${vid(l.file)}<figcaption>${esc(camWord(l.camera))} · ${esc((camByName[l.camera]?.model || "").replace("Intel ", ""))}</figcaption></figure>`).join("");
});
fill("parts", (el) => {
const cam = (role) => SCHEMA.cameras.filter((c) => c.role === role);
const top = cam("overhead")[0], scene = cam("scene")[0], wrists = cam("wrist");
const parts = [
["Arms", `${f("arms")} × UFACTORY xArm7, ${f("dof")}-DoF`, `Mounted ${f("mount")}. Joint states at ${f("joint_hz")} Hz; joint setpoints streamed to each arm at ${f("servo_hz")} Hz in servo mode (measured ${f("command_hz_left")} and ${f("command_hz_right")} Hz)`],
["Grippers", `${f("arms")} × UFACTORY Gripper G2`, `Parallel jaw, 0 to ${f("gripper_mm")} mm opening`],
["Force-torque", `${f("ft_axes")}-axis sensor on the right wrist`, `${f("ft_hz")} Hz; compensated and raw readings both kept`],
top && ["Overhead camera", top.model, `Color ${top.resolution} at ${f("cam_fps")} fps${top.sample_resolution && top.sample_resolution !== top.resolution ? ` (${top.sample_resolution} in the sample)` : ""}, ${top.hfov_deg}° wide, depth aligned to color, infrared stereo pair with a ${f("stereo_baseline_mm")} mm baseline`],
scene && ["Scene camera", `${scene.model}, fixed`, `Color ${scene.resolution} at ${f("cam_fps")} fps, ${scene.hfov_deg}° wide, depth aligned to color. In the full release; the previews here show it for every episode`],
wrists.length && ["Wrist cameras", `${wrists.length} × ${wrists[0].model}`, `Color ${wrists[0].resolution} at ${f("cam_fps")} fps, ${wrists[0].hfov_deg}° wide, depth aligned to color`],
["Teleoperation", "Meta Quest hand controllers", `One per arm, tracked at about ${f("quest_hz")} Hz, a deadman button per hand; teleop targets at ${f("target_hz")} Hz, which the arms follow through inverse kinematics`],
].filter(Boolean);
el.innerHTML = parts.map(([k, v, s]) => `<div class="part"><b>${esc(k)}</b><span>${esc(v)}<small>${esc(s)}</small></span></div>`).join("");
});
const residuals = () => {
const by = (role) => SCHEMA.cameras.filter((c) => c.role === role).map((c) => `${c.error_px} px`);
return { top: by("overhead").join(", "), scene: by("scene").join(", "), wrist: by("wrist").join(" and ") };
};
fill("overlay-clips", (el) => {
const side = ["camera_bottom", "camera_left", "camera_right"];
// build_overlay.py cuts the clips from the four-camera recording, whose episode can start later
const ovT = (c) => +(c.start_s + (INDEX.episodes[c.episode]?.rec_offset_s || 0)).toFixed(1);
el.innerHTML = (INDEX.overlay || []).map((c) => `
<figure class="overlay-clip">
<div class="overlay-media">
${vid(c.file, `${sceneLabel(c.scene)}: overhead, scene and both wrist views with the robot model drawn over the arms`, c.poster)}
<span class="ov-tag" style="left:0;top:0">camera_top</span>
${side.map((s, i) => `<span class="ov-tag" style="left:75%;top:${(100 * i / 3).toFixed(2)}%">${s}</span>`).join("")}
</div>
<figcaption><b>${esc(sceneLabel(c.scene))}</b><span>episode ${c.episode} · ${esc(stepWord(subtaskName(c.subtask)).toLowerCase())} · from ${ovT(c).toFixed(0)} s, as recorded</span>
<a href="#/explore?ep=${c.id}&t=${ovT(c)}">Open the episode →</a></figcaption>
</figure>`).join("");
if (!(INDEX.overlay || []).length) el.closest("section")?.remove();
});
fill("overlay-note", (el) => {
const rs = residuals();
el.innerHTML = `Calibration residuals: overhead ${esc(rs.top)}, scene ${esc(rs.scene)}, wrists ${esc(rs.wrist)} (per camera in
<code>meta/cameras.json</code>). To draw it yourself: <code>meta/paddy/robot_description.urdf</code> with the meshes
it names (UFACTORY's <code>xarm_description</code> for the arms and grippers; the force-torque sensor's mesh is not in
the dataset), <code>observation.state</code> for the joints and gripper, and each camera's <code>K</code>,
<code>D</code> and <code>calibration.frame_T_cam</code>.`;
});
fill("calib-table", (el) => {
const mount = (c) => (c.moving ? "on the wrist, moves with the arm" : `fixed, ${c.role}`);
el.innerHTML = `<thead><tr><th>Camera</th><th>Model · mount</th><th>Resolution</th><th>f<sub>x</sub>, f<sub>y</sub> (px)</th><th>c<sub>x</sub>, c<sub>y</sub> (px)</th>
<th>Intrinsics</th><th>Extrinsics</th><th class="n">Residual</th></tr></thead><tbody>` +
SCHEMA.cameras.map((c) => `<tr><td><code>${esc(c.name)}</code>${c.primary ? `<br><span class="dim">primary</span>` : ""}${INDEX.cameras.find((x) => x.name === c.name)?.in_sample ? "" : `<br><span class="chip full">full only</span>`}</td>
<td>${esc(c.model)}<br><span class="dim">${esc(mount(c))}</span></td>
<td>${esc(c.resolution)}<br><span class="dim">${c.hfov_deg}° wide${c.sample_resolution && c.sample_resolution !== c.resolution ? `, ${esc(c.sample_resolution)} in the sample` : ""}</span></td>
<td>${c.fx}, ${c.fy}</td><td>${c.cx}, ${c.cy}</td>
<td>${esc(c.intrinsics)}</td>
<td>ChArUco, ${esc(c.calibrated_at || "")}<br><span class="dim">${c.samples} views, to <code>${esc(c.extrinsic_frame || "")}</code></span></td>
<td class="n">${c.error_mm} mm<br><span class="dim">${c.error_px} px</span></td></tr>`).join("") + "</tbody>";
});
const feat = Object.fromEntries(SCHEMA.features.map((x) => [x.key, x]));
const shape = (k) => (feat[k] ? `(${feat[k].shape.join(", ")})` : "");
fill("stream-cards", (el) => {
const cams = INDEX.cameras.map((c) => c.name.replace("camera_", "")).join(",");
const cards = [
[`${f("cameras_full")} color views`, `observation.images.camera_{${cams}}`, `H.264 at ${f("fps")} fps, ${f("resolution")} in the sample; lossless and at the recorded size in the full release (overhead ${f("top_recorded")}). The overhead view is the primary camera; camera_bottom is in the full release only.`],
["Depth", "depth/observation.depth{,_raw}.<camera>", `Full release only: lossless FFV1, ${f("depth_bits")}-bit millimetres, one image per row, aligned to each color image (${f("depth_res")} overhead, ${f("depth_res_wrist")} the others) and as each camera's own ${f("depth_raw_res")} image; also as LeRobot depth features.`],
["Stereo pair", "observation.images.camera_top_stereo_{left,right}", `Full release only: the overhead camera's two infrared imagers, rectified, ${f("stereo_res")}, ${f("stereo_baseline_mm")} mm baseline, lossless.`],
["Joint state", `observation.state ${shape("observation.state")}`, `Per arm ${f("dof")} joint angles and the gripper opening. Velocity and effort alongside.`],
["End-effector pose", "observation.eef_pose.<side>", "TCP position and orientation per arm from the URDF, as quaternion and 6D rotation."],
["Wrist force-torque", "observation.force_torque.right", "Force (N) and torque (N·m) in the flange frame, compensated and raw, with a freshness flag."],
["Actions", `action ${shape("action")}`, `The joint command per arm: the last of the ${f("servo_hz")} Hz setpoints sent at or before the row, then the gripper command.`],
["Teleop targets", "paddy.target_pose.<side>", "The operator's TCP target, the deadman, and which rows have a live command."],
["Labels", "task_index · paddy.subtask_index", "Instruction per episode, operator-marked subtasks per row, outcome per episode and per step, scene."],
];
el.innerHTML = cards.map(([h, c, p]) => `<div class="stream"><h3>${esc(h)}</h3><code>${esc(c)}</code><p>${esc(p)}</p></div>`).join("");
});
fill("depth-video", (el) => { if (clips.depth_demo) el.src = clips.depth_demo.file; });
fill("depth-ticks", (el) => {
const d = clips.depth_demo;
if (!d) return;
el.innerHTML = [d.near_m, (d.near_m + d.far_m) / 2, d.far_m].map((v) => `<span>${v.toFixed(2)} m</span>`).join("");
});
fill("depth-caption", (el) => {
const d = clips.depth_demo;
if (d) el.textContent = `Overhead camera at ${f("top_recorded")} from the full release, episode ${d.episode} (episode ${INDEX.episodes[d.episode]?.full_index} there), ${d.seconds} s from ${d.start_s} s; near is red, black is no measurement.`;
});
fill("depth-fill", (el) => {
if (F.depth_fill_top) el.textContent = `Median share of pixels with a value, over the full release: overhead ${F.depth_fill_top} %, scene ${F.depth_fill_bottom} %, wrists ${F.depth_fill_left} and ${F.depth_fill_right} %.`;
});
fill("feature-table", (el) => {
const COMPACT_KEYS = ["observation.images.camera_top", "observation.state", "observation.velocity", "observation.effort",
"observation.eef_pose.left", "observation.force_torque.right", "action", "paddy.action_valid", "paddy.target_pose.left",
"paddy.engaged", "paddy.subtask_index", "paddy.utc_s"];
const cams = INDEX.cameras.map((c) => c.name.replace("camera_", "")).join(",");
const merge = { "observation.images.camera_top": `observation.images.camera_{${cams}}`, "observation.eef_pose.left": "observation.eef_pose.{left,right}",
"paddy.target_pose.left": "paddy.target_pose.{left,right}" };
let feats = SCHEMA.features;
if (compact) feats = COMPACT_KEYS.map((k) => feat[k]).filter(Boolean);
const mergedDoc = {
"observation.images.camera_top": [feat["observation.images.camera_top"]?.unit, "Overhead camera, scene camera and one camera per wrist, color. camera_top is the primary view; camera_bottom is in the full release only."],
"observation.eef_pose.left": [`${feat["observation.eef_pose.left"]?.unit} · frame: each arm's base`, "TCP position and orientation per arm, from URDF forward kinematics at the row's joints. 6D rotations alongside."],
"paddy.target_pose.left": [`${feat["paddy.target_pose.left"]?.unit} · frame: each arm's base`, "The operator's absolute TCP target per arm, from the hand controller."],
};
const unitOf = (x) => (compact && mergedDoc[x.key] ? mergedDoc[x.key][0] : [x.unit, x.frame && `frame ${x.frame}`].filter(Boolean).join(" · "));
const descOf = (x) => (compact && mergedDoc[x.key] ? mergedDoc[x.key][1] : x.desc);
let group = null;
const rows = feats.map((x) => {
let head = "";
if (!compact && x.group !== group) { group = x.group; head = `<tr class="grp"><td colspan="4">${esc(group)}</td></tr>`; }
const key = compact && merge[x.key] ? merge[x.key] : x.key;
const names = !compact && x.names && x.names.length > 1
? `<details><summary>${x.names.length} names</summary><code class="names">${x.names.map(esc).join(", ")}</code></details>` : "";
return `${head}<tr><td><code>${esc(key)}</code>${x.full_only && !(compact && merge[x.key]) ? ` <span class="chip full">full only</span>` : ""}</td><td class="nowrap">${esc(x.dtype)} [${x.shape.join(", ")}]</td>
<td>${esc(unitOf(x))}</td><td>${esc(descOf(x))}${names}</td></tr>`;
}).join("");
el.innerHTML = `<thead><tr><th>Feature</th><th>Type</th><th>Unit · frame</th><th>Description</th></tr></thead><tbody>${rows}</tbody>`;
});
fill("feat-count", (el) => (el.textContent = SCHEMA.features.length));
fill("episode-fields", (el) => {
el.innerHTML = `<thead><tr><th>Key</th><th>Type</th><th>Description</th></tr></thead><tbody>` +
SCHEMA.episode_fields.map((x) => `<tr><td><code>${esc(x.key)}</code></td><td class="nowrap">${esc(x.type)}</td><td>${esc(x.desc)}</td></tr>`).join("") + "</tbody>";
});
fill("tree-full", (el) => (el.textContent = treeText()));
fill("files-table", (el) => {
el.innerHTML = `<thead><tr><th>Path</th><th>Contents</th></tr></thead><tbody>` +
SCHEMA.files.map((x) => `<tr><td><code>${esc(x.path)}</code></td><td>${esc(x.desc)}</td></tr>`).join("") + "</tbody>";
});
fill("conv-cards", (el) => {
const c = SCHEMA.conventions;
const cards = [
["Clock", "One clock for everything", "Every stream, camera frames included, is stamped on the recording computer's system clock as UTC epoch seconds. Each row carries its own time in paddy.utc_s."],
["Rows", `${f("fps")} fps, latest-at-or-before`, `Each row holds the newest reading of each stream at or before its time. A missed camera slot is held (${c.image_gap_policy}) and its age recorded in paddy.frame_age.<camera>; nothing older than ${c.hold_max_age_ms} ms is held.`],
["Actions", "Absolute joint commands", `action is per arm the ${f("dof")} absolute joint positions of the last servo setpoint at or before the row, then the gripper command; not a delta and not a TCP pose. The Cartesian target is in paddy.target_pose.<side>. Before an arm's first command the action holds its measured joints and paddy.action_valid is false.`],
["Poses", "Metres, quaternions xyzw", `Positions in metres in each arm's base frame (${c.base_frames.join(", ")}), the TCP at ${c.tcp_frames.join(" and ")}. Quaternions are ${c.quaternions}. 6D rotations are the first two rotation-matrix columns.`],
["Gripper", c.gripper, `Gripper opening and command are normalized: ${c.gripper}. The G2 opens 0 to ${f("gripper_mm")} mm, linear in the fraction.`],
["Depth", "Millimetres, aligned and raw", `FFV1 ${c.depth.pix_fmt} per camera: aligned to its color image, and the camera's own ${c.depth.raw_resolution} image; one image per row on the color timeline; 0 = no measurement. A row with no depth frame gets an all-zero image (${f("depth_missing")} of ${f("depth_images")} aligned images). Full release only.`],
];
el.innerHTML = cards.map(([k, h, p]) => `<div class="card"><div class="kicker">${esc(k)}</div><h3>${esc(h)}</h3><p>${esc(p)}</p></div>`).join("");
});
fill("trust", (el) => {
const trust = [
["One clock", "Every stream on the recording computer's clock", "Camera frames, joint states, force-torque and commands carry UTC timestamps from one source. Each row also carries its absolute time."],
[`${f("sync_best")}–${f("sync_worst")} ms`, "Camera spread per episode", `Median gap between the ${f("cameras_sample")} cameras' frames in a row, for the worst camera pair, from the best to the worst episode (median over episodes ${f("sync_median")} ms).`],
[`${f("held")} of ${f("cam_frames")}`, `camera frames held over (${f("held_pct")} %)`, `When a camera misses a ${f("fps")} fps slot the previous frame is held and the row records its age. The oldest frame used is ${f("max_frame_age_ms")} ms old.`],
[`${f("lag_left")} ms`, "From target to motion", `Each arm follows the operator's TCP target about ${f("lag_left")} ms (left) and ${f("lag_right")} ms (right) later, ${f("lag_min")} to ${f("lag_max")} ms per episode, most of it in the arm's own controller. Shifted by that lag, the measured TCP stays within ${f("track_p99")} mm of the target (p99, median over episodes).`],
["Untrimmed", "Every episode, start to stop", "Each episode runs from the first row where every stream is live to the operator's stop. The acceptance check requires every camera, joint and action stream complete and in sync."],
["SHA-256", "Manifest for every file", "manifest.json and SHA256SUMS list every file with its size and hash; check a download with one command."],
];
el.innerHTML = trust.map(([n, h, p]) => `<div class="card"><b class="num">${esc(n)}</b><h3>${esc(h)}</h3><p>${esc(p)}</p></div>`).join("");
});
fill("stream-note", (el) => {
el.innerHTML = `<b>We say what a stream is.</b> The arms have no joint torque sensors: <code>observation.effort</code> is the
arm's own estimate from motor current and its dynamic model${F.effort_validated === "no" ? ", not yet checked against a reference" : ""},
and <code>observation.velocity</code> the velocity the arm reports. Contact forces come from the ${esc(f("ft_axes"))}-axis sensor on the right
wrist (fresh on ${esc(f("ft_valid_pct"))} % of rows; per-episode peak force median ${esc(f("peak_force_median"))} N, highest
${esc(f("peak_force_max"))} N).`;
});
fill("limits", (el) => {
const items = [
["Failures are in the data.", `${f("failures")} of ${f("episodes")} episodes (${f("failure_pct")} %, ${f("failure_time_pct")} % of the time) are failures, one at each step. Filter on the episode outcome (<code>paddy/outcome</code> in <code>meta/episodes</code>) or on the subtask outcomes if you want successes only.`],
["The arms take turns.", `The left arm picks and passes, the right arm takes the cable and places it. An arm has a live command on ${f("valid_left")} % (left) and ${f("valid_right")} % (right) of all rows, ${f("valid_min")} to ${f("valid_max")} % per arm and episode. Elsewhere its action holds the measured joints; mask with <code>paddy.action_valid</code>. The share is lower while an arm waits for the other arm's turn and while the operator pauses. This sample was not recorded by a trained expert operator.`],
["Command lag.", `The measured TCP follows the operator's TCP target about ${f("lag_left")} ms later (median; ${f("lag_min")} to ${f("lag_max")} ms per episode and arm), most of it in the arm's own controller. The lag is steady: shifted by it, the measured TCP stays within ${f("track_p99")} mm of the target (p99). Each episode's value is in the sidecar.`],
["One operator, one rig.", `All ${f("episodes")} episodes come from ${f("operators")} operator, not a trained expert, in ${f("sessions")} sessions within ${f("hours_span")} hours, on one rig, in ${f("scenes")} scenes. Expect less variety than in a multi-operator dataset.`],
["People in view.", `${f("people")} Faces are not blurred.`],
["Depth has holes.", `In the full release, 0 means no measurement${F.depth_fill_top ? `: a median ${F.depth_fill_top} % (overhead), ${F.depth_fill_bottom} % (scene), ${F.depth_fill_left} and ${F.depth_fill_right} % (wrists) of pixels have a value` : ""}.${F.depth_far_pct ? ` ${F.depth_far_pct} % of measured pixels read more than ${F.depth_far_m} m (up to ${F.depth_max_m} m), far outside the work area; clip depth to your working range.` : ""} ${f("depth_missing")} of ${f("depth_images")} depth images are empty because no depth frame had arrived for that row.`],
];
el.innerHTML = items.map(([b, t]) => `<li><b>${esc(b)}</b> ${t}</li>`).join("");
});
fill("code-blocks", (el) => {
const repo = CONFIG.repos.sample || CONFIG.repos.full || "<org>/<dataset>";
const folder = RELEASES.sample.folder;
const [sw, sh] = (INDEX.downloads.sample.top_resolution || "").split("×");
const topShape = `3, ${sh}, ${sw}`; // the sample's overhead camera (the full release keeps the recorded size)
const [, dh, dw] = feat["observation.images.camera_top"]?.shape || [];
const blocks = [
["LeRobot", `from lerobot.datasets.lerobot_dataset import LeRobotDataset
ds = LeRobotDataset("${repo}")
frame = ds[0]
frame["observation.state"].shape # ${shape("observation.state")}
frame["observation.images.camera_top"].shape # (${topShape})
frame["action"].shape # ${shape("action")} joint command + gripper`],
["pandas", `import numpy as np, pandas as pd
df = pd.read_parquet("${folder}/data/chunk-000/file-000.parquet")
live = np.stack(df["paddy.action_valid"]) # (rows, 2) left, right
ft = np.stack(df["observation.force_torque.right"]) # fx fy fz tx ty tz
step = df["paddy.subtask_index"] # -1 outside the marks`],
["Depth (PyAV, full release)", `import av
path = "${RELEASES.full.folder}/depth/observation.depth.camera_top/chunk-000/file-000.mkv"
with av.open(path) as c:
for f in c.decode(video=0):
depth_mm = f.to_ndarray(format="gray16le") # ${dh}x${dw} uint16, 0 = no data`],
["Check the download", `cd ${folder}
sha256sum -c SHA256SUMS`],
];
el.innerHTML = blocks.map(([h, code]) => `<div class="card"><div class="kicker">${esc(h)}</div>
<div class="cmd code">${esc(code)}<button class="copy" data-copy="${esc(code)}">copy</button></div></div>`).join("");
});
renderDownload();
$$("#view .copy").forEach((b) => b.addEventListener("click", async () => {
try { await navigator.clipboard.writeText(b.dataset.copy); b.textContent = "copied"; }
catch (e) { b.textContent = "select + copy"; }
setTimeout(() => (b.textContent = "copy"), 1500);
}));
$$(".contact-link", view).forEach((el) => (el.href = CONFIG.contactUrl));
fill("license-line", (el) => (el.textContent = CONFIG.license ? `Sample data licensed ${CONFIG.license}; see the dataset cards.` : "Sample data licence to be announced with the release."));
}
function treeText() {
const cams = INDEX.cameras.map((c) => c.name.replace("camera_", "")).join(",");
return `${RELEASES.full.folder}/
├── data/chunk-000/file-NNN.parquet
├── videos/
│ ├── observation.images.camera_{${cams}}/
│ │ └── chunk-000/file-NNN.mp4
│ └── observation.images.camera_top_stereo_{left,right}/,
│ observation.images.camera_{${cams}}_depth/ full release only
├── depth/ full release only
│ ├── observation.depth.camera_{${cams}}/ aligned
│ └── observation.depth_raw.camera_{${cams}}/ the camera's own
│ └── chunk-000/file-NNN.mkv
├── meta/
│ ├── info.json stats.json tasks.parquet
│ ├── modality.json cameras.json
│ ├── episodes/chunk-000/file-000.parquet
│ └── paddy/
│ ├── info.json keep_ranges.json
│ ├── robot_description.urdf
│ └── episodes/<episode>.json
├── manifest.json
├── SHA256SUMS
└── README.md`;
}
function renderDownload() {
const el = $("#dl");
if (!el) return;
const D = INDEX.downloads;
const camNames = (k) => D[k].cameras.slice().sort((a, b) => INDEX.cameras.findIndex((c) => c.name === a) - INDEX.cameras.findIndex((c) => c.name === b));
fill2("dl-lede", (x) => (x.innerHTML = `The sample has all ${esc(f("episodes"))} episodes in a light form; the full release has
${esc(f("full_episodes"))} of them (episodes ${esc(f("full_episode_list"))}) with everything the rig recorded, lossless. Both are
${esc(f("format"))} with the full set of numeric streams, labels, calibration and the robot model.`));
el.innerHTML = ["sample", "full"].map((k) => {
const d = D[k], R = RELEASES[k], repo = CONFIG.repos[k];
const cmd = `hf download ${repo || "<org>/<dataset>"} --repo-type dataset --local-dir ${R.folder}`;
const py = `from lerobot.datasets.lerobot_dataset import LeRobotDataset\nds = LeRobotDataset("${repo || "<org>/<dataset>"}")`;
const status = repo ? `<span class="chip ok">Available</span>` : `<span class="chip soon">Coming soon</span>`;
const only = k === "full" ? camNames("full").filter((c) => !D.sample.cameras.includes(c)) : [];
return `
<div class="card main ${repo ? "" : "soon"}">
<div class="dl-top">
<div class="kicker" style="margin:0">${esc(d.format)} · ${d.episodes} episodes · ${d.minutes} min · ${esc(d.size)}</div>${status}
</div>
<h3 style="margin-top:10px">${esc(R.title)}</h3>
<p class="repo">${repo ? `<a href="https://huggingface.co/datasets/${esc(repo)}" target="_blank" rel="noopener"><code>${esc(repo)}</code></a>` : `<code>${esc(R.folder)}</code> · repository opens shortly`}</p>
<p>${esc(R.blurb)}</p>
${R.note ? `<p class="dl-note-rec"><b>Everything as recorded.</b> ${esc(R.note)}</p>` : ""}
<ul class="dl-list">
<li>${d.page_episodes ? `Episodes ${d.page_episodes.join(", ")} of the sample` : "Every episode, untrimmed"}</li>
<li>${d.n_cameras} cameras: ${camNames(k).map((c) => `<code>${esc(c)}</code>${only.includes(c) ? ` <span class="chip full">full only</span>` : ""}`).join(", ")}</li>
<li>${d.lossless ? `Lossless H.264 color at the recorded size: ${esc(d.top_resolution)} overhead, ${d.resolution.filter((x) => x !== d.top_resolution).map(esc).join(", ")} the others` : `${d.resolution.map(esc).join(", ")} color at ${esc(f("cam_fps"))} fps, H.264`}</li>
<li>${d.depth ? `Depth from every camera, aligned and raw, lossless FFV1${d.stereo ? "; the overhead camera's infrared stereo pair" : ""} <span class="chip full">full only</span>` : "No depth"}</li>
<li>${d.rows_text} rows · ${d.features} features · ${d.files} files</li>
</ul>
<div class="cmd ${repo ? "" : "disabled"}">${esc(cmd)}${repo ? `<button class="copy" data-copy="${esc(cmd)}">copy</button>` : ""}</div>
<div class="cmd ${repo ? "" : "disabled"}">${esc(py)}${repo ? `<button class="copy" data-copy="${esc(py)}">copy</button>` : ""}</div>
<div class="btns" style="margin-top:16px">
${repo ? `<a class="btn primary" href="https://huggingface.co/datasets/${esc(repo)}" target="_blank" rel="noopener">Dataset page →</a>
<a class="btn" href="${esc(visualizer(repo))}" target="_blank" rel="noopener">Open in LeRobot's visualizer →</a>`
: `<a class="btn primary contact-link" href="${esc(CONFIG.contactUrl)}" target="_blank" rel="noopener">Request it →</a>
<a class="btn" href="#/explore">Preview episodes</a>`}
</div>
</div>`;
}).join("");
fill2("dl-table", (x) => {
const repoCell = (k) => (CONFIG.repos[k] ? `<a href="https://huggingface.co/datasets/${esc(CONFIG.repos[k])}" target="_blank" rel="noopener"><code>${esc(CONFIG.repos[k])}</code></a>` : `<span class="chip soon">coming soon</span>`);
const rows = [
["Hugging Face", repoCell("sample"), repoCell("full")],
["Episodes", `${D.sample.episodes} (all)`, `${D.full.episodes} (episodes ${D.full.page_episodes.join(", ")})`],
["Outcomes", ...["sample", "full"].map((k) => ["success", "failure"].filter((o) => D[k].outcomes[o]).map((o) => `${D[k].outcomes[o]} ${o === "success" ? (D[k].outcomes[o] === 1 ? "success" : "successes") : (D[k].outcomes[o] === 1 ? "failure" : "failures")}`).join(", "))],
["Rows", D.sample.rows_text, D.full.rows_text],
["Duration", `${D.sample.minutes} min`, `${D.full.minutes} min`],
["Size", D.sample.size, D.full.size],
["Files", D.sample.files, D.full.files],
["Cameras", ...["sample", "full"].map((k) => camNames(k).map((c) => `<code>${esc(c)}</code>`).join(" "))],
["Color", ...["sample", "full"].map((k) => D[k].lossless ? `lossless H.264, overhead ${esc(D[k].top_resolution)}` : `H.264, ${D[k].resolution.map(esc).join(", ")}`)],
["Depth", ...["sample", "full"].map((k) => D[k].depth ? `lossless FFV1, every camera${D[k].raw_depth ? ", aligned and raw" : ""}` : "no")],
["Stereo pair", ...["sample", "full"].map((k) => D[k].stereo ? "overhead camera, infrared, lossless" : "no")],
["Features", D.sample.features, D.full.features],
["Licence", CONFIG.license || "to be announced", CONFIG.license || "to be announced"],
];
x.innerHTML = `<thead><tr><th></th><th>${esc(RELEASES.sample.title)}</th><th>${esc(RELEASES.full.title)}</th></tr></thead><tbody>` +
rows.map(([k, a, b]) => `<tr><td class="dim">${esc(k)}</td><td>${a}</td><td>${b}</td></tr>`).join("") + "</tbody>";
});
fill2("dl-note", (x) => {
const diff = F.full_diff_text ? ` An episode starts when every stream in it has started, and the scene camera started last in
one recording: ${esc(f("full_diff_text"))}; the other ${esc(f("full_same_eps"))} have the same rows in both.` : "";
x.innerHTML = `The full release holds episodes ${esc(f("full_episode_list"))} of the sample.${diff} The explorer on this page
plays the sample's ${esc(f("episodes"))} episodes; its scene-camera view is cut from the recordings.
<a href="#/details#files">What each file holds →</a>`;
});
}
function fill2(id, fn) { const el = document.getElementById(id); if (el) fn(el); }
// ---- explorer ----------------------------------------------------------------------------
let filterOutcome = "all";
let filterQ = "";
function renderExplore() {
const view = $("#view");
view.innerHTML = "";
view.appendChild($("#tpl-explore").content.cloneNode(true));
window.scrollTo(0, 0);
$("#search").addEventListener("input", (e) => { filterQ = e.target.value.trim().toLowerCase(); renderList(); });
}
function selectFromParams(params) {
filterOutcome = params.get("outcome") || filterOutcome || "all";
if (params.has("q")) { filterQ = params.get("q").toLowerCase(); $("#search").value = params.get("q"); }
const count = (o) => INDEX.episodes.filter((e) => o === "all" || e.outcome === o).length;
const tabs = [["all", "All"], ["success", "Successes"], ["failure", "Failures"]];
$("#outcome-tabs").innerHTML = tabs.map(([k, l]) => `<button data-outcome="${k}" class="${k === filterOutcome ? "on" : ""}">${l} ${count(k)}</button>`).join("");
$$("#outcome-tabs button").forEach((b) => b.addEventListener("click", () => { filterOutcome = b.dataset.outcome; selectFromParams(new URLSearchParams()); }));
renderList();
const want = params.get("ep");
const t = params.has("t") ? Number(params.get("t")) : null;
const list = visibleEpisodes();
const id = want && INDEX.episodes.some((e) => e.id === want) ? want : (player?.ep.id && list.some((e) => e.id === player.ep.id) ? player.ep.id : list[0]?.id);
if (id && player?.ep.id !== id) loadEpisode(id, t);
else if (player && Number.isFinite(t)) player.seek(t);
markActive(id);
}
function visibleEpisodes() {
return INDEX.episodes.filter((e) => (filterOutcome === "all" || e.outcome === filterOutcome) &&
(!filterQ || `episode ${e.index} ${e.id} ${e.outcome} ${e.scene} ${sceneLabel(e.scene)} ${e.note}`.toLowerCase().includes(filterQ)));
}
function renderList() {
const eps = visibleEpisodes();
const groups = {};
eps.forEach((e) => (groups[e.scene] ||= []).push(e));
$("#eplist").innerHTML = Object.entries(groups).map(([s, es]) => `<h4>${esc(sceneLabel(s))}</h4>` + es.map((e) => `
<a class="ep" href="#/explore?ep=${e.id}${filterOutcome !== "all" ? `&outcome=${filterOutcome}` : ""}" data-id="${e.id}">
<img src="media/${e.id}/poster.jpg" alt="" loading="lazy">
<div><b>Episode ${e.index}</b><span>${esc(sceneLabel(e.scene))} · ${fmtDur(e.duration_s)}</span>
<span class="${e.outcome === "failure" ? "bad" : "good"}">${e.outcome === "failure" ? `✗ failure at step ${e.failed_step + 1}` : "✓ success"}</span>${e.full_index != null ? `<span class="dim">in the full release</span>` : ""}</div>
</a>`).join("")).join("") || `<p style="padding:12px;color:var(--muted)">No episodes match.</p>`;
markActive(player?.ep.id);
}
function markActive(id) { $$(".ep").forEach((a) => a.classList.toggle("on", a.dataset.id === id)); }
async function loadEpisode(id, t = null) {
if (player) { player.destroy(); player = null; }
let ep = epCache.get(id);
if (!ep) { ep = await (await fetch(`data/episodes/${id}.json`)).json(); epCache.set(id, ep); }
if (currentPath !== "/explore" && parseHash().path !== "/explore") return;
player = new Player($("#ep-main"), ep);
if (Number.isFinite(t) && t > 0) {
const p = player;
p.master.addEventListener("loadedmetadata", () => p === player && p.seek(t), { once: true });
if (p.master.readyState >= 1) p.seek(t);
}
markActive(id);
}
const css = (name) => getComputedStyle(document.documentElement).getPropertyValue(name).trim();
const CAM_TILES = [["top", "camera_top · overhead"], ["bottom", "camera_bottom · scene"], ["left", "camera_left · wrist"], ["right", "camera_right · wrist"]];
class Player {
constructor(root, ep) {
this.ep = ep;
this.root = root;
this.rate = 1;
this.dur = ep.duration_s;
const S = ep.series;
const failedSub = ep.subtasks.find((s) => s.outcome === "failure");
root.innerHTML = `
<div class="ep-head">
<div>
<div class="eyebrow" style="margin-bottom:6px">${esc(sceneLabel(ep.scene))} · episode ${ep.index} · session ${ep.session}</div>
<h2>“${esc(INDEX.task.instruction)}”</h2>
<div class="chips">
${ep.outcome === "failure" ? `<span class="chip fail">✗ failure</span>` : `<span class="chip ok">✓ success</span>`}
<span class="chip">${fmtDur(ep.duration_s)} · ${ep.frames} rows</span>
<span class="chip">camera spread ${ep.camera_sync_ms} ms</span><span class="chip">${ep.held_frames} held frames</span>
<span class="chip">lag ${ep.command_lag_ms.left} / ${ep.command_lag_ms.right} ms</span>
<span class="chip">live command ${Math.round(ep.action_valid_pct.left)} / ${Math.round(ep.action_valid_pct.right)} %</span>
${ep.full_index != null ? `<span class="chip full">in the full release as its episode ${ep.full_index}</span>` : ""}
</div>
</div>
</div>
${failedSub ? `<div class="note fail-note"><b>Failed at step ${failedSub.index + 1}</b> (${esc(failedSub.instruction)}), from ${failedSub.start_s.toFixed(1)} s.${ep.note ? ` Operator's note: “${esc(ep.note)}”` : ""}</div>` : ""}
<div class="cams">
${CAM_TILES.map(([c, tag]) => `<div class="cam"><video data-cam="${c}" src="media/${ep.id}/${c}.mp4" muted playsinline preload="auto"></video><span class="tag">${tag}${c === "bottom" ? (ep.full_index != null ? " · full release" : " · preview only") : ""}</span></div>`).join("")}
</div>
<div class="controls">
<button id="pp" aria-label="Play or pause">▶ Play</button>
<button data-step="-1" aria-label="Back one second">−1 s</button><button data-step="1" aria-label="Forward one second">+1 s</button>
${[0.5, 1, 2, 4].map((r) => `<button data-rate="${r}" class="${r === 1 ? "on" : ""}">${r}×</button>`).join("")}
<span class="time" id="time">0:00.0 / ${fmtT(this.dur)}</span>
</div>
<div class="lanes" id="lanes">
<span>subtasks</span><div class="lane" data-lane="sub">${ep.subtasks.map((s) => `<div class="seg ${s.outcome === "failure" ? "fail" : ""}" title="${esc(s.instruction)} (${esc(s.outcome)})" style="left:${100 * s.start_s / this.dur}%;width:${100 * (s.end_s - s.start_s) / this.dur}%;${s.outcome === "failure" ? "" : `background:var(--s${s.index % 3})`}">${s.outcome === "failure" ? "✗ " : ""}${s.index + 1} ${esc(stepWord(s.instruction).toLowerCase())}</div>`).join("")}<div class="head"></div></div>
<span>left deadman</span><div class="lane" data-lane="le">${this.bands(S.engaged.left, "var(--left)", 0.45)}<div class="head"></div></div>
<span>left live cmd</span><div class="lane" data-lane="lv">${this.bands(S.valid.left, "var(--left)", 0.85)}<div class="head"></div></div>
<span>right deadman</span><div class="lane" data-lane="re">${this.bands(S.engaged.right, "var(--right)", 0.45)}<div class="head"></div></div>
<span>right live cmd</span><div class="lane" data-lane="rv">${this.bands(S.valid.right, "var(--right)", 0.85)}<div class="head"></div></div>
</div>
<div class="charts" id="charts"></div>
<p class="ep-files">Preview files for this episode:
${CAM_TILES.map(([c]) => `<a href="media/${ep.id}/${c}.mp4" download>${c}.mp4</a>`).join("")}<a href="data/episodes/${ep.id}.json" download>series.json</a>
<span class="kbd">· Space play/pause · ← → step · previews are ${esc(f("preview_res"))}; the sample has ${esc(f("resolution"))} and full-rate streams.
The scene camera is not in the sample: its preview is cut from the recording, and the full release has it for episodes ${esc(f("full_episode_list"))}.</span></p>`;
this.videos = $$("video", root);
this.master = this.videos[0];
const jointLines = (side) => [
...S.joints[side].map((v, j) => [`j${j + 1}`, v, `j${j}`]),
...S.joint_cmd[side].map((v, j) => [`cmd j${j + 1}`, v, `j${j}`, { dash: true, legend: false }]),
];
this.charts = [
{ title: "Gripper opening", unit: "0 closed · 1 open", lines: [["left", S.gripper.left, "--left"], ["right", S.gripper.right, "--right"]], min: 0, max: 1 },
{ title: "TCP speed", unit: "mm/s", lines: [["left", S.tcp_speed.left, "--left"], ["right", S.tcp_speed.right, "--right"]], min: 0, digits: 0 },
{ title: "Right wrist force", unit: "N, flange frame", lines: [["fx", S.force[0], "--fx"], ["fy", S.force[1], "--fy"], ["fz", S.force[2], "--fz"]] },
{ title: "Right wrist torque", unit: "N·m, flange frame", lines: [["tx", S.torque[0], "--fx"], ["ty", S.torque[1], "--fy"], ["tz", S.torque[2], "--fz"]] },
{ title: "Left arm joints", unit: "deg · dashed: command", lines: jointLines("left"), deg: true },
{ title: "Right arm joints", unit: "deg · dashed: command", lines: jointLines("right"), deg: true },
];
$("#charts", root).innerHTML = this.charts.map((c, i) => `
<div class="chart"><div class="ct">${esc(c.title)} <span>${esc(c.unit)}</span></div>
<div class="lg" id="lg${i}"></div><canvas id="cv${i}"></canvas></div>`).join("");
this.charts.forEach((c, i) => { c.canvas = $(`#cv${i}`, root); c.legend = $(`#lg${i}`, root); });
this.onKey = (e) => {
if (e.target.matches("input, textarea")) return;
if (e.code === "Space") { e.preventDefault(); this.toggle(); }
else if (e.key === "ArrowRight") this.seek(this.master.currentTime + (e.shiftKey ? 5 : 1));
else if (e.key === "ArrowLeft") this.seek(this.master.currentTime - (e.shiftKey ? 5 : 1));
};
document.addEventListener("keydown", this.onKey);
$("#pp", root).addEventListener("click", () => this.toggle());
$$("[data-step]", root).forEach((b) => b.addEventListener("click", () => this.seek(this.master.currentTime + Number(b.dataset.step))));
$$("[data-rate]", root).forEach((b) => b.addEventListener("click", () => {
this.rate = Number(b.dataset.rate);
this.videos.forEach((v) => (v.playbackRate = this.rate));
$$("[data-rate]", root).forEach((x) => x.classList.toggle("on", x === b));
}));
$$(".lane", root).forEach((l) => l.addEventListener("click", (e) => {
const r = l.getBoundingClientRect();
this.seek(((e.clientX - r.left) / r.width) * this.dur);
}));
this.charts.forEach((c) => {
const go = (e) => { const r = c.canvas.getBoundingClientRect(); this.seek(((e.clientX - r.left - this.padL) / (r.width - this.padL - 6)) * this.dur); };
c.canvas.addEventListener("pointerdown", (e) => { go(e); c.canvas.setPointerCapture(e.pointerId); c.drag = true; });
c.canvas.addEventListener("pointermove", (e) => c.drag && go(e));
c.canvas.addEventListener("pointerup", () => (c.drag = false));
});
this.master.addEventListener("play", () => ($("#pp", root).textContent = "❚❚ Pause"));
this.master.addEventListener("pause", () => ($("#pp", root).textContent = "▶ Play"));
this.master.addEventListener("ended", () => this.videos.forEach((v) => v.pause()));
this.onResize = () => this.redraw();
window.addEventListener("resize", this.onResize);
this.padL = 38;
this.redraw();
this.tick = this.tick.bind(this);
this.raf = requestAnimationFrame(this.tick);
}
bands(mask, color, opacity) {
const t = this.ep.series.t;
let out = "", start = null;
for (let i = 0; i <= mask.length; i++) {
const on = i < mask.length && mask[i];
if (on && start === null) start = t[i];
if (!on && start !== null) {
const end = i < t.length ? t[i] : this.dur;
out += `<div class="seg" style="left:${100 * start / this.dur}%;width:${100 * (end - start) / this.dur}%;background:${color};opacity:${opacity}"></div>`;
start = null;
}
}
return out;
}
toggle() {
if (this.master.paused) {
if (this.master.ended || this.master.currentTime >= this.dur - 0.05) this.seek(0);
this.videos.forEach((v) => { v.playbackRate = this.rate; v.play().catch(() => {}); });
} else this.videos.forEach((v) => v.pause());
}
seek(t) {
t = Math.max(0, Math.min(this.dur, t));
this.videos.forEach((v) => (v.currentTime = t));
this.drawHeads(t);
}
tick() {
const t = this.master.currentTime;
if (!this.master.paused) {
for (const v of this.videos.slice(1)) if (Math.abs(v.currentTime - t) > 0.1) v.currentTime = t;
}
if (t !== this.lastT) { this.drawHeads(t); this.lastT = t; }
this.raf = requestAnimationFrame(this.tick);
}
drawHeads(t) {
$("#time", this.root).textContent = `${fmtT(t)} / ${fmtT(this.dur)}`;
$$(".lane .head", this.root).forEach((h) => (h.style.left = `${100 * t / this.dur}%`));
this.charts.forEach((c) => this.drawChart(c, t));
}
redraw() { this.drawHeads(this.master.currentTime || 0); }
drawChart(c, t) {
const cv = c.canvas, dpr = window.devicePixelRatio || 1;
const W = cv.clientWidth, H = cv.clientHeight;
if (!W) return;
if (cv.width !== Math.round(W * dpr)) { cv.width = Math.round(W * dpr); cv.height = Math.round(H * dpr); }
const g = cv.getContext("2d");
g.setTransform(dpr, 0, 0, dpr, 0, 0);
g.clearRect(0, 0, W, H);
const ts = this.ep.series.t;
let lo = c.min ?? Infinity, hi = c.max ?? -Infinity;
if (c.min === undefined || c.max === undefined) {
for (const [, v] of c.lines) for (const x of v) { if (c.min === undefined && x < lo) lo = x; if (c.max === undefined && x > hi) hi = x; }
const pad = (hi - lo) * 0.08 || 1; if (c.min === undefined) lo -= pad; if (c.max === undefined) hi += pad;
}
const x0 = this.padL, x1 = W - 6, y0 = 6, y1 = H - 16;
const X = (tt) => x0 + (tt / this.dur) * (x1 - x0);
const Y = (v) => y1 - ((v - lo) / (hi - lo)) * (y1 - y0);
g.font = "10px IBM Plex Mono, monospace";
g.fillStyle = css("--dim"); g.strokeStyle = css("--line"); g.lineWidth = 1;
for (const v of [lo, (lo + hi) / 2, hi]) {
const y = Math.round(Y(v)) + 0.5;
g.beginPath(); g.moveTo(x0, y); g.lineTo(x1, y); g.stroke();
g.fillText(Math.abs(hi - lo) < 5 ? v.toFixed(2) : Math.round(v).toString(), 2, y + 3);
}
for (let s = 0; s <= this.dur; s += this.dur > 40 ? 10 : 5) g.fillText(`${s}s`, X(s) - 6, H - 3);
const jointColors = ["#2f6fde", "#e0602b", "#2f9e64", "#a855c7", "#d6455d", "#0e9aa7", "#8a7a18"];
const idx = Math.max(0, Math.min(ts.length - 1, Math.round((t / this.dur) * (ts.length - 1))));
let lg = "";
c.lines.forEach(([name, v, color, opt = {}]) => {
const col = color.startsWith("--") ? css(color) : jointColors[Number(color.slice(1))];
g.strokeStyle = col; g.lineWidth = opt.dash ? 1 : 1.5; g.globalAlpha = opt.dash ? 0.6 : 1;
g.setLineDash(opt.dash ? [3, 3] : []);
g.beginPath();
for (let i = 0; i < v.length; i++) { const x = X(ts[i]), y = Y(v[i]); i ? g.lineTo(x, y) : g.moveTo(x, y); }
g.stroke();
g.setLineDash([]); g.globalAlpha = 1;
if (opt.legend === false) return;
const val = v[idx];
lg += `<span><i style="background:${col}"></i>${esc(name)} ${val.toFixed(c.digits ?? (c.deg || Math.abs(val) >= 100 ? 1 : 2))}</span>`;
});
if (c._lg !== lg) { c.legend.innerHTML = lg; c._lg = lg; }
const px = Math.round(X(t)) + 0.5;
g.strokeStyle = css("--fg"); g.lineWidth = 1; g.beginPath(); g.moveTo(px, y0); g.lineTo(px, y1); g.stroke();
}
destroy() {
cancelAnimationFrame(this.raf);
document.removeEventListener("keydown", this.onKey);
window.removeEventListener("resize", this.onResize);
this.videos.forEach((v) => { v.pause(); v.removeAttribute("src"); v.load(); });
}
}