Add Unitree G1 with BrainCo hands (g1_body29_brainco)
Browse filesBuilt with robotusd.from_urdf from unitree_ros g1_29dof_mode_15_brainco_hand.urdf (BSD-3, sha 3ae893d9). The left fingertip joints get the right hand's [0, 0] limits instead of the URDF's [1, 1].
- .gitattributes +1 -0
- README.md +11 -3
- g1_body29_brainco/.metadata/LICENSE.txt +29 -0
- g1_body29_brainco/.metadata/com.nvidia.simready.packaging.bom.json +26 -0
- g1_body29_brainco/.metadata/com.nvidia.simready.root_usds.json +6 -0
- g1_body29_brainco/com.nvidia.simready.packaging.json +19 -0
- g1_body29_brainco/simready_usd/.thumbs/256x256/g1_body29_brainco.usd.png +3 -0
- g1_body29_brainco/simready_usd/.thumbs/256x256/g1_body29_brainco.usd_light.png +3 -0
- g1_body29_brainco/simready_usd/g1_body29_brainco.usd +3 -0
- scripts/build_g1_brainco.py +67 -0
.gitattributes
CHANGED
|
@@ -63,3 +63,4 @@ openarm_bimanual/simready_usd/openarm_bimanual.usd filter=lfs diff=lfs merge=lfs
|
|
| 63 |
g1_body29_hand14/simready_usd/g1_body29_hand14.usd filter=lfs diff=lfs merge=lfs -text
|
| 64 |
g1_body29_dex1/simready_usd/g1_body29_dex1.usd filter=lfs diff=lfs merge=lfs -text
|
| 65 |
g1_body29_inspire/simready_usd/g1_body29_inspire.usd filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 63 |
g1_body29_hand14/simready_usd/g1_body29_hand14.usd filter=lfs diff=lfs merge=lfs -text
|
| 64 |
g1_body29_dex1/simready_usd/g1_body29_dex1.usd filter=lfs diff=lfs merge=lfs -text
|
| 65 |
g1_body29_inspire/simready_usd/g1_body29_inspire.usd filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
g1_body29_brainco/simready_usd/g1_body29_brainco.usd filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -17,11 +17,12 @@ tags:
|
|
| 17 |
- humanoid
|
| 18 |
- dex1
|
| 19 |
- inspire
|
|
|
|
| 20 |
---
|
| 21 |
|
| 22 |
# LeRobot robot USDs
|
| 23 |
|
| 24 |
-
[OpenUSD](https://openusd.org) models of the robots in [LeRobot](https://github.com/huggingface/lerobot) datasets. Their joints and links carry the names of the URDFs in [`lerobot/robot-urdfs`](https://huggingface.co/buckets/lerobot/robot-urdfs), so a dataset's joint values drive them the way they drive the URDF.
|
| 25 |
|
| 26 |
| Robot | Root USD | Size | Geometry | License |
|
| 27 |
|---|---|---|---|---|
|
|
@@ -30,6 +31,7 @@ tags:
|
|
| 30 |
| Unitree G1, 29 DoF with Dex3-1 hands | [`g1_body29_hand14/simready_usd/g1_body29_hand14.usd`](g1_body29_hand14/simready_usd/g1_body29_hand14.usd) | 11 MB | 49 meshes, 629k triangles | BSD-3-Clause |
|
| 31 |
| Unitree G1, 29 DoF with Dex1-1 grippers | [`g1_body29_dex1/simready_usd/g1_body29_dex1.usd`](g1_body29_dex1/simready_usd/g1_body29_dex1.usd) | 9 MB | 38 meshes, 456k triangles | BSD-3-Clause |
|
| 32 |
| Unitree G1, 29 DoF with Inspire hands (five fingers) | [`g1_body29_inspire/simready_usd/g1_body29_inspire.usd`](g1_body29_inspire/simready_usd/g1_body29_inspire.usd) | 12 MB | 59 meshes, 542k triangles | BSD-3-Clause |
|
|
|
|
| 33 |
|
| 34 |
Each is a single layer in meters, Z up, with UsdPhysics joints (limits in degrees) and UsdPreviewSurface materials.
|
| 35 |
|
|
@@ -55,11 +57,15 @@ Each is a single layer in meters, Z up, with UsdPhysics joints (limits in degree
|
|
| 55 |
- Joints: the G1's 29 body joints above; `<S>_index_proximal_joint`, `middle`, `ring` and `pinky` (0 straight to 1.7 rad curled), `<S>_thumb_proximal_yaw_joint` and `<S>_thumb_proximal_pitch_joint`, all revolute. Each finger's `intermediate` joint, and the thumb's `intermediate` and `distal` joints, follow these, as in the URDF (`<mimic>`): here they are PhysX mimic joints (`PhysxMimicJointAPI`).
|
| 56 |
- Links: as the G1 above, without the hands; `<S>_hand_base_link` (mesh, fixed to the wrist) and each finger joint's child, named after it (`<S>_index_proximal`, `<S>_thumb_distal`).
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
## Checked against the URDFs
|
| 59 |
|
| 60 |
- Every link and moving joint of each URDF is here, under the same name, except OpenArm's empty `world` root. Links the URDF fixes to another are plain frames here (tips, OpenArm's `link0`s, the G1's camera and lidar mounts) or, on the G1s, meshes and sites at the link's frame.
|
| 61 |
- Posed at 200 random joint configurations, every link lands within 0.006 mm and 0.002° of the URDF's: same zero pose, axes and directions. The URDFs take radians, these models degrees. OpenArm's finger bodies have their frames 1 mm from the URDF's at every pose, which leaves their motion unchanged.
|
| 62 |
-
- All
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
|
@@ -100,4 +106,6 @@ scene.add(root); // a THREE.Group, Y up
|
|
| 100 |
|
| 101 |
**Unitree G1 with Inspire hands**, built the same way from [`g1_29dof_rev_1_0_with_inspire_hand_DFQ.urdf`](https://github.com/unitreerobotics/unitree_ros/blob/3ae893d905d11795ddf1075825ee5010364a1109/robots/g1_description/g1_29dof_rev_1_0_with_inspire_hand_DFQ.urdf) (Inspire RH56DFQ, without touch sensors) in unitreerobotics/unitree_ros, the hands dark grey: their URDF material is named `dark` but colored white.
|
| 102 |
|
| 103 |
-
[`
|
|
|
|
|
|
|
|
|
| 17 |
- humanoid
|
| 18 |
- dex1
|
| 19 |
- inspire
|
| 20 |
+
- brainco
|
| 21 |
---
|
| 22 |
|
| 23 |
# LeRobot robot USDs
|
| 24 |
|
| 25 |
+
[OpenUSD](https://openusd.org) models of the robots in [LeRobot](https://github.com/huggingface/lerobot) datasets. Their joints and links carry the names of the URDFs in [`lerobot/robot-urdfs`](https://huggingface.co/buckets/lerobot/robot-urdfs) (for the BrainCo G1, those of Unitree's URDF), so a dataset's joint values drive them the way they drive the URDF.
|
| 26 |
|
| 27 |
| Robot | Root USD | Size | Geometry | License |
|
| 28 |
|---|---|---|---|---|
|
|
|
|
| 31 |
| Unitree G1, 29 DoF with Dex3-1 hands | [`g1_body29_hand14/simready_usd/g1_body29_hand14.usd`](g1_body29_hand14/simready_usd/g1_body29_hand14.usd) | 11 MB | 49 meshes, 629k triangles | BSD-3-Clause |
|
| 32 |
| Unitree G1, 29 DoF with Dex1-1 grippers | [`g1_body29_dex1/simready_usd/g1_body29_dex1.usd`](g1_body29_dex1/simready_usd/g1_body29_dex1.usd) | 9 MB | 38 meshes, 456k triangles | BSD-3-Clause |
|
| 33 |
| Unitree G1, 29 DoF with Inspire hands (five fingers) | [`g1_body29_inspire/simready_usd/g1_body29_inspire.usd`](g1_body29_inspire/simready_usd/g1_body29_inspire.usd) | 12 MB | 59 meshes, 542k triangles | BSD-3-Clause |
|
| 34 |
+
| Unitree G1, 29 DoF with BrainCo hands (five fingers) | [`g1_body29_brainco/simready_usd/g1_body29_brainco.usd`](g1_body29_brainco/simready_usd/g1_body29_brainco.usd) | 13 MB | 68 meshes, 627k triangles | BSD-3-Clause |
|
| 35 |
|
| 36 |
Each is a single layer in meters, Z up, with UsdPhysics joints (limits in degrees) and UsdPreviewSurface materials.
|
| 37 |
|
|
|
|
| 57 |
- Joints: the G1's 29 body joints above; `<S>_index_proximal_joint`, `middle`, `ring` and `pinky` (0 straight to 1.7 rad curled), `<S>_thumb_proximal_yaw_joint` and `<S>_thumb_proximal_pitch_joint`, all revolute. Each finger's `intermediate` joint, and the thumb's `intermediate` and `distal` joints, follow these, as in the URDF (`<mimic>`): here they are PhysX mimic joints (`PhysxMimicJointAPI`).
|
| 58 |
- Links: as the G1 above, without the hands; `<S>_hand_base_link` (mesh, fixed to the wrist) and each finger joint's child, named after it (`<S>_index_proximal`, `<S>_thumb_distal`).
|
| 59 |
|
| 60 |
+
**Unitree G1 with BrainCo hands**, as [`g1_29dof_mode_15_brainco_hand.urdf`](https://github.com/unitreerobotics/unitree_ros/blob/3ae893d905d11795ddf1075825ee5010364a1109/robots/g1_with_brainco_hand/g1_29dof_mode_15_brainco_hand.urdf), for each `<side>` (`left`, `right`):
|
| 61 |
+
- Joints: the G1's 29 body joints above; `<side>_thumb_metacarpal_joint` (0 to 1.52 rad, swinging the thumb out to the side), `<side>_thumb_proximal_joint` (0 to 1.05 rad, bending it), `<side>_index_proximal_joint`, `middle`, `ring` and `pinky` (0 straight to 1.47 rad curled), all revolute. The thumb's and each finger's `distal` joint follow its `proximal` joint, as in the URDF (`<mimic>`): here they are PhysX mimic joints (`PhysxMimicJointAPI`). Each fingertip's `tip` joint (`right_thumb_tip` on the right thumb) is locked at 0.
|
| 62 |
+
- Links: as the G1 above, without `pelvis_contour_link` and the hands; `<side>_base_link` and `<side>_base2_link` (meshes, fixed to the wrist) and each hand joint's child, with the URDF's names: `left_index_proximal_Link` on the left hand, `right_index_proximal_link` and the tips `right_index_tip` on the right.
|
| 63 |
+
|
| 64 |
## Checked against the URDFs
|
| 65 |
|
| 66 |
- Every link and moving joint of each URDF is here, under the same name, except OpenArm's empty `world` root. Links the URDF fixes to another are plain frames here (tips, OpenArm's `link0`s, the G1's camera and lidar mounts) or, on the G1s, meshes and sites at the link's frame.
|
| 67 |
- Posed at 200 random joint configurations, every link lands within 0.006 mm and 0.002° of the URDF's: same zero pose, axes and directions. The URDFs take radians, these models degrees. OpenArm's finger bodies have their frames 1 mm from the URDF's at every pose, which leaves their motion unchanged.
|
| 68 |
+
- All six load in [`@huggingface/usd-web-viewer`](https://www.npmjs.com/package/@huggingface/usd-web-viewer) with no warnings.
|
| 69 |
|
| 70 |
## Usage
|
| 71 |
|
|
|
|
| 106 |
|
| 107 |
**Unitree G1 with Inspire hands**, built the same way from [`g1_29dof_rev_1_0_with_inspire_hand_DFQ.urdf`](https://github.com/unitreerobotics/unitree_ros/blob/3ae893d905d11795ddf1075825ee5010364a1109/robots/g1_description/g1_29dof_rev_1_0_with_inspire_hand_DFQ.urdf) (Inspire RH56DFQ, without touch sensors) in unitreerobotics/unitree_ros, the hands dark grey: their URDF material is named `dark` but colored white.
|
| 108 |
|
| 109 |
+
**Unitree G1 with BrainCo hands**, built the same way from [`g1_29dof_mode_15_brainco_hand.urdf`](https://github.com/unitreerobotics/unitree_ros/blob/3ae893d905d11795ddf1075825ee5010364a1109/robots/g1_with_brainco_hand/g1_29dof_mode_15_brainco_hand.urdf) in unitreerobotics/unitree_ros, the hands dark grey instead of the URDF's white. Its left index, middle, ring and pinky `tip` joints are locked at 1 rad (limits `[1, 1]`), which bends each fingertip off its finger: here they have the right hand's limits, `[0, 0]`, as the meshes are drawn.
|
| 110 |
+
|
| 111 |
+
[`scripts/`](scripts) rebuilds all six (needs `usd-core`, `numpy` and, for OpenArm, `fast-simplification`). Each robot is a package in the [SimReady packaging layout](https://github.com/NVIDIA/simready-foundation), with its file list, hashes and license (`.metadata/LICENSE.txt`); none has been through NVIDIA's SimReady validation.
|
g1_body29_brainco/.metadata/LICENSE.txt
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
BSD 3-Clause License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2016-2022 HangZhou YuShu TECHNOLOGY CO.,LTD. ("Unitree Robotics")
|
| 4 |
+
All rights reserved.
|
| 5 |
+
|
| 6 |
+
Redistribution and use in source and binary forms, with or without
|
| 7 |
+
modification, are permitted provided that the following conditions are met:
|
| 8 |
+
|
| 9 |
+
* Redistributions of source code must retain the above copyright notice, this
|
| 10 |
+
list of conditions and the following disclaimer.
|
| 11 |
+
|
| 12 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
| 13 |
+
this list of conditions and the following disclaimer in the documentation
|
| 14 |
+
and/or other materials provided with the distribution.
|
| 15 |
+
|
| 16 |
+
* Neither the name of the copyright holder nor the names of its
|
| 17 |
+
contributors may be used to endorse or promote products derived from
|
| 18 |
+
this software without specific prior written permission.
|
| 19 |
+
|
| 20 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 21 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 22 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 23 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
| 24 |
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 25 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 26 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 27 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 28 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 29 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
g1_body29_brainco/.metadata/com.nvidia.simready.packaging.bom.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format_version": "1.0",
|
| 3 |
+
"items": [
|
| 4 |
+
{
|
| 5 |
+
"relative_path": "simready_usd/.thumbs/256x256/g1_body29_brainco.usd.png",
|
| 6 |
+
"size": 50324,
|
| 7 |
+
"hash": {
|
| 8 |
+
"sha256": "ccb131b757c066b9ee3277b2e13398e7863e6a903960f58a89b3573ef256ef27"
|
| 9 |
+
}
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"relative_path": "simready_usd/.thumbs/256x256/g1_body29_brainco.usd_light.png",
|
| 13 |
+
"size": 50871,
|
| 14 |
+
"hash": {
|
| 15 |
+
"sha256": "faad590d75938bb4967fb29587205078d6e88adcc09c80fbc849f2235ac5d6b8"
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"relative_path": "simready_usd/g1_body29_brainco.usd",
|
| 20 |
+
"size": 12956398,
|
| 21 |
+
"hash": {
|
| 22 |
+
"sha256": "6e6e1988071e5a067e581443469ab4e71d92d6d79aa6f2887725a4350d70e479"
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
]
|
| 26 |
+
}
|
g1_body29_brainco/.metadata/com.nvidia.simready.root_usds.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format_version": "1.0",
|
| 3 |
+
"entries": [
|
| 4 |
+
"simready_usd/g1_body29_brainco.usd"
|
| 5 |
+
]
|
| 6 |
+
}
|
g1_body29_brainco/com.nvidia.simready.packaging.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format_version": "1.0",
|
| 3 |
+
"package_id": "simready.hf.lerobot.robot-usds.g1_body29_brainco.2026.11.03",
|
| 4 |
+
"license": "BSD-3-Clause",
|
| 5 |
+
"metadata": [
|
| 6 |
+
{
|
| 7 |
+
"name": "com.nvidia.simready.packaging.bom.json",
|
| 8 |
+
"hash": {
|
| 9 |
+
"sha256": "0e626a53dff057a88b9b8d033b356e33783e57aaea2c8b3fc050d9116b7ce519"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
],
|
| 13 |
+
"content_hash": {
|
| 14 |
+
"sha256": "1f8b719f8ead7142e109055bafe42610900a9df30a353852cd14c6612180e988"
|
| 15 |
+
},
|
| 16 |
+
"package_hash": {
|
| 17 |
+
"sha256": "ea2afcf6e507d94770a5e77992ebf7e74b486d28747f20441e774ece678e4f12"
|
| 18 |
+
}
|
| 19 |
+
}
|
g1_body29_brainco/simready_usd/.thumbs/256x256/g1_body29_brainco.usd.png
ADDED
|
|
Git LFS Details
|
g1_body29_brainco/simready_usd/.thumbs/256x256/g1_body29_brainco.usd_light.png
ADDED
|
|
Git LFS Details
|
g1_body29_brainco/simready_usd/g1_body29_brainco.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e6e1988071e5a067e581443469ab4e71d92d6d79aa6f2887725a4350d70e479
|
| 3 |
+
size 12956398
|
scripts/build_g1_brainco.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Unitree G1 with BrainCo hands, from unitree_ros' g1_29dof_mode_15_brainco_hand.urdf."""
|
| 2 |
+
|
| 3 |
+
import json
|
| 4 |
+
import os
|
| 5 |
+
import sys
|
| 6 |
+
import xml.etree.ElementTree as ET
|
| 7 |
+
|
| 8 |
+
from pxr import Usd, UsdGeom
|
| 9 |
+
|
| 10 |
+
import robotusd as ru
|
| 11 |
+
|
| 12 |
+
URDF, OUT = sys.argv[1:3]
|
| 13 |
+
|
| 14 |
+
# The left fingertip joints are locked at 1 rad (limits [1, 1]), bending each tip off its finger;
|
| 15 |
+
# the right hand's are locked at 0, as the meshes are drawn. Give the left the right's limits.
|
| 16 |
+
tree = ET.parse(URDF)
|
| 17 |
+
joints = {j.get("name"): j for j in tree.getroot().findall("joint")}
|
| 18 |
+
fixed_tips = {}
|
| 19 |
+
for finger in ("thumb", "index", "middle", "ring", "pinky"):
|
| 20 |
+
left = joints[f"left_{finger}_tip_joint"].find("limit")
|
| 21 |
+
right = joints.get(f"right_{finger}_tip_joint", joints.get(f"right_{finger}_tip")).find("limit")
|
| 22 |
+
limits = {k: right.get(k) for k in ("lower", "upper")}
|
| 23 |
+
if {k: left.get(k) for k in limits} != limits:
|
| 24 |
+
fixed_tips[f"left_{finger}_tip_joint"] = f"[{left.get('lower')}, {left.get('upper')}] -> [{limits['lower']}, {limits['upper']}]"
|
| 25 |
+
left.attrib.update(limits)
|
| 26 |
+
FIXED = os.path.join(os.path.dirname(URDF), "g1_body29_brainco.urdf")
|
| 27 |
+
tree.write(FIXED)
|
| 28 |
+
|
| 29 |
+
# The hands' URDF material is white; the real hands are dark grey, like the G1's.
|
| 30 |
+
DARK = [0.2, 0.2, 0.2]
|
| 31 |
+
links, urdf_joints = ru.urdf_joints(FIXED)
|
| 32 |
+
parent_of = {j["child"]: j["parent"] for j in urdf_joints}
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def in_hand(link):
|
| 36 |
+
while link in parent_of:
|
| 37 |
+
if link in ("left_base_link", "right_base_link"):
|
| 38 |
+
return True
|
| 39 |
+
link = parent_of[link]
|
| 40 |
+
return False
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
stage = ru.from_urdf(FIXED, "g1_body29_brainco", colors={link: DARK for link in links if in_hand(link)})
|
| 44 |
+
root = UsdGeom.ModelAPI(stage.GetDefaultPrim())
|
| 45 |
+
root.SetExtentsHint(root.ComputeExtentsHint(UsdGeom.BBoxCache(Usd.TimeCode.Default(), UsdGeom.Imageable.GetOrderedPurposeTokens())))
|
| 46 |
+
|
| 47 |
+
layer = stage.GetRootLayer()
|
| 48 |
+
layer.documentation = (
|
| 49 |
+
"Unitree G1 (29 DoF body, BrainCo hands) for LeRobot. Built by LeRobot from unitreerobotics/unitree_ros "
|
| 50 |
+
"g1_29dof_mode_15_brainco_hand.urdf (BSD-3-Clause): its visual meshes and joints, the hands colored dark grey "
|
| 51 |
+
"and the left fingertip joints given the right's limits."
|
| 52 |
+
)
|
| 53 |
+
layer.customLayerData = {
|
| 54 |
+
"lerobot:source": "https://github.com/unitreerobotics/unitree_ros/tree/3ae893d905d11795ddf1075825ee5010364a1109/robots/g1_with_brainco_hand",
|
| 55 |
+
}
|
| 56 |
+
layer.Export(OUT)
|
| 57 |
+
|
| 58 |
+
out = Usd.Stage.Open(OUT)
|
| 59 |
+
report = ru.check_against_urdf(out, FIXED)
|
| 60 |
+
drawn = [p for p in out.Traverse() if p.IsA(UsdGeom.Mesh)]
|
| 61 |
+
report["fixed_tip_limits"] = fixed_tips
|
| 62 |
+
report["meshes"] = len(drawn)
|
| 63 |
+
report["triangles"] = int(sum(len(UsdGeom.Mesh(p).GetFaceVertexCountsAttr().Get()) for p in drawn))
|
| 64 |
+
report["frame_offsets_mm_deg"] = {k: v for k, v in report["frame_offsets_mm_deg"].items() if v != (0.0, 0.0)}
|
| 65 |
+
r = UsdGeom.BBoxCache(Usd.TimeCode.Default(), ["default"]).ComputeWorldBound(out.GetDefaultPrim()).ComputeAlignedRange()
|
| 66 |
+
report["min_z"] = round(r.GetMin()[2], 4)
|
| 67 |
+
print(json.dumps(report, indent=1, default=str))
|