Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Sync from huggingface/lerobot-dataset-visualizer via hub-sync
Browse files
src/app/[org]/[dataset]/[episode]/fetch-data.ts
CHANGED
|
@@ -1262,10 +1262,12 @@ function chartDataFromFrames(
|
|
| 1262 |
for (const [key, components] of Object.entries(frames.series)) {
|
| 1263 |
if (!info.features[key] || excludedColumns.includes(key)) continue;
|
| 1264 |
if (hasHandTracking(info) && isHandGeometryColumn(key)) continue;
|
| 1265 |
-
|
| 1266 |
-
|
| 1267 |
-
|
| 1268 |
-
|
|
|
|
|
|
|
| 1269 |
components.forEach((values, i) => {
|
| 1270 |
const suffix = names?.[i] ?? (components.length > 1 ? i : undefined);
|
| 1271 |
series.push([
|
|
|
|
| 1262 |
for (const [key, components] of Object.entries(frames.series)) {
|
| 1263 |
if (!info.features[key] || excludedColumns.includes(key)) continue;
|
| 1264 |
if (hasHandTracking(info) && isHandGeometryColumn(key)) continue;
|
| 1265 |
+
/// The reader skips names nested in one more list, like Unitree's `[["kLeftShoulderPitch", ...]]`.
|
| 1266 |
+
const nested = (info.features[key].names as unknown[] | null)?.[0];
|
| 1267 |
+
const declared =
|
| 1268 |
+
frames.names[key] ??
|
| 1269 |
+
(Array.isArray(nested) ? (nested as string[]) : undefined);
|
| 1270 |
+
const names = declared?.length === components.length ? declared : undefined;
|
| 1271 |
components.forEach((values, i) => {
|
| 1272 |
const suffix = names?.[i] ?? (components.length > 1 ? i : undefined);
|
| 1273 |
series.push([
|
src/components/urdf-viewer.tsx
CHANGED
|
@@ -176,7 +176,7 @@ function groupColumnsByPrefix(keys: string[]): Record<string, string[]> {
|
|
| 176 |
return groups;
|
| 177 |
}
|
| 178 |
|
| 179 |
-
// Unitree G1 SDK column suffix → URDF joint name
|
| 180 |
const G1_SDK_TO_URDF: Record<string, string> = {
|
| 181 |
"klefthippitch.q": "left_hip_pitch_joint",
|
| 182 |
"klefthiproll.q": "left_hip_roll_joint",
|
|
@@ -207,6 +207,20 @@ const G1_SDK_TO_URDF: Record<string, string> = {
|
|
| 207 |
"krightwristroll.q": "right_wrist_roll_joint",
|
| 208 |
"krightwristpitch.q": "right_wrist_pitch_joint",
|
| 209 |
"krightwristyaw.q": "right_wrist_yaw_joint",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
};
|
| 211 |
|
| 212 |
function autoMatchJoints(
|
|
@@ -221,7 +235,8 @@ function autoMatchJoints(
|
|
| 221 |
// Build reverse lookup: URDF joint name → column key (for G1 SDK-style columns)
|
| 222 |
const g1Reverse = new Map<string, string>();
|
| 223 |
for (let i = 0; i < suffixes.length; i++) {
|
| 224 |
-
const urdfName =
|
|
|
|
| 225 |
if (urdfName) g1Reverse.set(urdfName, columnKeys[i]);
|
| 226 |
}
|
| 227 |
|
|
|
|
| 176 |
return groups;
|
| 177 |
}
|
| 178 |
|
| 179 |
+
// Unitree G1 SDK column suffix → URDF joint name. Unitree's own datasets leave out the `.q`.
|
| 180 |
const G1_SDK_TO_URDF: Record<string, string> = {
|
| 181 |
"klefthippitch.q": "left_hip_pitch_joint",
|
| 182 |
"klefthiproll.q": "left_hip_roll_joint",
|
|
|
|
| 207 |
"krightwristroll.q": "right_wrist_roll_joint",
|
| 208 |
"krightwristpitch.q": "right_wrist_pitch_joint",
|
| 209 |
"krightwristyaw.q": "right_wrist_yaw_joint",
|
| 210 |
+
"klefthandthumb0.q": "left_hand_thumb_0_joint",
|
| 211 |
+
"klefthandthumb1.q": "left_hand_thumb_1_joint",
|
| 212 |
+
"klefthandthumb2.q": "left_hand_thumb_2_joint",
|
| 213 |
+
"klefthandmiddle0.q": "left_hand_middle_0_joint",
|
| 214 |
+
"klefthandmiddle1.q": "left_hand_middle_1_joint",
|
| 215 |
+
"klefthandindex0.q": "left_hand_index_0_joint",
|
| 216 |
+
"klefthandindex1.q": "left_hand_index_1_joint",
|
| 217 |
+
"krighthandthumb0.q": "right_hand_thumb_0_joint",
|
| 218 |
+
"krighthandthumb1.q": "right_hand_thumb_1_joint",
|
| 219 |
+
"krighthandthumb2.q": "right_hand_thumb_2_joint",
|
| 220 |
+
"krighthandmiddle0.q": "right_hand_middle_0_joint",
|
| 221 |
+
"krighthandmiddle1.q": "right_hand_middle_1_joint",
|
| 222 |
+
"krighthandindex0.q": "right_hand_index_0_joint",
|
| 223 |
+
"krighthandindex1.q": "right_hand_index_1_joint",
|
| 224 |
};
|
| 225 |
|
| 226 |
function autoMatchJoints(
|
|
|
|
| 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++) {
|
| 238 |
+
const urdfName =
|
| 239 |
+
G1_SDK_TO_URDF[suffixes[i]] ?? G1_SDK_TO_URDF[`${suffixes[i]}.q`];
|
| 240 |
if (urdfName) g1Reverse.set(urdfName, columnKeys[i]);
|
| 241 |
}
|
| 242 |
|