Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Sync from huggingface/lerobot-dataset-visualizer via hub-sync
Browse filesFiles changed (3)
123456315 unmodified lines322323324// Generated from the USDs in https://huggingface.co/datasets/lerobot/robot-usds: each mesh part's// convex hull, projected onto the plane the animated joints turn in (SO-101 from the side, OpenArm from// the front), in a 240-unit view box. Paths are absolute; a link's pivot is its joint's origin.export interface LoaderLink {name: string;315 unmodified lines],},];1234567315 unmodified lines323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714// Generated from the USDs in https://huggingface.co/datasets/lerobot/robot-usds: each mesh part's// convex hull, projected onto the plane the animated joints turn in (SO-101 from the side, OpenArm// and G1 from the front), in a 240-unit view box. Paths are absolute; a link's pivot is its joint's// origin.export interface LoaderLink {name: string;315 unmodified lines],},];export const G1_LINKS: LoaderLink[] = [{name: "left_hand_index_1_link",parent: "left_hand_index_0_link",pivot: [143.8, 89.1],paths: ["M142.4 89.4L142.5 88.7L142.6 88.4L142.7 88.3L142.9 88.1L143.1 88.0L143.4 87.9L144.0 87.8L144.6 87.8L144.6 91.8L143.7 91.8L143.4 91.7L143.1 91.6L142.7 91.2L142.6 91.0L142.5 90.7L142.4 90.0Z","M142.7 87.5L143.0 87.0L143.8 86.9L144.6 87.0L144.7 87.1L144.9 87.5L145.1 88.3L145.2 88.9L145.2 90.3L145.1 91.1L144.9 91.7L144.8 91.8L144.4 91.8L142.7 91.6Z",],},{name: "right_hand_index_1_link",parent: "right_hand_index_0_link",pivot: [96.2, 89.1],paths: ["M95.4 87.8L96.2 87.8L96.7 87.9L97.0 88.0L97.4 88.4L97.5 88.7L97.6 89.4L97.6 89.9L97.5 90.7L97.4 91.0L97.3 91.2L97.1 91.4L96.8 91.6L96.6 91.7L96.3 91.8L95.4 91.8Z","M94.8 88.9L95.1 87.1L95.3 87.0L95.8 86.9L96.6 86.9L97.1 87.0L97.3 87.1L97.3 91.6L95.6 91.8L95.2 91.8L95.1 91.7L94.9 91.0L94.8 90.3Z",],},{name: "left_hand_middle_1_link",parent: "left_hand_middle_0_link",pivot: [143.8, 97.8],paths: ["M142.4 98.2L142.5 97.4L142.6 97.1L142.7 97.0L142.9 96.8L143.1 96.7L143.5 96.6L144.2 96.5L144.6 96.5L144.6 100.5L144.4 100.6L144.2 100.6L143.6 100.5L143.3 100.4L143.1 100.3L142.7 99.9L142.6 99.7L142.5 99.4L142.4 98.7Z","M142.7 96.2L143.0 95.8L143.1 95.7L144.5 95.7L144.7 95.8L144.9 96.2L145.1 97.0L145.2 97.6L145.2 99.1L145.1 99.8L144.9 100.4L144.8 100.5L144.4 100.5L142.7 100.3Z",],},{name: "right_hand_middle_1_link",parent: "right_hand_middle_0_link",pivot: [96.2, 97.8],paths: ["M95.4 96.5L96.0 96.5L96.6 96.6L96.9 96.7L97.1 96.8L97.4 97.1L97.5 97.4L97.6 98.2L97.6 98.7L97.5 99.4L97.4 99.7L97.3 99.9L96.9 100.3L96.6 100.4L96.3 100.5L95.4 100.5Z","M94.8 97.6L95.1 95.8L95.4 95.7L97.0 95.7L97.3 95.8L97.3 100.4L95.6 100.5L95.2 100.5L95.1 100.4L94.9 99.8L94.8 99.0Z",],},{name: "left_hand_index_0_link",parent: "left_wrist_yaw_link",pivot: [143.8, 87.9],paths: ["M141.5 87.1L141.6 86.9L142.8 85.8L143.1 85.7L144.5 85.7L144.8 85.8L145.8 86.4L145.8 91.2L145.4 91.3L145.1 91.3L142.4 90.8L141.6 90.4L141.5 90.2Z",],},{name: "right_hand_index_0_link",parent: "right_wrist_yaw_link",pivot: [96.2, 87.9],paths: ["M94.2 86.4L95.5 85.8L96.9 85.8L98.3 87.0L98.4 87.1L98.5 87.2L98.5 90.4L98.4 90.5L98.3 90.6L97.6 90.9L95.3 91.3L94.2 91.3Z",],},{name: "left_hand_middle_0_link",parent: "left_wrist_yaw_link",pivot: [143.8, 96.6],paths: ["M141.5 95.8L141.6 95.6L142.8 94.5L143.3 94.4L144.4 94.4L144.8 94.5L145.8 95.1L145.8 100.0L145.1 100.0L142.4 99.5L141.6 99.1L141.5 98.9Z",],},{name: "right_hand_middle_0_link",parent: "right_wrist_yaw_link",pivot: [96.2, 96.6],paths: ["M94.2 95.1L95.5 94.5L96.8 94.5L97.0 94.6L97.6 95.1L98.4 95.8L98.5 96.0L98.5 99.1L98.4 99.3L97.6 99.6L95.3 100.0L94.2 100.0Z",],},{name: "right_wrist_yaw_link",parent: "right_wrist_pitch_link",pivot: [96.9, 89.0],paths: ["M93.1 90.0L93.2 87.4L93.3 87.1L93.6 86.2L93.8 85.8L94.0 85.4L94.1 85.3L94.3 85.1L95.0 85.0L97.3 85.0L98.0 85.1L98.4 85.2L98.8 85.5L99.2 86.1L99.5 87.4L99.6 88.5L99.6 93.9L99.3 97.3L99.0 98.0L98.9 98.2L98.8 98.4L98.4 98.6L98.0 98.7L95.5 98.7L94.5 98.6L94.3 98.4L94.1 98.2L93.9 97.9L93.8 97.7L93.6 97.3L93.2 96.3L93.1 93.9Z","M92.2 89.8L92.3 89.0L92.4 88.5L92.5 88.2L92.7 87.7L94.1 85.3L94.3 85.1L94.4 85.0L94.8 84.8L95.0 84.7L95.3 84.6L96.0 84.4L96.6 84.3L97.1 84.3L97.7 84.4L98.2 84.5L99.0 84.8L99.5 85.1L99.7 85.3L100.2 86.6L100.3 86.9L100.4 87.3L100.5 87.8L100.6 88.6L100.6 91.3L100.5 92.1L100.4 92.6L100.3 92.9L100.0 93.5L99.5 93.9L98.9 94.2L98.3 94.4L98.0 94.5L97.6 94.6L96.1 94.6L95.7 94.5L95.4 94.4L95.1 94.3L94.9 94.2L94.7 94.1L94.2 93.8L93.9 93.6L93.8 93.5L93.6 93.3L93.1 92.7L92.8 92.3L92.6 91.8L92.4 91.3L92.3 90.8L92.2 90.1Z",],},{name: "left_wrist_yaw_link",parent: "left_wrist_pitch_link",pivot: [143.1, 89.0],paths: ["M140.4 88.5L140.5 87.4L140.8 86.1L141.2 85.5L141.6 85.2L142.0 85.1L143.0 85.0L145.0 85.0L145.7 85.1L145.8 85.2L145.9 85.3L146.0 85.4L146.4 86.2L146.8 87.4L146.9 89.6L146.9 93.9L146.8 96.3L146.4 97.3L146.3 97.5L146.1 97.9L145.9 98.2L145.8 98.3L145.5 98.6L144.5 98.7L142.0 98.7L141.6 98.6L141.2 98.4L141.0 98.0L140.7 97.3L140.4 93.9Z","M139.4 88.6L139.5 87.8L139.6 87.3L139.7 86.9L140.3 85.3L140.5 85.1L140.8 84.9L141.0 84.8L141.2 84.7L141.8 84.5L142.3 84.4L142.9 84.3L143.4 84.3L143.9 84.4L144.8 84.6L145.2 84.8L145.7 85.1L145.8 85.2L145.9 85.3L147.3 87.7L147.5 88.2L147.6 88.5L147.7 89.0L147.8 89.8L147.8 90.1L147.7 90.8L147.6 91.3L147.4 91.8L147.3 92.0L147.2 92.2L146.9 92.7L146.4 93.3L146.3 93.4L146.0 93.7L145.5 94.0L144.9 94.3L144.6 94.4L144.3 94.5L143.9 94.6L142.4 94.6L141.9 94.5L141.6 94.4L141.1 94.2L140.5 93.9L140.0 93.5L139.7 92.9L139.6 92.6L139.5 92.1L139.4 91.3Z",],},{name: "right_hand_thumb_1_link",parent: "right_hand_thumb_0_link",pivot: [99.4, 90.7],paths: ["M98.4 88.7L98.6 88.6L102.4 88.4L107.6 88.4L108.0 88.5L108.0 92.5L105.2 92.9L99.4 92.9L98.6 92.8L98.4 89.4Z",],},{name: "left_hand_thumb_1_link",parent: "left_hand_thumb_0_link",pivot: [140.6, 90.7],paths: ["M132.0 88.5L132.4 88.4L137.6 88.4L140.9 88.6L141.4 88.7L141.6 92.1L141.6 92.8L141.3 92.9L137.6 93.0L134.6 93.0L132.0 92.6Z",],},{name: "right_hand_thumb_0_link",parent: "right_wrist_yaw_link",pivot: [96.4, 90.8],paths: ["M96.4 89.1L96.5 89.0L99.6 89.0L100.5 89.1L100.8 89.2L100.8 92.5L96.4 92.5Z",],},{name: "left_hand_thumb_0_link",parent: "left_wrist_yaw_link",pivot: [143.6, 90.8],paths: ["M139.2 89.2L139.5 89.1L140.4 89.0L143.5 89.0L143.6 89.1L143.6 92.5L139.2 92.5Z",],},{name: "right_hand_thumb_2_link",parent: "right_hand_thumb_1_link",pivot: [106.6, 90.7],paths: ["M105.5 92.2L105.7 88.7L105.9 88.6L109.7 88.6L111.0 88.7L111.7 88.8L113.1 89.0L113.6 89.1L114.0 89.3L114.2 89.4L114.4 89.6L114.5 89.7L114.6 89.9L114.6 91.4L114.4 91.8L114.2 91.9L114.0 92.0L113.7 92.1L113.2 92.2L109.7 92.9L105.9 92.9L105.5 92.8Z",],},{name: "left_hand_thumb_2_link",parent: "left_hand_thumb_1_link",pivot: [133.4, 90.7],paths: ["M125.4 89.9L125.6 89.5L126.0 89.3L126.2 89.2L126.5 89.1L127.3 88.9L128.8 88.7L130.3 88.6L134.3 88.6L134.5 88.7L134.5 89.3L134.3 92.8L134.0 92.9L130.3 92.9L126.8 92.2L126.3 92.1L126.0 92.0L125.8 91.9L125.6 91.7L125.5 91.6L125.4 91.4Z",],},{name: "right_wrist_pitch_link",parent: "right_wrist_roll_link",pivot: [96.9, 87.8],paths: ["M92.5 86.3L93.7 83.9L94.3 83.3L99.8 83.3L100.4 83.9L101.3 86.3L101.3 92.0L100.5 92.7L100.2 92.8L99.7 92.9L99.1 93.0L98.4 93.1L95.4 93.1L94.7 93.0L94.1 92.9L93.6 92.8L93.3 92.7L92.5 92.0Z",],},{name: "left_wrist_pitch_link",parent: "left_wrist_roll_link",pivot: [143.1, 87.8],paths: ["M138.7 86.3L139.6 83.9L140.2 83.3L145.7 83.3L146.3 83.9L147.5 86.3L147.5 92.0L146.7 92.7L146.4 92.8L145.9 92.9L145.3 93.0L144.6 93.1L141.6 93.1L140.9 93.0L140.3 92.9L139.8 92.8L139.5 92.7L138.7 92.0Z",],},{name: "left_wrist_roll_link",parent: "left_elbow_link",pivot: [143.1, 86.7],paths: ["M138.4 86.0L138.5 85.5L138.7 85.0L138.9 84.6L139.3 83.9L139.6 83.6L139.8 83.4L140.2 83.1L140.5 82.9L141.2 82.5L141.8 82.3L142.3 82.2L143.8 82.2L144.7 82.4L144.9 82.5L145.5 82.8L145.7 82.9L146.1 83.2L146.4 83.5L146.7 83.8L147.0 84.2L147.3 84.7L147.6 85.4L147.7 85.9L147.8 86.5L147.8 87.9L147.6 89.1L147.5 89.4L147.4 89.6L147.2 90.0L146.8 90.6L144.8 91.3L144.5 91.4L144.0 91.5L143.1 91.6L142.3 91.5L141.7 91.4L139.3 90.5L139.2 90.4L139.1 90.3L138.7 89.6L138.6 89.3L138.4 88.6Z",],},{name: "right_wrist_roll_link",parent: "right_elbow_link",pivot: [96.9, 86.7],paths: ["M92.2 86.5L92.3 85.9L92.4 85.4L92.7 84.7L93.0 84.2L93.3 83.8L93.6 83.5L93.9 83.2L94.3 82.9L94.5 82.8L95.1 82.5L95.3 82.4L96.2 82.2L97.7 82.2L98.1 82.3L98.8 82.5L99.4 82.8L99.8 83.1L100.2 83.4L100.4 83.6L100.8 84.1L101.1 84.5L101.4 85.2L101.5 85.5L101.6 86.0L101.6 88.6L101.4 89.3L101.3 89.6L100.9 90.3L100.7 90.5L98.3 91.4L97.2 91.6L96.7 91.6L96.0 91.5L95.5 91.4L95.2 91.3L93.2 90.6L92.8 90.0L92.5 89.4L92.4 89.1L92.3 88.5L92.2 87.9Z",],},{name: "torso_link",parent: "waist_roll_link",pivot: [120.0, 91.3],paths: ["M107.9 46.5L111.4 24.3L111.6 23.3L111.7 22.9L111.8 22.6L112.1 21.8L112.3 21.3L112.7 20.5L113.3 19.7L114.3 18.7L114.4 18.6L115.1 18.1L115.8 17.7L116.5 17.4L117.1 17.2L117.8 17.0L118.5 16.9L119.3 16.8L120.7 16.8L121.5 16.9L122.2 17.0L122.9 17.2L123.5 17.4L124.2 17.7L124.9 18.1L125.6 18.6L125.7 18.7L126.7 19.7L127.1 20.2L127.3 20.5L127.7 21.3L127.9 21.8L128.2 22.6L128.3 22.9L128.4 23.3L128.6 24.3L132.1 46.5L132.1 47.2L131.9 47.6L131.8 47.7L131.6 47.9L130.8 48.5L130.3 48.7L130.0 48.8L129.6 48.9L127.4 49.4L124.3 49.7L121.4 49.8L118.9 49.8L116.0 49.7L114.4 49.6L112.7 49.4L111.7 49.2L110.7 49.0L110.3 48.9L109.1 48.4L108.8 48.2L108.5 48.0L108.2 47.7L108.0 47.4L107.9 47.2Z","M104.0 55.9L104.1 54.9L104.2 53.9L105.7 47.6L105.8 47.3L107.8 46.7L132.2 46.7L134.2 47.3L134.3 47.6L135.6 53.3L135.7 53.8L135.9 54.9L136.0 55.9L136.0 57.4L135.9 59.7L135.8 61.8L134.6 80.1L134.3 81.7L133.8 83.0L130.5 91.1L130.4 91.3L130.0 91.9L129.9 92.0L129.5 92.2L129.2 92.3L128.8 92.4L127.3 92.7L122.3 92.9L117.6 92.9L115.3 92.8L111.7 92.5L111.2 92.4L110.5 92.2L110.1 92.0L110.0 91.9L109.6 91.3L109.5 91.1L105.8 82.1L105.7 81.7L105.5 80.6L105.4 79.7L105.1 76.1L104.7 69.9L104.2 62.1L104.0 58.2Z","M107.7 48.1L108.2 43.9L108.3 43.8L108.4 43.7L108.6 43.7L108.8 43.8L108.9 43.9L109.6 48.0L109.6 48.9L109.5 49.2L109.4 49.3L109.1 49.5L108.9 49.6L108.4 49.6L108.1 49.5L107.8 49.1L107.7 48.9Z","M130.4 48.0L130.6 43.9L130.8 43.7L131.1 43.7L131.3 43.9L131.4 44.0L132.3 48.1L132.3 48.8L132.2 49.1L132.1 49.3L132.0 49.4L131.7 49.6L131.0 49.6L130.8 49.5L130.7 49.4L130.6 49.3L130.5 49.1L130.4 48.9Z","M103.3 57.6L103.4 57.1L103.7 55.9L104.1 54.4L105.0 51.3L105.4 50.0L105.7 49.2L105.8 49.0L105.9 49.0L114.4 51.4L114.5 51.5L114.2 53.1L113.4 56.0L112.7 58.4L112.3 59.6L112.0 60.4L111.9 60.6L111.8 60.6L103.3 58.2Z","M125.5 51.5L125.6 51.4L134.1 49.0L134.2 49.0L134.3 49.2L134.6 50.0L135.0 51.3L135.9 54.4L136.3 55.9L136.6 57.1L136.7 57.6L136.7 58.2L128.2 60.6L128.1 60.6L128.0 60.4L127.7 59.6L127.3 58.4L126.6 56.0L125.8 53.1Z","M103.9 53.6L104.0 52.9L104.4 51.1L104.6 50.3L105.1 48.8L105.4 47.9L105.6 47.4L114.5 43.9L125.5 43.9L134.4 47.4L134.6 47.9L134.9 48.8L135.6 51.1L136.0 52.9L136.1 53.8L136.1 56.8L135.0 77.3L134.9 79.1L134.7 80.6L134.2 82.3L130.5 91.1L130.0 91.9L110.0 91.9L109.5 91.1L105.7 82.1L105.4 80.9L105.3 80.3L105.1 78.7L105.0 77.4L104.8 74.1L103.9 56.9Z","M128.1 59.9L134.4 59.9L134.7 60.1L134.8 60.2L134.9 60.3L135.0 60.4L135.1 60.7L135.1 79.4L135.0 79.6L134.9 79.7L134.8 79.8L134.7 79.9L134.5 80.0L134.2 80.1L133.8 80.2L128.1 80.2Z","M104.0 53.2L104.2 51.8L104.3 51.4L104.4 51.0L104.9 49.3L105.1 48.7L105.3 48.1L105.7 47.1L105.8 47.0L106.9 46.6L108.0 46.3L108.4 46.2L131.7 46.2L133.1 46.6L134.2 47.0L134.3 47.1L134.4 47.3L134.6 47.8L135.1 49.4L135.6 51.1L135.8 51.8L136.0 53.2L136.0 56.3L135.1 71.5L134.7 78.2L134.5 79.1L134.2 79.9L133.8 80.9L130.2 89.0L129.8 89.7L123.5 89.9L116.5 89.9L110.2 89.7L109.8 89.0L105.9 80.3L105.6 79.4L105.4 78.5L105.2 77.0L104.1 58.5L104.0 56.3Z",],},{name: "left_elbow_link",parent: "left_shoulder_yaw_link",pivot: [142.8, 82.5],paths: ["M137.9 85.9L138.0 84.9L138.2 83.8L138.7 82.8L139.3 82.0L140.2 81.3L142.2 80.1L146.3 77.9L146.8 77.9L147.2 78.5L147.6 79.4L147.9 80.4L148.0 80.8L148.2 81.9L148.2 86.7L147.9 88.2L147.8 88.5L147.6 88.9L147.3 89.3L146.7 90.0L146.3 90.3L145.6 90.7L143.9 91.3L142.3 91.3L142.1 91.2L140.5 90.4L139.5 89.6L139.1 89.2L139.0 89.1L138.7 88.6L138.2 87.6L138.0 86.6Z",],},{name: "right_elbow_link",parent: "right_shoulder_yaw_link",pivot: [97.2, 82.5],paths: ["M91.8 81.9L92.0 80.8L92.1 80.4L92.4 79.4L92.8 78.5L93.2 77.9L93.7 77.9L97.8 80.1L99.8 81.3L100.7 82.0L101.3 82.8L101.8 83.8L102.0 84.9L102.1 85.9L102.0 86.6L101.9 87.1L101.8 87.6L101.5 88.2L101.3 88.6L101.0 89.1L100.9 89.2L100.7 89.4L100.5 89.6L99.5 90.4L97.9 91.2L97.7 91.3L96.1 91.3L94.4 90.7L93.7 90.3L93.3 90.0L92.7 89.3L92.4 88.9L92.2 88.5L92.1 88.2L91.8 86.7Z",],},{name: "right_shoulder_pitch_link",parent: "torso_link",pivot: [104.4, 53.5],paths: ["M92.5 53.3L92.6 52.6L92.7 52.2L93.0 51.2L93.6 50.2L94.0 49.6L94.2 49.4L94.9 48.8L95.2 48.6L95.6 48.4L96.2 48.1L96.9 47.9L98.1 47.7L99.0 47.6L100.0 47.5L103.2 47.2L105.2 47.1L105.4 47.1L105.7 49.3L105.4 50.9L104.2 55.2L103.7 56.7L103.3 57.8L100.9 59.4L100.3 59.7L99.5 60.0L98.9 60.1L97.4 60.1L96.5 59.9L95.9 59.7L95.7 59.6L95.1 59.2L94.5 58.8L94.2 58.5L93.8 58.0L93.5 57.6L93.3 57.2L93.2 57.0L92.9 56.3L92.7 55.8L92.5 54.8Z",],},{name: "left_shoulder_pitch_link",parent: "torso_link",pivot: [135.6, 53.5],paths: ["M134.3 49.3L134.6 47.1L134.8 47.1L136.8 47.2L140.0 47.5L141.0 47.6L142.6 47.8L143.1 47.9L143.8 48.1L144.8 48.6L145.1 48.8L146.0 49.6L146.7 50.6L147.0 51.2L147.3 52.2L147.4 52.6L147.5 53.3L147.5 54.8L147.3 55.8L146.9 56.8L146.7 57.3L146.5 57.6L146.2 58.0L145.5 58.8L145.4 58.9L144.3 59.6L143.5 59.9L142.6 60.1L141.1 60.1L140.5 60.0L139.7 59.7L139.1 59.4L136.7 57.8L136.3 56.7L135.8 55.2L134.6 50.9Z",],},{name: "left_shoulder_roll_link",parent: "left_shoulder_pitch_link",pivot: [141.8, 54.0],paths: ["M136.7 52.6L136.9 51.6L137.1 51.0L137.4 50.4L138.1 49.5L139.0 48.8L139.3 48.6L139.9 48.3L140.6 48.1L141.1 48.0L141.9 47.9L142.9 48.0L143.8 48.3L144.5 48.6L145.4 49.2L146.2 50.0L146.5 50.4L146.6 50.6L147.2 51.9L147.4 52.6L147.6 53.5L147.7 54.1L148.0 57.8L148.0 64.5L146.5 69.7L146.4 69.9L146.0 70.1L145.4 70.2L144.7 70.3L143.8 70.4L141.8 70.4L140.9 70.3L140.2 70.2L139.6 70.1L139.2 69.9L139.1 69.7L137.7 64.4L136.7 55.2Z",],},{name: "right_shoulder_roll_link",parent: "right_shoulder_pitch_link",pivot: [98.2, 54.0],paths: ["M92.0 57.8L92.3 54.1L92.4 53.5L92.7 52.1L93.4 50.6L93.5 50.4L93.8 50.0L94.6 49.2L95.5 48.6L96.2 48.3L97.1 48.0L98.1 47.9L98.9 48.0L99.4 48.1L100.1 48.3L100.7 48.6L101.0 48.8L101.9 49.5L102.6 50.4L102.9 51.0L103.1 51.6L103.3 52.6L103.3 55.2L102.3 64.4L100.9 69.7L100.8 69.9L100.4 70.1L99.8 70.2L99.1 70.3L98.2 70.4L96.2 70.4L95.3 70.3L94.6 70.2L94.0 70.1L93.6 69.9L93.5 69.7L92.0 64.5Z",],},{name: "left_hip_yaw_link",parent: "left_hip_roll_link",pivot: [138.1, 137.8],paths: ["M131.3 137.9L144.8 137.9L144.8 138.5L144.6 139.9L131.5 139.9L131.3 138.5Z","M131.5 139.9L134.1 137.8L142.0 137.8L144.6 139.9L143.6 162.6L143.5 163.6L143.4 164.3L143.2 165.4L143.1 165.8L142.9 166.6L140.7 172.9L140.6 173.0L135.4 173.0L133.0 166.2L132.9 165.7L132.7 164.3L132.6 163.3L132.5 161.9L131.5 140.3Z","M131.0 161.5L131.1 159.7L132.5 158.5L133.3 158.5L140.7 159.2L140.8 161.4L140.8 169.4L140.7 171.6L133.3 172.2L132.5 172.2L131.1 171.0L131.0 170.0Z",],},{name: "right_hip_yaw_link",parent: "right_hip_roll_link",pivot: [101.9, 137.8],paths: ["M95.2 137.9L108.7 137.9L108.7 138.5L108.5 139.9L95.4 139.9L95.2 138.5Z","M95.4 139.9L98.0 137.8L105.8 137.8L108.5 139.9L108.5 140.3L107.5 161.9L107.4 163.3L107.2 165.0L107.1 165.7L107.0 166.2L104.6 173.0L99.4 173.0L99.3 172.9L97.1 166.6L96.9 166.0L96.7 165.1L96.5 163.6L96.4 162.6Z","M99.2 161.4L99.3 159.2L106.7 158.5L107.5 158.5L108.9 159.7L109.0 162.3L109.0 170.0L108.9 171.0L107.5 172.2L106.7 172.2L99.3 171.6L99.2 169.4Z",],},{name: "right_shoulder_yaw_link",parent: "right_shoulder_roll_link",pivot: [97.2, 69.7],paths: ["M101.3 77.5L101.8 77.5L103.6 78.0L103.6 84.7L103.1 86.5L102.6 87.0L101.8 87.4L101.3 87.4Z","M92.0 65.2L92.3 64.7L92.4 64.6L92.6 64.5L93.0 64.4L93.5 64.3L94.1 64.2L94.8 64.1L98.6 64.1L100.1 64.2L100.7 64.3L101.2 64.4L101.6 64.6L102.0 64.8L102.2 65.2L102.2 67.0L102.1 69.8L101.3 87.6L93.7 87.6L92.2 70.1L92.1 68.7L92.0 65.3Z",],},{name: "left_shoulder_yaw_link",parent: "left_shoulder_roll_link",pivot: [142.8, 69.7],paths: ["M136.4 78.0L138.2 77.5L138.7 77.5L138.7 87.4L138.2 87.4L137.4 87.0L136.9 86.5L136.4 84.7Z","M137.8 65.2L138.0 64.8L138.4 64.6L138.8 64.4L139.3 64.3L139.9 64.2L141.4 64.1L145.2 64.1L145.9 64.2L146.5 64.3L147.0 64.4L147.4 64.5L147.6 64.6L147.7 64.7L148.0 65.2L148.0 65.3L147.9 68.6L147.8 70.1L146.3 87.6L138.7 87.6L137.9 69.8L137.8 67.0Z",],},{name: "right_hip_roll_link",parent: "right_hip_pitch_link",pivot: [101.9, 118.5],paths: ["M94.3 123.0L94.4 120.3L94.7 118.2L95.0 117.1L95.3 116.2L95.6 115.4L95.9 114.7L96.4 113.9L96.8 113.4L97.6 112.7L98.4 112.1L99.0 111.8L100.0 111.5L101.9 111.3L102.6 111.3L103.3 111.4L104.6 111.7L104.9 111.8L105.7 112.3L106.8 113.1L107.2 113.6L107.8 114.5L108.3 115.4L108.7 116.5L108.9 117.1L109.3 119.3L109.4 120.3L109.5 121.3L109.5 128.1L109.0 137.7L108.9 137.8L95.0 137.8L94.9 137.7L94.5 130.8L94.4 128.6L94.3 126.2Z",],},{name: "left_hip_roll_link",parent: "left_hip_pitch_link",pivot: [138.1, 118.5],paths: ["M130.5 121.3L130.7 119.3L131.1 117.1L131.7 115.4L132.2 114.5L132.8 113.6L133.2 113.1L134.3 112.3L135.1 111.8L135.4 111.7L136.7 111.4L137.4 111.3L138.1 111.3L140.0 111.5L141.0 111.8L141.6 112.1L142.4 112.7L143.2 113.4L143.6 113.9L144.1 114.7L144.4 115.4L144.7 116.2L145.0 117.1L145.3 118.2L145.6 120.3L145.7 123.0L145.7 126.2L145.6 128.6L145.1 137.7L145.0 137.8L131.1 137.8L131.0 137.7L130.5 128.1Z",],},{name: "pelvis",parent: null,pivot: null,paths: ["M109.5 106.0L109.6 105.1L109.7 104.2L109.8 103.4L109.9 103.0L110.0 102.9L110.7 102.4L129.3 102.4L130.0 102.9L130.1 103.0L130.2 103.4L130.3 104.2L130.4 105.1L130.5 106.0L130.5 107.6L130.4 108.4L124.7 120.3L124.6 120.5L124.3 121.0L124.2 121.1L124.0 121.2L123.6 121.3L122.9 121.4L121.3 121.6L118.7 121.6L117.1 121.4L116.4 121.3L116.0 121.2L115.8 121.1L115.7 121.0L115.4 120.5L115.3 120.3L115.2 120.1L109.6 108.4L109.5 107.6Z","M110.0 107.7L110.1 107.2L110.4 106.1L112.5 98.6L112.6 98.4L113.5 97.5L114.3 97.2L114.7 97.1L115.6 96.9L117.4 96.7L119.3 96.6L120.7 96.6L122.6 96.7L124.4 96.9L125.3 97.1L125.7 97.2L126.2 97.4L126.5 97.6L127.4 98.4L127.5 98.6L129.6 106.1L129.9 107.2L130.0 107.7L130.0 120.1L129.9 120.4L129.8 120.6L129.6 120.7L129.3 120.8L110.7 120.8L110.4 120.7L110.2 120.6L110.1 120.4L110.0 120.1Z","M109.5 105.6L109.6 104.6L109.7 103.8L109.9 102.6L110.1 102.2L110.3 102.0L110.4 101.9L111.0 101.5L111.2 101.4L111.7 101.3L113.0 101.2L127.0 101.2L128.3 101.3L128.8 101.4L129.0 101.5L129.6 101.9L129.8 102.1L129.9 102.2L130.0 102.4L130.1 102.7L130.3 103.8L130.4 104.6L130.5 105.6L130.5 106.3L130.4 106.8L124.2 120.8L124.1 121.0L123.7 121.1L123.2 121.2L122.4 121.3L121.5 121.4L118.5 121.4L117.6 121.3L116.8 121.2L116.3 121.1L115.9 121.0L115.8 120.8L109.6 106.8L109.5 106.3Z",],},{name: "waist_yaw_link",parent: "pelvis",pivot: [120.0, 98.2],paths: ["M113.6 94.7L113.8 94.4L114.3 93.8L114.7 93.5L119.1 90.4L119.5 90.2L120.0 90.1L120.5 90.2L120.9 90.4L125.7 93.8L126.4 94.7L126.4 95.8L126.0 96.3L114.0 96.3L113.6 95.8Z","M113.4 95.7L114.0 95.3L115.2 95.0L116.0 94.9L116.9 94.8L117.9 94.7L119.7 94.6L120.5 94.6L122.1 94.7L123.1 94.8L124.0 94.9L124.8 95.0L126.0 95.3L126.6 95.7L126.6 97.7L126.5 97.9L126.2 98.1L125.1 98.4L124.4 98.5L121.9 98.8L120.3 98.9L119.5 98.9L117.9 98.8L115.6 98.5L114.9 98.4L113.8 98.1L113.5 97.9L113.4 97.7Z","M117.8 93.1L118.4 90.9L118.5 90.6L118.6 90.3L118.7 90.0L119.1 89.6L119.7 89.4L120.3 89.4L120.9 89.6L121.3 90.0L121.4 90.3L121.5 90.6L121.6 90.9L122.2 93.1L122.2 94.2L122.1 94.3L117.9 94.3L117.8 94.2Z",],},{name: "waist_roll_link",parent: "waist_yaw_link",pivot: [120.0, 91.3],paths: ["M118.4 90.1L118.8 89.7L119.0 89.6L119.4 89.4L119.7 89.3L120.4 89.3L120.7 89.4L120.9 89.5L121.3 89.8L121.6 90.1L121.6 92.5L121.5 92.7L121.1 93.0L120.8 93.2L120.2 93.4L119.9 93.4L119.4 93.3L119.2 93.2L119.0 93.1L118.6 92.8L118.4 92.5Z",],},{name: "left_hip_pitch_link",parent: "pelvis",pivot: [130.0, 113.9],paths: ["M130.0 109.1L130.9 108.7L135.5 109.7L136.4 109.9L138.1 110.3L138.8 110.5L139.5 110.8L140.6 111.3L141.5 111.8L142.6 112.5L142.8 112.7L143.3 113.2L143.5 113.4L143.8 113.8L144.1 114.3L144.5 115.1L145.0 116.5L145.2 117.3L145.3 117.9L145.4 119.2L145.4 119.4L145.3 120.5L145.2 120.9L144.9 121.8L144.7 122.3L144.3 123.0L144.0 123.5L143.6 124.0L143.5 124.1L142.7 124.8L141.7 125.4L141.0 125.7L140.4 125.9L138.9 126.1L138.1 126.2L137.1 126.2L135.9 126.0L134.9 125.7L134.3 125.4L133.4 124.9L132.7 124.4L131.9 123.7L131.4 123.1L130.8 122.3L130.0 119.7Z",],},{name: "right_hip_pitch_link",parent: "pelvis",pivot: [110.0, 113.9],paths: ["M94.6 119.2L94.7 117.9L94.8 117.3L95.2 115.8L95.8 114.5L95.9 114.3L96.2 113.8L96.7 113.2L97.2 112.7L97.7 112.3L99.3 111.3L101.2 110.5L101.9 110.3L103.6 109.9L104.5 109.7L109.1 108.7L110.0 109.1L110.0 119.7L109.2 122.3L108.6 123.1L108.4 123.3L107.3 124.4L106.9 124.7L106.6 124.9L106.3 125.1L105.5 125.5L105.0 125.7L104.4 125.9L104.1 126.0L103.7 126.1L103.0 126.2L101.9 126.2L101.1 126.1L99.6 125.9L99.0 125.7L98.3 125.4L97.3 124.8L96.5 124.1L96.4 124.0L96.0 123.5L95.6 122.9L95.3 122.3L95.1 121.8L94.8 120.9L94.7 120.5L94.6 119.4Z",],},{name: "right_knee_link",parent: "right_hip_yaw_link",pivot: [101.6, 165.4],paths: ["M96.1 179.6L96.2 172.7L96.3 172.4L99.0 165.4L99.1 165.2L99.2 165.0L99.5 164.7L99.8 164.5L101.6 164.4L102.2 164.4L103.3 164.5L103.5 164.6L103.8 164.8L104.0 165.1L104.2 165.6L106.9 172.5L107.0 174.9L107.0 185.2L106.9 187.3L106.8 188.4L106.7 188.8L106.5 189.4L104.2 195.4L103.9 196.0L103.7 196.2L103.3 196.4L101.8 196.5L100.9 196.5L100.0 196.4L99.5 196.2L99.3 196.0L99.2 195.9L99.0 195.5L96.6 189.3L96.5 189.0L96.3 187.8L96.1 182.7Z","M97.8 189.2L98.0 188.5L98.3 188.1L98.8 187.8L99.3 187.7L99.9 187.8L100.3 188.1L100.6 188.5L100.8 189.0L100.8 189.2L99.8 213.1L99.7 214.2L98.8 214.2Z","M102.4 189.0L102.6 188.5L102.9 188.1L103.4 187.8L103.9 187.7L104.4 187.8L104.9 188.1L105.2 188.5L105.4 189.0L104.3 214.2L103.4 214.2L103.3 214.1L102.4 189.2Z","M96.0 176.1L96.2 160.5L96.3 159.9L96.6 159.5L97.1 159.3L97.7 159.2L98.9 159.2L99.1 159.3L107.1 172.6L107.1 184.9L107.0 186.7L106.8 189.2L104.6 212.7L104.5 213.0L104.4 213.1L104.3 213.2L99.0 213.2L98.7 213.1L98.6 212.9L98.5 212.2L96.2 187.2L96.1 186.0L96.0 183.4Z",],},{name: "left_knee_link",parent: "left_hip_yaw_link",pivot: [138.4, 165.4],paths: ["M133.0 174.9L133.1 172.5L135.8 165.6L136.0 165.1L136.2 164.8L136.5 164.6L136.7 164.5L137.8 164.4L138.4 164.4L140.2 164.5L140.5 164.7L140.8 165.0L140.9 165.2L141.0 165.4L143.7 172.4L143.8 172.7L143.9 179.8L143.9 182.7L143.7 187.8L143.5 189.0L143.4 189.3L141.0 195.5L140.8 195.9L140.5 196.2L140.0 196.4L139.1 196.5L138.2 196.5L136.7 196.4L136.3 196.2L136.1 196.0L136.0 195.8L135.8 195.4L133.5 189.4L133.3 188.8L133.2 188.4L133.1 187.6L133.0 185.2Z","M139.2 189.0L139.4 188.5L139.7 188.1L140.1 187.8L140.7 187.7L141.2 187.8L141.7 188.1L142.0 188.5L142.2 189.2L141.2 214.2L140.3 214.2L140.2 213.1L139.2 189.2Z","M134.6 189.0L134.8 188.5L135.1 188.1L135.6 187.8L136.1 187.7L136.6 187.8L137.1 188.1L137.4 188.5L137.6 189.0L137.6 189.2L136.7 214.0L136.6 214.2L135.7 214.2Z","M132.9 172.6L140.9 159.3L141.1 159.2L142.3 159.2L142.9 159.3L143.4 159.5L143.7 159.9L143.8 160.5L144.0 176.1L144.0 183.4L143.9 186.0L143.8 187.2L141.5 212.2L141.4 212.9L141.3 213.1L141.0 213.2L135.7 213.2L135.5 213.0L135.4 212.7L133.2 189.2L133.0 186.8L132.9 185.0Z",],},{name: "left_ankle_roll_link",parent: "left_ankle_pitch_link",pivot: [138.4, 214.0],paths: ["M132.7 219.4L132.8 218.8L132.9 218.4L133.9 214.8L134.1 214.6L134.3 214.5L134.6 214.4L135.0 214.3L135.7 214.2L136.6 214.1L138.4 214.0L140.6 214.1L141.3 214.2L142.3 214.4L142.7 214.6L142.8 214.7L142.9 214.8L144.0 218.7L144.2 219.5L144.2 220.4L144.0 221.0L143.8 221.2L143.4 221.5L142.9 221.7L141.8 222.0L139.5 222.2L137.4 222.2L136.2 222.1L135.1 222.0L133.9 221.7L133.7 221.6L133.5 221.5L133.2 221.3L132.8 221.0L132.7 220.7Z","M132.5 221.2L132.6 219.7L132.7 219.5L133.9 217.2L134.1 217.1L134.3 217.0L134.7 216.9L135.1 216.8L135.8 216.7L136.6 216.6L140.0 216.6L141.1 216.7L141.9 216.8L142.8 217.1L142.9 217.2L143.1 217.4L144.2 219.6L144.3 220.4L144.3 221.4L144.2 221.7L144.1 221.9L143.9 222.2L143.8 222.3L143.4 222.6L142.5 222.9L142.0 223.0L141.4 223.1L140.2 223.2L136.6 223.2L135.5 223.1L134.8 223.0L134.3 222.9L133.5 222.6L133.3 222.5L133.2 222.4L132.7 221.9L132.6 221.6Z","M133.5 216.6L134.2 213.1L134.4 212.3L134.5 212.1L135.0 211.4L135.2 211.2L136.1 210.3L136.3 210.2L136.6 210.1L136.9 210.0L137.5 209.9L139.4 209.9L139.9 210.0L140.5 210.2L140.9 210.4L141.8 211.4L142.1 211.8L142.3 212.1L142.5 212.5L142.6 212.9L143.4 216.7L143.2 217.3L142.5 218.6L142.2 218.8L141.5 219.0L139.7 219.3L137.5 219.3L136.5 219.2L135.7 219.1L135.0 218.9L134.8 218.8L134.4 218.6L134.1 218.2L133.7 217.4L133.5 216.9Z",],},{name: "right_ankle_roll_link",parent: "right_ankle_pitch_link",pivot: [101.6, 214.0],paths: ["M95.8 219.5L96.0 218.7L97.1 214.8L97.2 214.7L97.3 214.6L97.7 214.4L98.7 214.2L99.4 214.1L101.6 214.0L103.5 214.1L104.3 214.2L105.0 214.3L105.4 214.4L105.7 214.5L105.9 214.6L106.1 214.8L107.2 218.8L107.3 219.4L107.3 220.7L107.2 220.9L106.8 221.3L106.5 221.5L106.1 221.7L104.9 222.0L103.8 222.1L102.6 222.2L100.5 222.2L98.2 222.0L97.1 221.7L96.6 221.5L96.2 221.2L96.1 221.1L96.0 221.0L95.8 220.4Z","M95.7 220.4L95.8 219.6L96.9 217.4L97.1 217.2L97.2 217.1L98.1 216.8L98.9 216.7L100.0 216.6L103.4 216.6L104.2 216.7L104.9 216.8L105.7 217.0L105.9 217.1L106.1 217.2L107.3 219.5L107.4 219.7L107.5 221.2L107.4 221.6L107.3 221.9L106.9 222.3L106.7 222.5L106.5 222.6L105.7 222.9L105.2 223.0L104.5 223.1L103.4 223.2L99.8 223.2L98.6 223.1L98.0 223.0L97.5 222.9L96.6 222.6L96.2 222.3L95.9 222.0L95.8 221.7L95.7 221.4Z","M96.6 216.7L97.4 212.9L97.5 212.5L97.7 212.1L97.9 211.8L98.2 211.4L99.1 210.4L99.5 210.2L100.1 210.0L100.6 209.9L102.5 209.9L103.1 210.0L103.4 210.1L103.7 210.2L103.9 210.3L104.8 211.2L105.0 211.4L105.5 212.1L105.6 212.3L105.7 212.6L105.9 213.6L106.5 216.6L106.5 216.9L106.3 217.4L105.9 218.2L105.6 218.6L105.2 218.8L105.0 218.9L104.3 219.1L103.5 219.2L102.5 219.3L100.3 219.3L98.5 219.0L97.8 218.8L97.5 218.6L96.8 217.3Z",],},{name: "left_ankle_pitch_link",parent: "left_knee_link",pivot: [138.4, 211.3],paths: ["M137.4 212.3L137.5 210.0L137.8 209.3L139.0 209.3L139.4 210.0L139.4 215.1L137.4 215.1Z",],},{name: "right_ankle_pitch_link",parent: "right_knee_link",pivot: [101.6, 211.3],paths: ["M100.6 210.0L101.0 209.3L102.2 209.3L102.5 210.0L102.6 212.3L102.6 215.1L100.6 215.1Z",],},];
2 unmodified lines345678910111213145 unmodified lines20212223242574 unmodified lines1001011021031041052 unmodified linesimport { useId, type CSSProperties, type ReactNode } from "react";import "./robot-loader.css";import {OPENARM_LINKS,SO101_LINKS,type LoaderLink,} from "@/components/robot-loader-shapes";export type LoaderRobot = "so101" | "openarm";interface Motion {from: string;5 unmodified linesconst LINKS: Record<LoaderRobot, LoaderLink[]> = {so101: SO101_LINKS,openarm: OPENARM_LINKS,};/// The joints that turn (or slide) within the drawing's plane, so they can move about their pivots.74 unmodified linesdelay: -0.7,},},};/** A wireframe illustration of the robot, drawing itself in and moving its joints, while its 3D model loads. */2 unmodified lines34567891011121314155 unmodified lines2122232425262774 unmodified lines1021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501512 unmodified linesimport { useId, type CSSProperties, type ReactNode } from "react";import "./robot-loader.css";import {G1_LINKS,OPENARM_LINKS,SO101_LINKS,type LoaderLink,} from "@/components/robot-loader-shapes";export type LoaderRobot = "so101" | "openarm" | "g1";interface Motion {from: string;5 unmodified linesconst LINKS: Record<LoaderRobot, LoaderLink[]> = {so101: SO101_LINKS,openarm: OPENARM_LINKS,g1: G1_LINKS,};/// The joints that turn (or slide) within the drawing's plane, so they can move about their pivots.74 unmodified linesdelay: -0.7,},},g1: {waist_roll_link: {from: "rotate(-4deg)",to: "rotate(4deg)",duration: 3.2,delay: 0,},left_shoulder_roll_link: {from: "rotate(-4deg)",to: "rotate(-40deg)",duration: 3.2,delay: 0,},right_shoulder_roll_link: {from: "rotate(40deg)",to: "rotate(4deg)",duration: 3.2,delay: 0,},left_hip_roll_link: {from: "rotate(0deg)",to: "rotate(-5deg)",duration: 3.2,delay: 0,},right_hip_roll_link: {from: "rotate(5deg)",to: "rotate(0deg)",duration: 3.2,delay: 0,},left_ankle_roll_link: {from: "rotate(0deg)",to: "rotate(5deg)",duration: 3.2,delay: 0,},right_ankle_roll_link: {from: "rotate(-5deg)",to: "rotate(0deg)",duration: 3.2,delay: 0,},},};/** A wireframe illustration of the robot, drawing itself in and moving its joints, while its 3D model loads. */
18 unmodified lines192021222324259 unmodified lines3536373839404142434445464748495051525354555657585960616263646566676880 unmodified lines149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 unmodified lines36836937037137237337490 unmodified lines46546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253358 unmodified lines592593594595596597598599600601228 unmodified lines830831832833834835836837230 unmodified lines106810691070107110721073107410751076107710781079108010811082108318 unmodified linesimport URDFLoader from "urdf-loader";import type { URDFRobot } from "urdf-loader";import { loadUsd } from "@huggingface/usd-web-viewer";import { STLLoader } from "three/examples/jsm/loaders/STLLoader.js";import { Line2 } from "three/examples/jsm/lines/Line2.js";import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";import { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js";9 unmodified linesconst SERIES_DELIM = CHART_CONFIG.SERIES_NAME_DELIMITER;const DEG2RAD = Math.PI / 180;// Module-level geometry cache — survives component remounts (tab switches,// episode navigations). Avoids re-fetching and re-parsing STL files.const stlGeometryCache = new Map<string, THREE.BufferGeometry>();// In-flight promise cache — prevents duplicate simultaneous fetchesconst stlGeometryLoading = new Map<string, Promise<THREE.BufferGeometry>>();function loadStlGeometry(url: string): Promise<THREE.BufferGeometry> {const cached = stlGeometryCache.get(url);if (cached) return Promise.resolve(cached);let loading = stlGeometryLoading.get(url);if (!loading) {loading = new STLLoader().loadAsync(url).then((geometry) => {stlGeometryCache.set(url, geometry);return geometry;}).finally(() => stlGeometryLoading.delete(url));stlGeometryLoading.set(url, loading);}return loading;}// URDFs + meshes are hosted in the Hub bucket at// https://huggingface.co/buckets/lerobot/robot-urdfs. URDFLoader resolves// relative mesh paths against the URDF's own URL, so the bucket layout// mirrors the upstream directory tree. Note: buckets don't have branches,// so the resolve URL has no "/main" segment.const URDF_BASE_URL =process.env.NEXT_PUBLIC_URDF_BASE_URL ??"https://huggingface.co/buckets/lerobot/robot-urdfs/resolve";80 unmodified linesconst { urdfUrl, usdUrl } = getRobotConfig(robotType);if (prefetchedUrdfs.has(urdfUrl)) return;prefetchedUrdfs.add(urdfUrl);if (usdUrl) {Promise.all([loadUrdfText(urdfUrl), loadUsdBlob(usdUrl)]).catch(() =>prefetchedUrdfs.delete(urdfUrl),);return;}const base = THREE.LoaderUtils.extractUrlBase(urdfUrl);loadUrdfText(urdfUrl).then((text) => {const doc = new DOMParser().parseFromString(text, "application/xml");for (const mesh of doc.querySelectorAll("visual mesh")) {const filename = mesh.getAttribute("filename");/// Same resolution URDFLoader applies to relative paths; package:// meshes are left to it.if (!filename || filename.startsWith("package://")) continue;if (filename.toLowerCase().endsWith(".stl"))loadStlGeometry(base + filename).catch(() => {});}}).catch(() => prefetchedUrdfs.delete(urdfUrl));}function getRobotConfig(robotType: string | null): {urdfUrl: string;usdUrl?: string;scale: number;} {const lower = (robotType ?? "").toLowerCase();if (lower.includes("g1") || lower.includes("unitree")) {return { urdfUrl: `${URDF_BASE_URL}/g1/g1_body29_hand14.urdf`, scale: 1 };}if (lower.includes("openarm")) {return {184 unmodified linesscale,}: {urdfUrl: string;usdUrl?: string;jointValues: Record<string, number>;onJointsLoaded: (names: string[]) => void;trailEnabled: boolean;90 unmodified linesconst loader = new URDFLoader(manager);/// itemEnd fires after URDFLoader attaches the URDF or a mesh, so each one paints as it lands.manager.onProgress = () => invalidate();// URDFLoader (node_modules/urdf-loader/src/URDFLoader.js ~line 556) does// `if (obj instanceof THREE.Mesh) obj.material = material;`// on every mesh we hand back — overwriting our PBR material with the// URDF's <material rgba="...">-derived MeshPhongMaterial. Wrapping the// returned mesh in a Group dodges that check so our materials survive.const wrapForUrdf = (obj: THREE.Object3D): THREE.Object3D => {const group = new THREE.Group();group.add(obj);return group;};loader.loadMeshCb = (url, mgr, onLoad) => {/// The USD draws these robots: their URDF only moves it.if (usdUrl) {onLoad(new THREE.Object3D());return;}const makeMaterial = () => {let color = "#9ba1ab";let metalness = 0.1;let roughness = 0.5;if (isG1) {const lower = url.toLowerCase();const isWhitePart =lower.includes("contour") ||lower.includes("roll_link") ||lower.includes("logo") ||lower.includes("rubber") ||lower.includes("constraint") ||lower.includes("support");color = isWhitePart ? "#9ca3af" : "#1f2937";metalness = 0.25;roughness = 0.6;}return new THREE.MeshStandardMaterial({ color, metalness, roughness });};// STL files — apply final PBR materials directly here. We used to do a// post-load archetype rebuild in manager.onLoad, but STLLoader calls// `manager.itemEnd` *before* our Promise resolves — so when the last// STL completes, manager.onLoad fires synchronously, our traverse runs,// and THEN URDFLoader's inner `group.add(obj)` + `obj.material = urdf`// runs in a microtask. Last-batch meshes ended up gold/green because// they were added to the robot after our rebuild passed.//// Fix: pick the archetype color here, wrap the mesh in a Group so// URDFLoader won't override our material (its override only triggers// for direct `THREE.Mesh` instances), and skip the onLoad rebuild./// Tracked on this manager even when the geometry is cached or a prefetch already started/// the download: manager.onLoad (shadows, camera fit) only fires for tracked loads, and/// with every mesh prefetched it would otherwise never fire.mgr.itemStart(url);loadStlGeometry(url).then((geometry) =>onLoad(wrapForUrdf(new THREE.Mesh(geometry, makeMaterial()))),).catch((err) => onLoad(new THREE.Object3D(), err as Error)).finally(() => mgr.itemEnd(url));};// Materials are now set directly in loadMeshCb, so manager.onLoad only// needs to (a) enable shadows, (b) auto-fit the camera. We defer the// whole block one macrotask because STLLoader fires `manager.itemEnd`// before the user callback runs, so if we worked synchronously here the// last batch of meshes wouldn't yet be attached to the robot tree.manager.onLoad = () => {setTimeout(() => {const robot = robotRef.current;58 unmodified linesj.jointType === "prismatic",).map((j) => j.name);if (!usdUrl) {onJointsLoaded(movable);return;}/// Loaded from memory, so the session cache spares a download on every visit to the tab.const name = usdUrl.slice(usdUrl.lastIndexOf("/") + 1);return loadUsdBlob(usdUrl)228 unmodified linesconst { urdfUrl, usdUrl, scale } = robotConfig;const isG1 = urdfUrl.includes("g1");const isOpenArm = urdfUrl.includes("openarm");const loaderRobot: LoaderRobot | null = isG1? null: isOpenArm? "openarm": "so101";230 unmodified lines<div className="flex-1 min-h-0 bg-[var(--surface-0)] rounded-lg overflow-hidden border border-line relative">{(episodeLoading || urdfLoading) && (<div className="absolute inset-0 z-10 flex items-center justify-center bg-[var(--bg)]/80">{urdfLoading && loaderRobot ? (<RobotLoaderrobot={loaderRobot}caption={datasetInfo.robot_type ?? undefined}/>) : (<span className="text-fg text-lg animate-pulse">{urdfLoading? "Loading 3D model…": `Loading episode ${selectedEpisode}…`}</span>)}</div>18 unmodified lines1920212223249 unmodified lines34353637383940414280 unmodified lines123124125126127128129130131132133134135136137138139140141142143144145184 unmodified lines33033133233333433533690 unmodified lines42742842943043143243343443543643758 unmodified lines496497498499500501228 unmodified lines730731732733734735736737230 unmodified lines96896997097197297397497597697797897998098118 unmodified linesimport URDFLoader from "urdf-loader";import type { URDFRobot } from "urdf-loader";import { loadUsd } from "@huggingface/usd-web-viewer";import { Line2 } from "three/examples/jsm/lines/Line2.js";import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";import { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js";9 unmodified linesconst SERIES_DELIM = CHART_CONFIG.SERIES_NAME_DELIMITER;const DEG2RAD = Math.PI / 180;// URDFs are hosted in the Hub bucket at// https://huggingface.co/buckets/lerobot/robot-urdfs. Note: buckets don't have// branches, so the resolve URL has no "/main" segment.const URDF_BASE_URL =process.env.NEXT_PUBLIC_URDF_BASE_URL ??"https://huggingface.co/buckets/lerobot/robot-urdfs/resolve";80 unmodified linesconst { urdfUrl, usdUrl } = getRobotConfig(robotType);if (prefetchedUrdfs.has(urdfUrl)) return;prefetchedUrdfs.add(urdfUrl);Promise.all([loadUrdfText(urdfUrl), loadUsdBlob(usdUrl)]).catch(() =>prefetchedUrdfs.delete(urdfUrl),);}function getRobotConfig(robotType: string | null): {urdfUrl: string;usdUrl: string;scale: number;} {const lower = (robotType ?? "").toLowerCase();if (lower.includes("g1") || lower.includes("unitree")) {return {urdfUrl: `${URDF_BASE_URL}/g1/g1_body29_hand14.urdf`,usdUrl: `${USD_BASE_URL}/g1_body29_hand14/simready_usd/g1_body29_hand14.usd`,scale: 1,};}if (lower.includes("openarm")) {return {184 unmodified linesscale,}: {urdfUrl: string;usdUrl: string;jointValues: Record<string, number>;onJointsLoaded: (names: string[]) => void;trailEnabled: boolean;90 unmodified linesconst loader = new URDFLoader(manager);/// itemEnd fires after URDFLoader attaches the URDF or a mesh, so each one paints as it lands.manager.onProgress = () => invalidate();/// The USD draws the robot: its URDF only moves it.loader.loadMeshCb = (_url, _manager, onLoad) =>onLoad(new THREE.Object3D());// Fires once the URDF and its USD are attached (the URDF's itemEnd comes after both), to// enable shadows and fit the camera.manager.onLoad = () => {setTimeout(() => {const robot = robotRef.current;58 unmodified linesj.jointType === "prismatic",).map((j) => j.name);/// Loaded from memory, so the session cache spares a download on every visit to the tab.const name = usdUrl.slice(usdUrl.lastIndexOf("/") + 1);return loadUsdBlob(usdUrl)228 unmodified linesconst { urdfUrl, usdUrl, scale } = robotConfig;const isG1 = urdfUrl.includes("g1");const isOpenArm = urdfUrl.includes("openarm");const loaderRobot: LoaderRobot = isG1? "g1": isOpenArm? "openarm": "so101";230 unmodified lines<div className="flex-1 min-h-0 bg-[var(--surface-0)] rounded-lg overflow-hidden border border-line relative">{(episodeLoading || urdfLoading) && (<div className="absolute inset-0 z-10 flex items-center justify-center bg-[var(--bg)]/80">{urdfLoading ? (<RobotLoaderrobot={loaderRobot}caption={datasetInfo.robot_type ?? undefined}/>) : (<span className="text-fg text-lg animate-pulse">Loading episode {selectedEpisode}…</span>)}</div>
src/components/robot-loader-shapes.ts+392-2
src/components/robot-loader.tsx+47-1
src/components/urdf-viewer.tsx+22-124