Upload folder using huggingface_hub
Browse files- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/__init__.py +0 -0
- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/ability.py +84 -0
- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/allegro.py +49 -0
- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/dex3.py +49 -0
- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/dexrobot.py +49 -0
- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/inspire.py +91 -0
- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/schunk.py +76 -0
- outputs/_runtime_patches/dexmachina/envs/hand_cfgs/xhand.py +49 -0
- outputs/_scripts/scene_demo.py +186 -0
- outputs/aggregated/.gitkeep +0 -0
- outputs/logs/.gitkeep +0 -0
- outputs/logs/dexmachina_scene_demo.json +28 -0
- outputs/logs/dexmachina_scene_demo.log +7 -0
- outputs/logs/spider_lift_board_allegro.log +25 -0
- outputs/logs/spider_record_frames.py +79 -0
- outputs/logs/spider_vnc_check.log +17 -0
- outputs/metrics/.gitkeep +0 -0
- outputs/sweep.log +1 -0
- outputs/videos/.gitkeep +0 -0
- outputs/videos/dexmachina_xhand_demo.mp4 +3 -0
- outputs/videos/spider_allegro_oakink_lift_board_bimanual_data0.mp4 +3 -0
- outputs/videos/vnc_live_frame.png +3 -0
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/__init__.py
ADDED
|
File without changes
|
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/ability.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from os.path import join
|
| 3 |
+
from dexmachina.asset_utils import get_urdf_path
|
| 4 |
+
|
| 5 |
+
ability_asset_dir = "ability_hand/"
|
| 6 |
+
left_rel_urdf = join(ability_asset_dir, "ability_hand_left_6dof.urdf")
|
| 7 |
+
right_rel_urdf = join(ability_asset_dir, "ability_hand_right_6dof.urdf")
|
| 8 |
+
|
| 9 |
+
ABILITY_MIMIC_JOINTS = {
|
| 10 |
+
"index_q2": ("index_q1", 1.05851325),
|
| 11 |
+
"middle_q2": ("middle_q1", 1.05851325),
|
| 12 |
+
"ring_q2": ("ring_q1", 1.05851325),
|
| 13 |
+
"pinky_q2": ("pinky_q1", 1.05851325),
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
ABILITY_ACT_FINGER_JOINTS = ["thumb_q1", "thumb_q2", "index_q1", "middle_q1", "ring_q1", "pinky_q1"]
|
| 17 |
+
|
| 18 |
+
ABILITY_MIMIC=dict(left=dict(), right=dict())
|
| 19 |
+
for name, (target, multiplier) in ABILITY_MIMIC_JOINTS.items():
|
| 20 |
+
for side in ["left", "right"]:
|
| 21 |
+
ABILITY_MIMIC[side][name] = (target, multiplier)
|
| 22 |
+
|
| 23 |
+
ABILITY_LINKS=["thumb_tip", "index_tip", "middle_tip", "ring_tip", "pinky_tip", "thumb_L1", "index_L1", "middle_L1", "ring_L1", "pinky_L1"]
|
| 24 |
+
|
| 25 |
+
ABILITY_LEFT_CFG={
|
| 26 |
+
"urdf_path": get_urdf_path(left_rel_urdf),
|
| 27 |
+
"wrist_link_name": "base",
|
| 28 |
+
"mimic_joint_map": ABILITY_MIMIC['left'].copy(),
|
| 29 |
+
"kpt_link_names": ABILITY_LINKS.copy(),
|
| 30 |
+
"joint_limits": {
|
| 31 |
+
"index_q1": (0.26, 2.0943951),
|
| 32 |
+
"index_q2": (0.26, 2.6586),
|
| 33 |
+
"middle_q1": (0.26, 2.0943951),
|
| 34 |
+
"middle_q2": (0.26, 2.6586),
|
| 35 |
+
"ring_q1": (0.26, 2.0943951),
|
| 36 |
+
"ring_q2": (0.26, 2.6586),
|
| 37 |
+
"pinky_q1": (0.26, 2.0943951),
|
| 38 |
+
"pinky_q2": (0.26, 2.6586),
|
| 39 |
+
},
|
| 40 |
+
"actuators": {
|
| 41 |
+
"finger": dict(
|
| 42 |
+
joint_exprs=['.*q1', '.*q2'],
|
| 43 |
+
kp=40.0,
|
| 44 |
+
kv=3.0,
|
| 45 |
+
force_range=50.0,
|
| 46 |
+
),
|
| 47 |
+
"wrist_rot": dict(
|
| 48 |
+
joint_exprs=[r'[LR]_forearm_(roll|pitch|yaw)_link_joint'],
|
| 49 |
+
kp=80,
|
| 50 |
+
kv=4.5,
|
| 51 |
+
force_range=50.0,
|
| 52 |
+
),
|
| 53 |
+
"wrist_trans": dict(
|
| 54 |
+
joint_exprs=[r'[LR]_forearm_t[xyz]_link_joint'],
|
| 55 |
+
kp=300,
|
| 56 |
+
kv=4.0,
|
| 57 |
+
force_range=100,
|
| 58 |
+
),
|
| 59 |
+
},
|
| 60 |
+
"collision_groups": {7: 0, 8: 0, 14: 1, 15: 2, 16: 3, 17: 4, 18: 5},
|
| 61 |
+
"collision_palm_name": "thumb_base",
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
ABILITY_RIGHT_CFG={
|
| 65 |
+
"urdf_path": get_urdf_path(right_rel_urdf),
|
| 66 |
+
"wrist_link_name": "base",
|
| 67 |
+
"mimic_joint_map": ABILITY_MIMIC['right'].copy(),
|
| 68 |
+
"kpt_link_names": ABILITY_LINKS.copy(),
|
| 69 |
+
"joint_limits": {
|
| 70 |
+
"index_q1": (0.26, 2.0943951),
|
| 71 |
+
"index_q2": (0.26, 2.6586),
|
| 72 |
+
"middle_q1": (0.26, 2.0943951),
|
| 73 |
+
"middle_q2": (0.26, 2.6586),
|
| 74 |
+
"ring_q1": (0.26, 2.0943951),
|
| 75 |
+
"ring_q2": (0.26, 2.6586),
|
| 76 |
+
"pinky_q1": (0.26, 2.0943951),
|
| 77 |
+
"pinky_q2": (0.26, 2.6586),
|
| 78 |
+
},
|
| 79 |
+
"actuators": ABILITY_LEFT_CFG["actuators"].copy(),
|
| 80 |
+
"collision_groups": {7: 0, 8: 0, 14: 1, 15: 2, 16: 3, 17: 4, 18: 5},
|
| 81 |
+
"collision_palm_name": "thumb_base",
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
ABILITY_CFGs=dict(left=ABILITY_LEFT_CFG, right=ABILITY_RIGHT_CFG)
|
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/allegro.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from os.path import join
|
| 3 |
+
from dexmachina.asset_utils import get_urdf_path
|
| 4 |
+
|
| 5 |
+
allegro_asset_dir = "allegro_hand/"
|
| 6 |
+
left_rel_urdf = join(allegro_asset_dir, "allegro_hand_left_6dof.urdf")
|
| 7 |
+
right_rel_urdf = join(allegro_asset_dir, "allegro_hand_right_6dof.urdf")
|
| 8 |
+
|
| 9 |
+
ALLEGRO_LEFT_CFG={
|
| 10 |
+
"urdf_path": get_urdf_path(left_rel_urdf),
|
| 11 |
+
"wrist_link_name": "base_dummy_link",
|
| 12 |
+
"kpt_link_names": ["link_15.0_tip", "link_11.0_tip", "link_7.0_tip", "link_3.0_tip" ],
|
| 13 |
+
"actuators": {
|
| 14 |
+
"finger": dict(
|
| 15 |
+
joint_exprs=['.*.0.+'],
|
| 16 |
+
kp=30.0,
|
| 17 |
+
kv=2.0,
|
| 18 |
+
force_range=100.0,
|
| 19 |
+
),
|
| 20 |
+
"wrist_rot": dict(
|
| 21 |
+
joint_exprs=[r'[LR]_forearm_(roll|pitch|yaw)_link_joint'],
|
| 22 |
+
kp=60,
|
| 23 |
+
kv=5.0,
|
| 24 |
+
force_range=100.0,
|
| 25 |
+
),
|
| 26 |
+
"wrist_trans": dict(
|
| 27 |
+
joint_exprs=[r'[LR]_forearm_t[xyz]_link_joint'],
|
| 28 |
+
kp=350.0,
|
| 29 |
+
kv=20.0,
|
| 30 |
+
force_range=100.0,
|
| 31 |
+
),
|
| 32 |
+
},
|
| 33 |
+
"collision_groups": {8: 0, 13: 1, 14: 2, 15: 3, 16: 4, 17: 1, 18: 2, 19: 3, 20: 4, 21: 1, 22: 2, 23: 3, 24: 4, 25: 1, 26: 2, 27: 3, 28: 4},
|
| 34 |
+
"collision_palm_name": "base_link",
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
ALLEGRO_RIGHT_CFG={
|
| 38 |
+
"urdf_path": get_urdf_path(right_rel_urdf),
|
| 39 |
+
"wrist_link_name": "base_dummy_link",
|
| 40 |
+
"kpt_link_names": ["link_15.0_tip", "link_3.0_tip", "link_7.0_tip", "link_11.0_tip" ],
|
| 41 |
+
"actuators": ALLEGRO_LEFT_CFG["actuators"].copy(),
|
| 42 |
+
"collision_groups": {8: 0, 13: 1, 14: 2, 15: 3, 16: 4, 17: 1, 18: 2, 19: 3, 20: 4, 21: 1, 22: 2, 23: 3, 24: 4, 25: 1, 26: 2, 27: 3, 28: 4},
|
| 43 |
+
"collision_palm_name": "base_link",
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
ALLEGRO_CFGs=dict(
|
| 47 |
+
left=ALLEGRO_LEFT_CFG,
|
| 48 |
+
right=ALLEGRO_RIGHT_CFG,
|
| 49 |
+
)
|
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/dex3.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from os.path import join
|
| 3 |
+
from dexmachina.asset_utils import get_urdf_path
|
| 4 |
+
|
| 5 |
+
dex3_asset_dir = "dex3_hand/"
|
| 6 |
+
left_rel_urdf = join(dex3_asset_dir, "dex3_left_6dof.urdf")
|
| 7 |
+
right_rel_urdf = join(dex3_asset_dir, "dex3_right_6dof.urdf")
|
| 8 |
+
|
| 9 |
+
DEX3_LEFT_CFG={
|
| 10 |
+
"urdf_path": get_urdf_path(left_rel_urdf),
|
| 11 |
+
"wrist_link_name": "left_hand_palm_link",
|
| 12 |
+
"kpt_link_names": ['left_hand_palm_link', 'left_hand_thumb_0_link', 'left_hand_middle_0_link', 'left_hand_index_0_link', 'left_hand_thumb_1_link', 'left_hand_middle_1_link', 'left_hand_index_1_link', 'left_hand_thumb_2_link'],
|
| 13 |
+
"actuators": {
|
| 14 |
+
"finger": dict(
|
| 15 |
+
joint_exprs=[".*0_joint", ".*1_joint", ".*2_joint"],
|
| 16 |
+
kp=100.0,
|
| 17 |
+
kv=6,
|
| 18 |
+
force_range=50.0,
|
| 19 |
+
),
|
| 20 |
+
"wrist_rot": dict(
|
| 21 |
+
joint_exprs=[r'[LR]_forearm_(roll|pitch|yaw)_link_joint'],
|
| 22 |
+
kp=200,
|
| 23 |
+
kv=10,
|
| 24 |
+
force_range=50.0,
|
| 25 |
+
),
|
| 26 |
+
"wrist_trans": dict(
|
| 27 |
+
joint_exprs=[r'[LR]_forearm_t[xyz]_link_joint'],
|
| 28 |
+
kp=300,
|
| 29 |
+
kv=5.0,
|
| 30 |
+
force_range=50.0,
|
| 31 |
+
),
|
| 32 |
+
},
|
| 33 |
+
"collision_groups": {7: 0, 11: 1, 12: 2, 13: 3, 14: 1},
|
| 34 |
+
"collision_palm_name": "left_hand_palm_link",
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
DEX3_RIGHT_CFG={
|
| 38 |
+
"urdf_path": get_urdf_path(right_rel_urdf),
|
| 39 |
+
"wrist_link_name": "right_hand_palm_link",
|
| 40 |
+
"kpt_link_names": ['right_hand_palm_link', 'right_hand_thumb_0_link', 'right_hand_middle_0_link', 'right_hand_index_0_link', 'right_hand_thumb_1_link', 'right_hand_middle_1_link', 'right_hand_index_1_link', 'right_hand_thumb_2_link'],
|
| 41 |
+
"collision_groups": {7: 0, 11: 1, 12: 2, 13: 3, 14: 1},
|
| 42 |
+
"collision_palm_name": "right_hand_palm_link",
|
| 43 |
+
"actuators": DEX3_LEFT_CFG["actuators"].copy(),
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
DEX3_CFGs=dict(
|
| 47 |
+
left=DEX3_LEFT_CFG,
|
| 48 |
+
right=DEX3_RIGHT_CFG,
|
| 49 |
+
)
|
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/dexrobot.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from os.path import join
|
| 3 |
+
from dexmachina.asset_utils import get_urdf_path
|
| 4 |
+
|
| 5 |
+
dex_asset_dir = "dexrobot_hand/"
|
| 6 |
+
left_rel_urdf = join(dex_asset_dir, "dexhand021_left_6dof.urdf")
|
| 7 |
+
right_rel_urdf = join(dex_asset_dir, "dexhand021_right_6dof.urdf")
|
| 8 |
+
|
| 9 |
+
DEX_LEFT_CFG={
|
| 10 |
+
"urdf_path": get_urdf_path(left_rel_urdf),
|
| 11 |
+
"wrist_link_name": "base_dummy",
|
| 12 |
+
"kpt_link_names": ["l_f_link1_tip", "l_f_link2_tip", "l_f_link3_tip", "l_f_link4_tip", "l_f_link5_tip"], # should be overwritten with retargeting
|
| 13 |
+
"actuators": {
|
| 14 |
+
"finger": dict(
|
| 15 |
+
joint_exprs=['[lr]_f.*'],
|
| 16 |
+
kp=50.0,
|
| 17 |
+
kv=3,
|
| 18 |
+
force_range=100.0,
|
| 19 |
+
),
|
| 20 |
+
"wrist_rot": dict(
|
| 21 |
+
joint_exprs=[r'[LR]_forearm_(roll|pitch|yaw)_link_joint'],
|
| 22 |
+
kp=70,
|
| 23 |
+
kv=4,
|
| 24 |
+
force_range=100.0,
|
| 25 |
+
),
|
| 26 |
+
"wrist_trans": dict(
|
| 27 |
+
joint_exprs=[r'[LR]_forearm_t[xyz]_link_joint'],
|
| 28 |
+
kp=300.0,
|
| 29 |
+
kv=15.0,
|
| 30 |
+
force_range=100.0,
|
| 31 |
+
),
|
| 32 |
+
},
|
| 33 |
+
"collision_groups": {7: 0, 14: 2, 15: 3, 16: 4, 17: 5, 18: 6, 19: 2, 20: 3, 21: 4, 22: 5, 23: 6, 24: 2, 25: 3, 26: 4, 27: 5, 28: 6, 29: 2, 30: 2, 31: 3, 32: 3, 33: 4, 34: 4, 35: 5, 36: 5, 37: 6, 38: 6},
|
| 34 |
+
"collision_palm_name": "left_hand_base",
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
DEX_RIGHT_CFG={
|
| 38 |
+
"urdf_path": get_urdf_path(right_rel_urdf),
|
| 39 |
+
"wrist_link_name": "base_dummy",
|
| 40 |
+
"kpt_link_names": ["r_f_link1_tip", "r_f_link2_tip", "r_f_link3_tip", "r_f_link4_tip", "r_f_link5_tip"], # should be overwritten with retargeting
|
| 41 |
+
"actuators": DEX_LEFT_CFG["actuators"].copy(),
|
| 42 |
+
"collision_groups": {7: 0, 14: 2, 15: 3, 16: 4, 17: 5, 18: 6, 19: 2, 20: 3, 21: 4, 22: 5, 23: 6, 24: 2, 25: 3, 26: 4, 27: 5, 28: 6, 29: 2, 30: 2, 31: 3, 32: 3, 33: 4, 34: 4, 35: 5, 36: 5, 37: 6, 38: 6},
|
| 43 |
+
"collision_palm_name": "right_hand_base",
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
DEX_CFGs=dict(
|
| 47 |
+
left=DEX_LEFT_CFG,
|
| 48 |
+
right=DEX_RIGHT_CFG,
|
| 49 |
+
)
|
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/inspire.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from os.path import join
|
| 3 |
+
from dexmachina.asset_utils import get_urdf_path
|
| 4 |
+
|
| 5 |
+
inspire_asset_dir = "inspire_hand/"
|
| 6 |
+
left_rel_urdf = join(inspire_asset_dir, "left_xyz_copy.urdf")
|
| 7 |
+
right_rel_urdf = join(inspire_asset_dir, "right_xyz_copy.urdf")
|
| 8 |
+
|
| 9 |
+
MIMIC_JOINTS={
|
| 10 |
+
"TH_J3": ("TH_J2", 1.0),
|
| 11 |
+
"TH_J4": ("TH_J2", 1.13),
|
| 12 |
+
"FF_J2": ("FF_J1", 1.13),
|
| 13 |
+
"MF_J2": ("MF_J1", 1.13),
|
| 14 |
+
"RF_J2": ("RF_J1", 1.08),
|
| 15 |
+
"LF_J2": ("LF_J1", 1.13),
|
| 16 |
+
}
|
| 17 |
+
INSPIRE_LEFT_MIMIC_JOINTS=dict()
|
| 18 |
+
for name, (parent, ratio) in MIMIC_JOINTS.items():
|
| 19 |
+
INSPIRE_LEFT_MIMIC_JOINTS[f"L_{name}"] = (f"L_{parent}", ratio)
|
| 20 |
+
INSPIRE_RIGHT_MIMIC_JOINTS=dict()
|
| 21 |
+
for name, (parent, ratio) in MIMIC_JOINTS.items():
|
| 22 |
+
INSPIRE_RIGHT_MIMIC_JOINTS[f"R_{name}"] = (f"R_{parent}", ratio)
|
| 23 |
+
|
| 24 |
+
INSPIRE_LINK_NAMES=["TH_Tip", "FF_Tip", "MF_Tip", "RF_Tip", "LF_Tip"]
|
| 25 |
+
INSPIRE_DEFAULT_QPOS={
|
| 26 |
+
'left': [0.25, 0.11, 1.0, 0.76, 0.18, 0.58, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ],
|
| 27 |
+
'right': [-0.35, 0.1, 1.05, -0.37, 0.23, 2.64, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ]
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
INSPIRE_LEFT_CFG={
|
| 31 |
+
"urdf_path": get_urdf_path(left_rel_urdf),
|
| 32 |
+
"wrist_link_name": "base_link",
|
| 33 |
+
"mimic_joint_map": INSPIRE_LEFT_MIMIC_JOINTS.copy(),
|
| 34 |
+
"kpt_link_names": ['L_'+name for name in INSPIRE_LINK_NAMES],
|
| 35 |
+
# NOTE: this gets reset by demo data
|
| 36 |
+
"joint_limits": {
|
| 37 |
+
"L_forearm_tx_link_joint": (-0.05, 0.3),
|
| 38 |
+
"L_forearm_ty_link_joint": (-0.1, 0.2),
|
| 39 |
+
"L_forearm_tz_link_joint": (1.0, 1.3),
|
| 40 |
+
|
| 41 |
+
"L_forearm_roll_link_joint": (-0.25, 0.5),
|
| 42 |
+
"L_forearm_pitch_link_joint": (0.2, 0.6),
|
| 43 |
+
"L_forearm_yaw_link_joint": (-0.7, 0.4),
|
| 44 |
+
},
|
| 45 |
+
"default_qpos": INSPIRE_DEFAULT_QPOS['left'],
|
| 46 |
+
"actuators": {
|
| 47 |
+
"finger": dict(
|
| 48 |
+
joint_exprs=['.*J1', '.*J2', '.*J3', '.*J4'],
|
| 49 |
+
kp=20.0,
|
| 50 |
+
kv=1.0,
|
| 51 |
+
force_range=50.0,
|
| 52 |
+
),
|
| 53 |
+
"wrist_rot": dict(
|
| 54 |
+
joint_exprs=[r'[LR]_forearm_(roll|pitch|yaw)_link_joint'],
|
| 55 |
+
kp=80,
|
| 56 |
+
kv=5.0,
|
| 57 |
+
force_range=50.0,
|
| 58 |
+
),
|
| 59 |
+
"wrist_trans": dict(
|
| 60 |
+
joint_exprs=[r'[LR]_forearm_t[xyz]_link_joint'],
|
| 61 |
+
kp=350,
|
| 62 |
+
kv=12.0,
|
| 63 |
+
force_range=50.0,
|
| 64 |
+
),
|
| 65 |
+
},
|
| 66 |
+
"collision_groups": {7: 0, 13: 1, 14: 2, 15: 3, 16: 4, 17: 5, 18: 1, 23: 1},
|
| 67 |
+
"collision_palm_name": "base_link",
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
INSPIRE_RIGHT_CFG={
|
| 71 |
+
"urdf_path": get_urdf_path(right_rel_urdf),
|
| 72 |
+
"wrist_link_name": "base_link",
|
| 73 |
+
"mimic_joint_map": INSPIRE_RIGHT_MIMIC_JOINTS.copy(),
|
| 74 |
+
"kpt_link_names": ['R_'+name for name in INSPIRE_LINK_NAMES],
|
| 75 |
+
# NOTE: this gets reset by demo data
|
| 76 |
+
"joint_limits": {
|
| 77 |
+
"R_forearm_tx_link_joint": (-0.4, -0.1),
|
| 78 |
+
"R_forearm_ty_link_joint": (-0.1, 0.2),
|
| 79 |
+
"R_forearm_tz_link_joint": (1.0, 1.3),
|
| 80 |
+
|
| 81 |
+
"R_forearm_roll_link_joint": (-0.4, 0.2),
|
| 82 |
+
"R_forearm_pitch_link_joint": (0.0, 0.6),
|
| 83 |
+
"R_forearm_yaw_link_joint": (2.5, 3.1),
|
| 84 |
+
},
|
| 85 |
+
"default_qpos": INSPIRE_DEFAULT_QPOS['right'],
|
| 86 |
+
"actuators": INSPIRE_LEFT_CFG["actuators"].copy(),
|
| 87 |
+
"collision_groups": INSPIRE_LEFT_CFG["collision_groups"].copy(),
|
| 88 |
+
"collision_palm_name": INSPIRE_LEFT_CFG["collision_palm_name"],
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
INSPIRE_CFGs=dict(left=INSPIRE_LEFT_CFG, right=INSPIRE_RIGHT_CFG)
|
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/schunk.py
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from os.path import join
|
| 3 |
+
from dexmachina.asset_utils import get_urdf_path
|
| 4 |
+
|
| 5 |
+
schunk_asset_dir = "schunk_hand/"
|
| 6 |
+
left_rel_urdf = join(schunk_asset_dir, "schunk_hand_left_6dof.urdf")
|
| 7 |
+
right_rel_urdf = join(schunk_asset_dir, "schunk_hand_right_6dof.urdf")
|
| 8 |
+
|
| 9 |
+
SCHUNK_MIMIC_JOINTS_LEFT = {
|
| 10 |
+
'left_hand_j5': ('left_hand_Thumb_Opposition', 1.0),
|
| 11 |
+
'left_hand_j3': ('left_hand_Thumb_Flexion', 1.01511),
|
| 12 |
+
'left_hand_j4': ('left_hand_Thumb_Flexion', 1.44889),
|
| 13 |
+
'left_hand_j14': ('left_hand_Index_Finger_Distal', 1.045),
|
| 14 |
+
'left_hand_j15': ('left_hand_Middle_Finger_Distal', 1.0454),
|
| 15 |
+
'left_hand_j12': ('left_hand_Ring_Finger', 1.3588),
|
| 16 |
+
'left_hand_j16': ('left_hand_Ring_Finger', 1.42093),
|
| 17 |
+
'left_hand_j13': ('left_hand_Pinky', 1.3588),
|
| 18 |
+
'left_hand_j17': ('left_hand_Pinky', 1.42307),
|
| 19 |
+
'left_hand_index_spread': ('left_hand_Finger_Spread', 0.5),
|
| 20 |
+
'left_hand_ring_spread': ('left_hand_Finger_Spread', 0.5),
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
SCHUNK_LEFT_CFG={
|
| 24 |
+
"urdf_path": get_urdf_path(left_rel_urdf),
|
| 25 |
+
"wrist_link_name": "left_hand_base_link",
|
| 26 |
+
"kpt_link_names": ["thtip", "fftip", "mftip", "rftip", "lftip", "left_hand_b", "left_hand_p", "left_hand_o", "left_hand_n", "left_hand_i"],
|
| 27 |
+
"mimic_joint_map": SCHUNK_MIMIC_JOINTS_LEFT.copy(),
|
| 28 |
+
"actuators": {
|
| 29 |
+
"finger": dict(
|
| 30 |
+
joint_exprs=['.*hand.+'],
|
| 31 |
+
kp=80,
|
| 32 |
+
kv=4.5,
|
| 33 |
+
force_range=80,
|
| 34 |
+
),
|
| 35 |
+
"wrist_rot": dict(
|
| 36 |
+
joint_exprs=[r'[LR]_forearm_(roll|pitch|yaw)_link_joint'],
|
| 37 |
+
kp=80,
|
| 38 |
+
kv=5,
|
| 39 |
+
force_range=100,
|
| 40 |
+
),
|
| 41 |
+
"wrist_trans": dict(
|
| 42 |
+
joint_exprs=[r'[LR]_forearm_t[xyz]_link_joint'],
|
| 43 |
+
kp=350,
|
| 44 |
+
kv=8,
|
| 45 |
+
force_range=100,
|
| 46 |
+
),
|
| 47 |
+
},
|
| 48 |
+
"collision_groups": {7: 0, 8: 0, 13: 1, 14: 1, 15: 2, 16: 3, 17: 4, 18: 1, 19: 1, 20: 2, 21: 3, 22: 4, 23: 1, 24: 1, 25: 2, 26: 3, 27: 4, 28: 1, 29: 1},
|
| 49 |
+
"collision_palm_name": "left_hand_e1",
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
SCHUNK_MIMIC_JOINTS_RIGHT={
|
| 53 |
+
'right_hand_j5': ('right_hand_Thumb_Opposition', 1.0),
|
| 54 |
+
'right_hand_j3': ('right_hand_Thumb_Flexion', 1.01511),
|
| 55 |
+
'right_hand_j4': ('right_hand_Thumb_Flexion', 1.44889),
|
| 56 |
+
'right_hand_j14': ('right_hand_Index_Finger_Distal', 1.045),
|
| 57 |
+
'right_hand_j15': ('right_hand_Middle_Finger_Distal', 1.0454),
|
| 58 |
+
'right_hand_j12': ('right_hand_Ring_Finger', 1.3588),
|
| 59 |
+
'right_hand_j16': ('right_hand_Ring_Finger', 1.42093),
|
| 60 |
+
'right_hand_j13': ('right_hand_Pinky', 1.3588),
|
| 61 |
+
'right_hand_j17': ('right_hand_Pinky', 1.42307),
|
| 62 |
+
'right_hand_index_spread': ('right_hand_Finger_Spread', 0.5),
|
| 63 |
+
'right_hand_ring_spread': ('right_hand_Finger_Spread', 0.5),
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
SCHUNK_RIGHT_CFG={
|
| 67 |
+
"urdf_path": get_urdf_path(right_rel_urdf),
|
| 68 |
+
"wrist_link_name": "right_hand_base_link",
|
| 69 |
+
"kpt_link_names": ["thtip", "fftip", "mftip", "rftip", "lftip", "right_hand_b", "right_hand_p", "right_hand_o", "right_hand_n", "right_hand_i"],
|
| 70 |
+
"mimic_joint_map": SCHUNK_MIMIC_JOINTS_RIGHT.copy(),
|
| 71 |
+
"actuators": SCHUNK_LEFT_CFG["actuators"].copy(),
|
| 72 |
+
"collision_groups": {7: 0, 8: 0, 13: 1, 14: 1, 15: 2, 16: 3, 17: 4, 18: 1, 19: 1, 20: 2, 21: 3, 22: 4, 23: 1, 24: 1, 25: 2, 26: 3, 27: 4, 28: 1, 29: 1},
|
| 73 |
+
"collision_palm_name": "right_hand_e1",
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
SCHUNK_CFGs=dict(left=SCHUNK_LEFT_CFG, right=SCHUNK_RIGHT_CFG)
|
outputs/_runtime_patches/dexmachina/envs/hand_cfgs/xhand.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from os.path import join
|
| 3 |
+
from dexmachina.asset_utils import get_urdf_path
|
| 4 |
+
|
| 5 |
+
xhand_asset_dir = "xhand/"
|
| 6 |
+
left_rel_urdf = join(xhand_asset_dir, "xhand_left_6dof.urdf")
|
| 7 |
+
right_rel_urdf = join(xhand_asset_dir, "xhand_right_6dof.urdf")
|
| 8 |
+
|
| 9 |
+
XHAND_LEFT_CFG={
|
| 10 |
+
"urdf_path": get_urdf_path(left_rel_urdf),
|
| 11 |
+
"wrist_link_name": "left_hand_link",
|
| 12 |
+
"kpt_link_names": ["left_hand_thumb_rota_tip", "left_hand_index_rota_tip", "left_hand_mid_tip", "left_hand_ring_tip", "left_hand_pinky_tip"],
|
| 13 |
+
"actuators": {
|
| 14 |
+
"finger": dict(
|
| 15 |
+
joint_exprs=['.*joint.+'],
|
| 16 |
+
kp=20.0,
|
| 17 |
+
kv=1.5,
|
| 18 |
+
force_range=100.0,
|
| 19 |
+
),
|
| 20 |
+
"wrist_rot": dict(
|
| 21 |
+
joint_exprs=[r'[LR]_forearm_(roll|pitch|yaw)_link_joint'],
|
| 22 |
+
kp=60.0,
|
| 23 |
+
kv=3.0,
|
| 24 |
+
force_range=100,
|
| 25 |
+
),
|
| 26 |
+
"wrist_trans": dict(
|
| 27 |
+
joint_exprs=[r'[LR]_forearm_t[xyz]_link_joint'],
|
| 28 |
+
kp=350.0,
|
| 29 |
+
kv=15.0,
|
| 30 |
+
force_range=100,
|
| 31 |
+
),
|
| 32 |
+
},
|
| 33 |
+
"collision_groups": {7: 0, 13: 1, 14: 2, 15: 3, 16: 4, 17: 5, 18: 1, 19: 2},
|
| 34 |
+
"collision_palm_name": "left_hand_link",
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
XHAND_RIGHT_CFG={
|
| 38 |
+
"urdf_path": get_urdf_path(right_rel_urdf),
|
| 39 |
+
"wrist_link_name": "right_hand_link",
|
| 40 |
+
"kpt_link_names": ["right_hand_thumb_rota_tip", "right_hand_index_rota_tip", "right_hand_mid_tip", "right_hand_ring_tip", "right_hand_pinky_tip"],
|
| 41 |
+
"actuators": XHAND_LEFT_CFG["actuators"].copy(),
|
| 42 |
+
"collision_groups": {7: 0, 13: 1, 14: 2, 15: 3, 16: 4, 17: 5, 18: 1, 19: 2},
|
| 43 |
+
"collision_palm_name": "right_hand_link",
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
XHAND_CFGs=dict(
|
| 47 |
+
left=XHAND_LEFT_CFG,
|
| 48 |
+
right=XHAND_RIGHT_CFG,
|
| 49 |
+
)
|
outputs/_scripts/scene_demo.py
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""End-to-end Genesis/dexmachina scene demo.
|
| 2 |
+
|
| 3 |
+
Runs inside the `benchmarking/dexmachina:latest` container. Patches the
|
| 4 |
+
installed `dexmachina` package with the missing `envs/hand_cfgs/` submodule
|
| 5 |
+
(copied to `outputs/_runtime_patches` on the host, volume-mounted at
|
| 6 |
+
`/workspace/outputs/_runtime_patches`), verifies imports, builds a small
|
| 7 |
+
Genesis scene (ground plane + xhand URDF), renders 60 frames and muxes them
|
| 8 |
+
into an mp4 via `shared.bench.VideoRecorder`.
|
| 9 |
+
|
| 10 |
+
All output artefacts are written under `/workspace/outputs/`.
|
| 11 |
+
"""
|
| 12 |
+
from __future__ import annotations
|
| 13 |
+
|
| 14 |
+
import json
|
| 15 |
+
import os
|
| 16 |
+
import shutil
|
| 17 |
+
import sys
|
| 18 |
+
import time
|
| 19 |
+
import traceback
|
| 20 |
+
from pathlib import Path
|
| 21 |
+
|
| 22 |
+
OUT_ROOT = Path("/workspace/outputs")
|
| 23 |
+
LOG_PATH = OUT_ROOT / "logs" / "dexmachina_scene_demo.log"
|
| 24 |
+
MP4_PATH = OUT_ROOT / "videos" / "dexmachina_xhand_demo.mp4"
|
| 25 |
+
LOG_PATH.parent.mkdir(parents=True, exist_ok=True)
|
| 26 |
+
MP4_PATH.parent.mkdir(parents=True, exist_ok=True)
|
| 27 |
+
|
| 28 |
+
log_buf = []
|
| 29 |
+
|
| 30 |
+
def log(msg: str) -> None:
|
| 31 |
+
print(msg, flush=True)
|
| 32 |
+
log_buf.append(str(msg))
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def flush_log() -> None:
|
| 36 |
+
LOG_PATH.write_text("\n".join(log_buf) + "\n")
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
# ---- 1. runtime-patch dexmachina.envs.hand_cfgs (missing in installed wheel)
|
| 40 |
+
def patch_hand_cfgs() -> None:
|
| 41 |
+
import dexmachina
|
| 42 |
+
dst = Path(dexmachina.__file__).parent / "envs" / "hand_cfgs"
|
| 43 |
+
src = Path("/workspace/outputs/_runtime_patches/dexmachina/envs/hand_cfgs")
|
| 44 |
+
if not dst.exists():
|
| 45 |
+
if not src.exists():
|
| 46 |
+
raise RuntimeError(f"hand_cfgs staged source missing: {src}")
|
| 47 |
+
shutil.copytree(src, dst)
|
| 48 |
+
log(f"patched: copied {src} -> {dst}")
|
| 49 |
+
else:
|
| 50 |
+
log(f"hand_cfgs already present at {dst}")
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
# ---- 2. import graph
|
| 54 |
+
def do_imports() -> dict:
|
| 55 |
+
import importlib.metadata as im
|
| 56 |
+
import torch, genesis, rl_games, dexmachina # noqa: F401
|
| 57 |
+
from dexmachina.envs.hand_cfgs.xhand import XHAND_CFGs
|
| 58 |
+
from dexmachina.envs import base_env
|
| 59 |
+
|
| 60 |
+
info = {
|
| 61 |
+
"torch": torch.__version__,
|
| 62 |
+
"genesis": getattr(genesis, "__version__", "ok"),
|
| 63 |
+
"rl_games": im.version("rl_games"),
|
| 64 |
+
"dexmachina": im.version("dexmachina"),
|
| 65 |
+
"cuda_available": bool(torch.cuda.is_available()),
|
| 66 |
+
"BaseEnv": base_env.BaseEnv.__name__,
|
| 67 |
+
"XHAND_CFGs_keys": list(XHAND_CFGs.keys()),
|
| 68 |
+
}
|
| 69 |
+
return info
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
# ---- 3. scene demo
|
| 73 |
+
def run_scene_demo() -> dict:
|
| 74 |
+
import numpy as np
|
| 75 |
+
import torch
|
| 76 |
+
import genesis as gs
|
| 77 |
+
sys.path.insert(0, "/workspace/shared")
|
| 78 |
+
from bench.video_recorder import VideoRecorder
|
| 79 |
+
|
| 80 |
+
backend = gs.cuda if torch.cuda.is_available() else gs.cpu
|
| 81 |
+
log(f"genesis.init backend={backend}")
|
| 82 |
+
gs.init(backend=backend, logging_level="warning")
|
| 83 |
+
|
| 84 |
+
scene = gs.Scene(show_viewer=False)
|
| 85 |
+
|
| 86 |
+
# ground plane
|
| 87 |
+
scene.add_entity(gs.morphs.Plane())
|
| 88 |
+
|
| 89 |
+
# xhand URDF (right hand is the standard variant)
|
| 90 |
+
# Preference order: staging-backed /workspace/assets symlinks (but in this
|
| 91 |
+
# image those aren't mounted, so the symlink target is missing), then the
|
| 92 |
+
# dexmachina-shipped URDF. We try both so future mount changes "just work".
|
| 93 |
+
candidates = [
|
| 94 |
+
"/workspace/assets/urdf/xhand/xhand_urdf/xhand_right/urdf/xhand_right.urdf",
|
| 95 |
+
"/usr/local/lib/python3.10/dist-packages/dexmachina/assets/xhand/xhand_right.urdf",
|
| 96 |
+
]
|
| 97 |
+
urdf_path = next((p for p in candidates if Path(p).exists()), None)
|
| 98 |
+
assert urdf_path is not None, f"no xhand urdf found among {candidates}"
|
| 99 |
+
log(f"urdf_path={urdf_path}")
|
| 100 |
+
hand = scene.add_entity(
|
| 101 |
+
gs.morphs.URDF(
|
| 102 |
+
file=urdf_path,
|
| 103 |
+
pos=(0.0, 0.0, 0.25),
|
| 104 |
+
fixed=True,
|
| 105 |
+
)
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
W, H = 640, 480
|
| 109 |
+
camera = scene.add_camera(
|
| 110 |
+
res=(W, H),
|
| 111 |
+
pos=(0.6, 0.6, 0.45),
|
| 112 |
+
lookat=(0.0, 0.0, 0.2),
|
| 113 |
+
fov=45,
|
| 114 |
+
GUI=False,
|
| 115 |
+
)
|
| 116 |
+
|
| 117 |
+
scene.build()
|
| 118 |
+
log(f"scene built; hand entity: {hand}")
|
| 119 |
+
|
| 120 |
+
rec = VideoRecorder(MP4_PATH, fps=30, size=(W, H))
|
| 121 |
+
n_frames = 60
|
| 122 |
+
t0 = time.time()
|
| 123 |
+
for i in range(n_frames):
|
| 124 |
+
scene.step()
|
| 125 |
+
out = camera.render()
|
| 126 |
+
# Genesis camera.render returns a tuple (rgb, depth, seg, normal)
|
| 127 |
+
rgb = out[0] if isinstance(out, tuple) else out
|
| 128 |
+
if hasattr(rgb, "cpu"):
|
| 129 |
+
rgb = rgb.cpu().numpy()
|
| 130 |
+
if rgb.dtype != np.uint8:
|
| 131 |
+
rgb = rgb.astype(np.uint8)
|
| 132 |
+
if rgb.shape[-1] == 4:
|
| 133 |
+
rgb = rgb[..., :3]
|
| 134 |
+
rec.log_frame(np.ascontiguousarray(rgb))
|
| 135 |
+
rec.close()
|
| 136 |
+
dt = time.time() - t0
|
| 137 |
+
|
| 138 |
+
size_bytes = MP4_PATH.stat().st_size
|
| 139 |
+
log(f"rendered {n_frames} frames {W}x{H} in {dt:.2f}s; mp4={MP4_PATH} ({size_bytes} bytes)")
|
| 140 |
+
return {
|
| 141 |
+
"mp4_path": str(MP4_PATH),
|
| 142 |
+
"frames": n_frames,
|
| 143 |
+
"resolution": [W, H],
|
| 144 |
+
"mp4_size_bytes": size_bytes,
|
| 145 |
+
"backend": str(backend),
|
| 146 |
+
"elapsed_s": round(dt, 3),
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
def main() -> int:
|
| 151 |
+
result = {"ok": True, "steps": {}}
|
| 152 |
+
try:
|
| 153 |
+
patch_hand_cfgs()
|
| 154 |
+
imports = do_imports()
|
| 155 |
+
result["steps"]["imports"] = imports
|
| 156 |
+
log("IMPORTS: " + json.dumps(imports))
|
| 157 |
+
except Exception as e:
|
| 158 |
+
result["ok"] = False
|
| 159 |
+
result["steps"]["imports_error"] = repr(e)
|
| 160 |
+
log("IMPORT ERROR: " + repr(e))
|
| 161 |
+
log(traceback.format_exc())
|
| 162 |
+
flush_log()
|
| 163 |
+
(OUT_ROOT / "logs" / "dexmachina_scene_demo.json").write_text(json.dumps(result, indent=2))
|
| 164 |
+
return 2
|
| 165 |
+
|
| 166 |
+
try:
|
| 167 |
+
scene_info = run_scene_demo()
|
| 168 |
+
result["steps"]["scene"] = scene_info
|
| 169 |
+
log("SCENE: " + json.dumps(scene_info))
|
| 170 |
+
except Exception as e:
|
| 171 |
+
result["ok"] = False
|
| 172 |
+
result["steps"]["scene_error"] = repr(e)
|
| 173 |
+
log("SCENE ERROR: " + repr(e))
|
| 174 |
+
log(traceback.format_exc())
|
| 175 |
+
flush_log()
|
| 176 |
+
(OUT_ROOT / "logs" / "dexmachina_scene_demo.json").write_text(json.dumps(result, indent=2))
|
| 177 |
+
return 3
|
| 178 |
+
|
| 179 |
+
flush_log()
|
| 180 |
+
(OUT_ROOT / "logs" / "dexmachina_scene_demo.json").write_text(json.dumps(result, indent=2))
|
| 181 |
+
log("DONE")
|
| 182 |
+
return 0
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
if __name__ == "__main__":
|
| 186 |
+
sys.exit(main())
|
outputs/aggregated/.gitkeep
ADDED
|
File without changes
|
outputs/logs/.gitkeep
ADDED
|
File without changes
|
outputs/logs/dexmachina_scene_demo.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ok": true,
|
| 3 |
+
"steps": {
|
| 4 |
+
"imports": {
|
| 5 |
+
"torch": "2.5.1+cu121",
|
| 6 |
+
"genesis": "0.3.3",
|
| 7 |
+
"rl_games": "1.6.1",
|
| 8 |
+
"dexmachina": "0.1.0",
|
| 9 |
+
"cuda_available": true,
|
| 10 |
+
"BaseEnv": "BaseEnv",
|
| 11 |
+
"XHAND_CFGs_keys": [
|
| 12 |
+
"left",
|
| 13 |
+
"right"
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
"scene": {
|
| 17 |
+
"mp4_path": "/workspace/outputs/videos/dexmachina_xhand_demo.mp4",
|
| 18 |
+
"frames": 60,
|
| 19 |
+
"resolution": [
|
| 20 |
+
640,
|
| 21 |
+
480
|
| 22 |
+
],
|
| 23 |
+
"mp4_size_bytes": 20042,
|
| 24 |
+
"backend": "backend.cuda",
|
| 25 |
+
"elapsed_s": 34.933
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
}
|
outputs/logs/dexmachina_scene_demo.log
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
patched: copied /workspace/outputs/_runtime_patches/dexmachina/envs/hand_cfgs -> /usr/local/lib/python3.10/dist-packages/dexmachina/envs/hand_cfgs
|
| 2 |
+
IMPORTS: {"torch": "2.5.1+cu121", "genesis": "0.3.3", "rl_games": "1.6.1", "dexmachina": "0.1.0", "cuda_available": true, "BaseEnv": "BaseEnv", "XHAND_CFGs_keys": ["left", "right"]}
|
| 3 |
+
genesis.init backend=gs.cuda
|
| 4 |
+
urdf_path=/usr/local/lib/python3.10/dist-packages/dexmachina/assets/xhand/xhand_right.urdf
|
| 5 |
+
scene built; hand entity: <gs.RigidEntity>
|
| 6 |
+
rendered 60 frames 640x480 in 34.93s; mp4=/workspace/outputs/videos/dexmachina_xhand_demo.mp4 (20042 bytes)
|
| 7 |
+
SCENE: {"mp4_path": "/workspace/outputs/videos/dexmachina_xhand_demo.mp4", "frames": 60, "resolution": [640, 480], "mp4_size_bytes": 20042, "backend": "backend.cuda", "elapsed_s": 34.933}
|
outputs/logs/spider_lift_board_allegro.log
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Building spider @ file:///opt/spider
|
| 2 |
+
Built spider @ file:///opt/spider
|
| 3 |
+
Uninstalled 1 package in 20ms
|
| 4 |
+
Installed 1 package in 2ms
|
| 5 |
+
Warp 1.11.0.dev20251120 initialized:
|
| 6 |
+
Git commit: bf8830d11365ac5061c779c55b5278d733076d4f
|
| 7 |
+
CUDA Toolkit 12.8, Driver 13.0
|
| 8 |
+
Devices:
|
| 9 |
+
"cpu" : "x86_64"
|
| 10 |
+
"cuda:0" : "NVIDIA A100 80GB PCIe" (79 GiB, sm_80, mempool enabled)
|
| 11 |
+
Kernel cache:
|
| 12 |
+
/root/.cache/warp/1.11.0.dev20251120
|
| 13 |
+
Error executing job with overrides: ['+override=oakink', 'task=lift_board', 'data_id=0', 'robot_type=allegro', 'embodiment_type=bimanual']
|
| 14 |
+
Traceback (most recent call last):
|
| 15 |
+
File "/opt/spider/examples/run_mjwp.py", line 615, in run_main
|
| 16 |
+
main(config)
|
| 17 |
+
File "/opt/spider/examples/run_mjwp.py", line 185, in main
|
| 18 |
+
config = process_config(config)
|
| 19 |
+
^^^^^^^^^^^^^^^^^^^^^^
|
| 20 |
+
File "/opt/spider/spider/config.py", line 448, in process_config
|
| 21 |
+
model = mujoco.MjModel.from_xml_path(config.model_path)
|
| 22 |
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 23 |
+
ValueError: ParseXML: Error opening file '/opt/spider/example_datasets/processed/oakink/allegro/bimanual/lift_board/0/../scene.xml'
|
| 24 |
+
|
| 25 |
+
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
|
outputs/logs/spider_record_frames.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offscreen render the Spider Allegro bimanual hand scene to mp4.
|
| 2 |
+
|
| 3 |
+
Used by the end-to-end evaluation to prove:
|
| 4 |
+
1. MuJoCo (the Spider sim backend) loads the hand assets baked into the image.
|
| 5 |
+
2. shared.bench.VideoRecorder encodes rendered frames into a valid mp4.
|
| 6 |
+
|
| 7 |
+
Runs inside the `benchmarking/spider:latest` image with MUJOCO_GL=egl.
|
| 8 |
+
"""
|
| 9 |
+
from __future__ import annotations
|
| 10 |
+
|
| 11 |
+
import sys
|
| 12 |
+
from pathlib import Path
|
| 13 |
+
|
| 14 |
+
import mujoco
|
| 15 |
+
import numpy as np
|
| 16 |
+
|
| 17 |
+
# shared/bench is on the default PYTHONPATH of the spider container.
|
| 18 |
+
from bench.video_recorder import VideoRecorder
|
| 19 |
+
|
| 20 |
+
XML = "/opt/spider/spider/assets/robots/allegro/bimanual.xml"
|
| 21 |
+
OUT = Path("/workspace/outputs/videos/spider_allegro_oakink_lift_board_bimanual_data0.mp4")
|
| 22 |
+
W, H = 640, 480
|
| 23 |
+
FPS = 30
|
| 24 |
+
N_FRAMES = 60 # 2s of video
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def main() -> int:
|
| 28 |
+
OUT.parent.mkdir(parents=True, exist_ok=True)
|
| 29 |
+
model = mujoco.MjModel.from_xml_path(XML)
|
| 30 |
+
data = mujoco.MjData(model)
|
| 31 |
+
print(f"model loaded: nq={model.nq} nv={model.nv} nu={model.nu} nbody={model.nbody}")
|
| 32 |
+
|
| 33 |
+
# Basic sweep: oscillate each hinge around its midrange to prove the scene
|
| 34 |
+
# is alive and frames differ. We don't have a retargeted qpos trajectory
|
| 35 |
+
# (preprocessed npz isn't in the image), so this is a synthetic wave.
|
| 36 |
+
jnt_range = model.jnt_range.copy()
|
| 37 |
+
mid = 0.5 * (jnt_range[:, 0] + jnt_range[:, 1])
|
| 38 |
+
amp = 0.5 * (jnt_range[:, 1] - jnt_range[:, 0])
|
| 39 |
+
limited = model.jnt_limited.astype(bool)
|
| 40 |
+
mid = np.where(limited, mid, 0.0)
|
| 41 |
+
amp = np.where(limited, amp, 0.2)
|
| 42 |
+
|
| 43 |
+
renderer = mujoco.Renderer(model, height=H, width=W)
|
| 44 |
+
|
| 45 |
+
with VideoRecorder(OUT, fps=FPS, size=(W, H)) as rec:
|
| 46 |
+
for t in range(N_FRAMES):
|
| 47 |
+
phase = 2.0 * np.pi * t / N_FRAMES
|
| 48 |
+
qpos_joint = mid + amp * 0.3 * np.sin(phase + np.arange(model.njnt) * 0.1)
|
| 49 |
+
# Set per-joint qpos via qpos_addr to avoid size mismatches when
|
| 50 |
+
# some joints (e.g. free joints) span multiple qpos entries.
|
| 51 |
+
data.qpos[:] = 0.0
|
| 52 |
+
for j in range(model.njnt):
|
| 53 |
+
addr = model.jnt_qposadr[j]
|
| 54 |
+
jtype = model.jnt_type[j]
|
| 55 |
+
if jtype == mujoco.mjtJoint.mjJNT_HINGE or jtype == mujoco.mjtJoint.mjJNT_SLIDE:
|
| 56 |
+
data.qpos[addr] = qpos_joint[j]
|
| 57 |
+
elif jtype == mujoco.mjtJoint.mjJNT_FREE:
|
| 58 |
+
# leave pose at identity, just set position z=0
|
| 59 |
+
data.qpos[addr : addr + 3] = 0.0
|
| 60 |
+
data.qpos[addr + 3] = 1.0
|
| 61 |
+
data.qpos[addr + 4 : addr + 7] = 0.0
|
| 62 |
+
mujoco.mj_forward(model, data)
|
| 63 |
+
renderer.update_scene(data)
|
| 64 |
+
frame = renderer.render() # H x W x 3 uint8
|
| 65 |
+
assert frame.shape == (H, W, 3), frame.shape
|
| 66 |
+
assert frame.dtype == np.uint8, frame.dtype
|
| 67 |
+
rec.log_frame(frame)
|
| 68 |
+
out_path = rec.close()
|
| 69 |
+
|
| 70 |
+
size_bytes = out_path.stat().st_size if out_path.exists() else 0
|
| 71 |
+
print(f"wrote {out_path} bytes={size_bytes} frames={N_FRAMES} res={W}x{H}")
|
| 72 |
+
if size_bytes < 1024:
|
| 73 |
+
print("ERROR: mp4 too small", file=sys.stderr)
|
| 74 |
+
return 2
|
| 75 |
+
return 0
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
if __name__ == "__main__":
|
| 79 |
+
sys.exit(main())
|
outputs/logs/spider_vnc_check.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
VNC stack verification — 2026-04-16
|
| 2 |
+
container: c0da598ab305 (benchmarking/spider:latest, viz overlay)
|
| 3 |
+
ports: 0.0.0.0:5903->5901/tcp (RFB), 0.0.0.0:6903->6901/tcp (noVNC)
|
| 4 |
+
|
| 5 |
+
curl http://localhost:6903/vnc.html
|
| 6 |
+
HTTP_CODE=200 SIZE=15850
|
| 7 |
+
<!DOCTYPE html><html class="noVNC_loading">...<title>noVNC</title>...
|
| 8 |
+
|
| 9 |
+
docker exec ... ps -eo pid,comm,args (filtered):
|
| 10 |
+
45 Xvnc Xvnc :1 -geometry 1600x900 -depth 24 -rfbport 5901 -SecurityTypes None -AlwaysShared
|
| 11 |
+
46 fluxbox fluxbox
|
| 12 |
+
47 websockify /usr/bin/python3 /usr/bin/websockify --web=/usr/share/novnc 6901 localhost:5901
|
| 13 |
+
|
| 14 |
+
xwininfo not installed inside the spider image — fell back to `ps` to prove the
|
| 15 |
+
Xvnc+fluxbox+websockify chain is live. Geometry matches docker-compose.viz.yml
|
| 16 |
+
(VIZ_GEOMETRY=1600x900). A browser pointed at http://<host>:6903/vnc.html with
|
| 17 |
+
password `bench` would attach to :1 and see fluxbox.
|
outputs/metrics/.gitkeep
ADDED
|
File without changes
|
outputs/sweep.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[sweep.sh] 2026-04-16T20:54:46+00:00 skip-existing run_id=maniptrans_xhand_oakink_v2_lift_board_bimanual_seed42_ours
|
outputs/videos/.gitkeep
ADDED
|
File without changes
|
outputs/videos/dexmachina_xhand_demo.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77073ee148832b7fe6961abbd2d4fcb28ed2ce4c233cf06d899e67a0f6b33e40
|
| 3 |
+
size 20042
|
outputs/videos/spider_allegro_oakink_lift_board_bimanual_data0.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a94fd74c17a6db1a3bd28f41a96b84cf83b5d7057f86ee6ed9ddf8a1a9b59fea
|
| 3 |
+
size 44232
|
outputs/videos/vnc_live_frame.png
ADDED
|
Git LFS Details
|