mishig HF Staff commited on
Commit
67e7271
·
verified ·
1 Parent(s): 1926d2f

Sync from huggingface/lerobot-dataset-visualizer via hub-sync

Browse files
Files changed (2) hide show
  1. src/app/page.tsx +1 -1
  2. src/components/urdf-viewer.tsx +20 -1
src/app/page.tsx CHANGED
@@ -45,7 +45,7 @@ const EXAMPLE_DATASETS = [
45
  "lerobot/svla_so101_pickplace",
46
  "lerobot/high_quality_folding",
47
  "lerobot/aloha_static_cups_open",
48
- "imstevenpmwork/thanos_picking_power_gem",
49
  ];
50
 
51
  function HomeInner() {
 
45
  "lerobot/svla_so101_pickplace",
46
  "lerobot/high_quality_folding",
47
  "lerobot/aloha_static_cups_open",
48
+ "unitreerobotics/G1_WBT_Inspire_Push_Wheelchair",
49
  ];
50
 
51
  function HomeInner() {
src/components/urdf-viewer.tsx CHANGED
@@ -169,7 +169,11 @@ function groupColumnsByPrefix(keys: string[]): Record<string, string[]> {
169
  for (const key of keys) {
170
  if (key === "timestamp") continue;
171
  const parts = key.split(SERIES_DELIM);
172
- const prefix = parts.length > 1 ? parts[0].trim() : "other";
 
 
 
 
173
  if (!groups[prefix]) groups[prefix] = [];
174
  groups[prefix].push(key);
175
  }
@@ -232,6 +236,14 @@ function autoMatchJoints(
232
  (k.split(SERIES_DELIM).pop()?.trim() ?? k).toLowerCase(),
233
  );
234
 
 
 
 
 
 
 
 
 
235
  // Build reverse lookup: URDF joint name → column key (for G1 SDK-style columns)
236
  const g1Reverse = new Map<string, string>();
237
  for (let i = 0; i < suffixes.length; i++) {
@@ -257,6 +269,13 @@ function autoMatchJoints(
257
  continue;
258
  }
259
 
 
 
 
 
 
 
 
260
  // OpenArm: openarm_(left|right)_joint(\d+) → (left|right)_joint_(\d+) or (left|right)_joint(\d+),
261
  // whole words so joint1 doesn't take joint10
262
  const armMatch = lower.match(/^openarm_(left|right)_joint(\d+)$/);
 
169
  for (const key of keys) {
170
  if (key === "timestamp") continue;
171
  const parts = key.split(SERIES_DELIM);
172
+ const feature = parts.length > 1 ? parts[0].trim() : "other";
173
+ /// Features split under observation.state or action (Unitree's left_arm, lower_body...) are one
174
+ /// source, so a robot's joints map from all of them.
175
+ const prefix =
176
+ feature.match(/^(observation\.state|action)\./)?.[1] ?? feature;
177
  if (!groups[prefix]) groups[prefix] = [];
178
  groups[prefix].push(key);
179
  }
 
236
  (k.split(SERIES_DELIM).pop()?.trim() ?? k).toLowerCase(),
237
  );
238
 
239
+ /// A side named by the feature rather than the column (`left_arm | shoulder_pitch`) joins the name.
240
+ const sided = columnKeys.map((k, i) => {
241
+ const side = k.split(SERIES_DELIM)[0].match(/\.(left|right)_[^.]*$/)?.[1];
242
+ return side && !suffixes[i].startsWith(`${side}_`)
243
+ ? `${side}_${suffixes[i]}`
244
+ : suffixes[i];
245
+ });
246
+
247
  // Build reverse lookup: URDF joint name → column key (for G1 SDK-style columns)
248
  const g1Reverse = new Map<string, string>();
249
  for (let i = 0; i < suffixes.length; i++) {
 
269
  continue;
270
  }
271
 
272
+ // Without the `_joint` suffix: left_hip_pitch_joint → `left_hip_pitch`, or `hip_pitch` in left_leg
273
+ const sidedIdx = sided.indexOf(lower.replace(/_joint$/, ""));
274
+ if (sidedIdx >= 0) {
275
+ mapping[jointName] = columnKeys[sidedIdx];
276
+ continue;
277
+ }
278
+
279
  // OpenArm: openarm_(left|right)_joint(\d+) → (left|right)_joint_(\d+) or (left|right)_joint(\d+),
280
  // whole words so joint1 doesn't take joint10
281
  const armMatch = lower.match(/^openarm_(left|right)_joint(\d+)$/);