starry0929 commited on
Commit
35f4d03
·
verified ·
1 Parent(s): 4506676

Add missing 1500-case scene, robot models, physical revision and IK dependencies

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +37 -0
  2. 1500case/DEPENDENCIES_README.md +51 -0
  3. 1500case/dependency_bundle_manifest.json +1231 -0
  4. 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj +3 -0
  5. 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj +3 -0
  6. 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj +3 -0
  7. 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj +3 -0
  8. 1500case/implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml +457 -0
  9. 1500case/implementation_revisions/physical_constraints_17/scene_manifest.json +48 -0
  10. 1500case/relocate_dependency_bundle.py +49 -0
  11. 1500case/source/agent_retarget/__init__.py +1 -0
  12. 1500case/source/agent_retarget/config.py +125 -0
  13. 1500case/source/agent_retarget/embodiment.py +211 -0
  14. 1500case/source/agent_retarget/envs.py +103 -0
  15. 1500case/source/agent_retarget/evaluate.py +365 -0
  16. 1500case/source/agent_retarget/ik.py +284 -0
  17. 1500case/source/agent_retarget/instrument.py +259 -0
  18. 1500case/source/agent_retarget/perturb.py +151 -0
  19. 1500case/source/agent_retarget/retarget.py +148 -0
  20. 1500case/source/agent_retarget/source.py +156 -0
  21. 1500case/source/agent_retarget/trackc/__init__.py +6 -0
  22. 1500case/source/agent_retarget/trackc/config_dualarm.py +123 -0
  23. 1500case/source/agent_retarget/trackc/eval_dualarm.py +701 -0
  24. 1500case/source/agent_retarget/trackc/ik_dualarm.py +479 -0
  25. 1500case/source/agent_retarget/trackc/robots.py +88 -0
  26. 1500case/source/agent_retarget/trackc/source_dualarm.py +177 -0
  27. 1500case/source/constrained_waist.py +136 -0
  28. 1500case/source/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/assets/astribot_s1_asset_for_gripper.xml +112 -0
  29. 1500case/source/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/model_with_effector/astribot_s1_model_with_gripper.xml +182 -0
  30. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj +3 -0
  31. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj +3 -0
  32. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj +3 -0
  33. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj +3 -0
  34. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL +3 -0
  35. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL +3 -0
  36. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL +3 -0
  37. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL +3 -0
  38. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL +3 -0
  39. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL +3 -0
  40. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL +3 -0
  41. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL +3 -0
  42. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL +3 -0
  43. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL +3 -0
  44. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL +3 -0
  45. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL +0 -0
  46. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL +0 -0
  47. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL +3 -0
  48. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL +0 -0
  49. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL +0 -0
  50. 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL +3 -0
.gitattributes CHANGED
@@ -58,3 +58,40 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj filter=lfs diff=lfs merge=lfs -text
62
+ 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj filter=lfs diff=lfs merge=lfs -text
63
+ 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj filter=lfs diff=lfs merge=lfs -text
64
+ 1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj filter=lfs diff=lfs merge=lfs -text
65
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RR_Link.STL filter=lfs diff=lfs merge=lfs -text
66
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL filter=lfs diff=lfs merge=lfs -text
67
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LR_Link.STL filter=lfs diff=lfs merge=lfs -text
68
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LF_Link.STL filter=lfs diff=lfs merge=lfs -text
69
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL filter=lfs diff=lfs merge=lfs -text
70
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL filter=lfs diff=lfs merge=lfs -text
71
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RF_Link.STL filter=lfs diff=lfs merge=lfs -text
72
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL filter=lfs diff=lfs merge=lfs -text
73
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL filter=lfs diff=lfs merge=lfs -text
74
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL filter=lfs diff=lfs merge=lfs -text
75
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL filter=lfs diff=lfs merge=lfs -text
76
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL filter=lfs diff=lfs merge=lfs -text
77
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL filter=lfs diff=lfs merge=lfs -text
78
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL filter=lfs diff=lfs merge=lfs -text
79
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL filter=lfs diff=lfs merge=lfs -text
80
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL filter=lfs diff=lfs merge=lfs -text
81
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL filter=lfs diff=lfs merge=lfs -text
82
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL filter=lfs diff=lfs merge=lfs -text
83
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL filter=lfs diff=lfs merge=lfs -text
84
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL filter=lfs diff=lfs merge=lfs -text
85
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL filter=lfs diff=lfs merge=lfs -text
86
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL filter=lfs diff=lfs merge=lfs -text
87
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL filter=lfs diff=lfs merge=lfs -text
88
+ 1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_2.STL filter=lfs diff=lfs merge=lfs -text
89
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/link1.STL filter=lfs diff=lfs merge=lfs -text
90
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/link8.STL filter=lfs diff=lfs merge=lfs -text
91
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/link3.STL filter=lfs diff=lfs merge=lfs -text
92
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/link7.STL filter=lfs diff=lfs merge=lfs -text
93
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/gripper_base.STL filter=lfs diff=lfs merge=lfs -text
94
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/link4.STL filter=lfs diff=lfs merge=lfs -text
95
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/link5.STL filter=lfs diff=lfs merge=lfs -text
96
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/link2.STL filter=lfs diff=lfs merge=lfs -text
97
+ 1500case/source/models/trackc/piper_isaac_sim/piper_description/meshes/base_link.STL filter=lfs diff=lfs merge=lfs -text
1500case/DEPENDENCIES_README.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RSSR 1500-case missing dependency supplement
2
+
3
+ This supplement accompanies the existing `1500case/assets` and `1500case/dataset`.
4
+ It does not introduce new successful trajectories or change experiment outcomes.
5
+
6
+ ## Contents
7
+
8
+ - `source/scene`: original tabletop XML, scene metadata and task-frame contract.
9
+ - `source/models`: actual referenced Piper and S1 files, not the server's directory symlink.
10
+ - `source/agent_retarget`: the saved agent package, including IK, robot definitions and imports.
11
+ - `source/*.py`: four transitively imported local evaluator/IK helpers.
12
+ - `implementation_revisions/physical_constraints_17`: original physical XML and scene manifest.
13
+ - `implementation_revisions/physical_backend_preflight_16/recovered_assets`: the actual OBJ files referenced by revision 17.
14
+ - `dependency_bundle_manifest.json`: original paths, sizes, SHA-256 digests and XML dependency edges.
15
+
16
+ Original experiment root:
17
+
18
+ ```
19
+ /pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913
20
+ ```
21
+
22
+ All original packaged file bytes are preserved. The original XML and some Python
23
+ helpers contain absolute server paths. Simply downloading the directory does not
24
+ make those paths portable. Use the supplied relocation script to create a separate
25
+ local copy; the downloaded originals are never edited.
26
+
27
+ ```
28
+ python /path/to/download/1500case/relocate_dependency_bundle.py \
29
+ --destination /path/to/new/nonexistent/1500_dependencies_portable
30
+ ```
31
+
32
+ The script checks original SHA-256 digests, copies only the manifest-listed
33
+ dependencies and rewrites the known experiment/model prefixes in XML, Python and
34
+ scene metadata. Keep the generated relocation receipt. Relocation changes paths,
35
+ not numeric physics parameters, mesh bytes or task thresholds. The result is a
36
+ dependency supplement, not a standalone full campaign launcher or dataset export.
37
+
38
+ `tabletop_scene.build_scene()` optionally reads original S1 construction metadata.
39
+ Four legacy original OBJ inputs are Git LFS pointer metadata; that builder detects
40
+ them and uses the provided real STL fallbacks. These pointer files are explicitly
41
+ listed in the manifest. They are not substitutes for renderable OBJ assets. The
42
+ compiled revision-17 scene instead references the provided real recovered OBJ
43
+ files; those are the authoritative resources for loading that scene.
44
+
45
+ Third-party Python libraries are not bundled. The manifest records external import
46
+ roots (including NumPy, MuJoCo, robosuite, mimicgen, h5py and pyarrow); use compatible
47
+ versions from the original experiment environment. Regenerating a scene or loading
48
+ other robot families may need additional assets outside this supplement.
49
+
50
+ No credentials, `.env` files, caches, API logs or unrelated model directories are
51
+ included. Existing repository data is not overwritten by this addition.
1500case/dependency_bundle_manifest.json ADDED
@@ -0,0 +1,1231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "rssr.1500_missing_dependencies.v1",
3
+ "source_experiment_root": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913",
4
+ "created_date": "2026-10-12",
5
+ "repo_id": "starry0929/rssr",
6
+ "path_in_repo": "1500case",
7
+ "original_file_bytes_preserved": true,
8
+ "models_symlink_materialized": true,
9
+ "scope": "Missing model, scene, IK/evaluator code dependencies; not a complete campaign or new trajectories",
10
+ "files": [
11
+ {
12
+ "path": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj",
13
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj",
14
+ "bytes": 38496139,
15
+ "sha256": "5a6dc2fa33de59fd0502c6482eaabc48d846c1ecc863d74f1ec33f83fcd96360",
16
+ "reasons": [
17
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
18
+ ]
19
+ },
20
+ {
21
+ "path": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj",
22
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj",
23
+ "bytes": 40001354,
24
+ "sha256": "dd7b42ad341963e0aaa7e898411078173ba2613a5eff60140232c7d04d0b36da",
25
+ "reasons": [
26
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
27
+ ]
28
+ },
29
+ {
30
+ "path": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj",
31
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj",
32
+ "bytes": 33347575,
33
+ "sha256": "d3f639a37cc63757da571bbeeedd130c98afd798af6ba33f1a7960884549b1e3",
34
+ "reasons": [
35
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
36
+ ]
37
+ },
38
+ {
39
+ "path": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj",
40
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj",
41
+ "bytes": 28906301,
42
+ "sha256": "955db3acb335e179d35a0ad76f537109f6d2ab0b74fd6d9d5d0db7ed7ef14a32",
43
+ "reasons": [
44
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
45
+ ]
46
+ },
47
+ {
48
+ "path": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
49
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
50
+ "bytes": 51819,
51
+ "sha256": "32080253a239bb695fca4076a52fcf7d7ca328da8ac988a275658b9d28f77cae",
52
+ "reasons": [
53
+ "MJCF model or include"
54
+ ]
55
+ },
56
+ {
57
+ "path": "implementation_revisions/physical_constraints_17/scene_manifest.json",
58
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_constraints_17/scene_manifest.json",
59
+ "bytes": 2543,
60
+ "sha256": "80464f53d2dad8a5d2be438488c43cfab3b95e359245fe8aaea7ea660db34414",
61
+ "reasons": [
62
+ "Scene metadata and provenance"
63
+ ]
64
+ },
65
+ {
66
+ "path": "source/agent_retarget/__init__.py",
67
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/__init__.py",
68
+ "bytes": 63,
69
+ "sha256": "8344379114e1f688fee09733429981f065719fcca788dbcdd60768f6f118c871",
70
+ "reasons": [
71
+ "Agent package or transitive local Python import"
72
+ ]
73
+ },
74
+ {
75
+ "path": "source/agent_retarget/config.py",
76
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/config.py",
77
+ "bytes": 6452,
78
+ "sha256": "58ebc07915d84f5d5d0f4fccddec0da9aa92aca95c5b95d2fca495c1583e530d",
79
+ "reasons": [
80
+ "Agent package or transitive local Python import"
81
+ ]
82
+ },
83
+ {
84
+ "path": "source/agent_retarget/embodiment.py",
85
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/embodiment.py",
86
+ "bytes": 8746,
87
+ "sha256": "f9b86671b4899dd07377d29f89e34095d17742faf033eaefacdbd4bfe67eb1e9",
88
+ "reasons": [
89
+ "Agent package or transitive local Python import"
90
+ ]
91
+ },
92
+ {
93
+ "path": "source/agent_retarget/envs.py",
94
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/envs.py",
95
+ "bytes": 3664,
96
+ "sha256": "78671442b5d8bc64ad91de541e19a07fbc1f8250f7edfe2782f781363c3a4734",
97
+ "reasons": [
98
+ "Agent package or transitive local Python import"
99
+ ]
100
+ },
101
+ {
102
+ "path": "source/agent_retarget/evaluate.py",
103
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/evaluate.py",
104
+ "bytes": 16317,
105
+ "sha256": "19fc561fb61e8925c75e9113710161f2e2478d21733d7ebf11e6c5e8758cf582",
106
+ "reasons": [
107
+ "Agent package or transitive local Python import"
108
+ ]
109
+ },
110
+ {
111
+ "path": "source/agent_retarget/ik.py",
112
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/ik.py",
113
+ "bytes": 13688,
114
+ "sha256": "c91f5f9b3460b9e27673b7b1fb3161c4d9c35748b6acdda5c4e1138259f9f6c3",
115
+ "reasons": [
116
+ "Agent package or transitive local Python import"
117
+ ]
118
+ },
119
+ {
120
+ "path": "source/agent_retarget/instrument.py",
121
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/instrument.py",
122
+ "bytes": 12286,
123
+ "sha256": "9f244d00219c27bbfea34d3620de979fa9c44f41855e328473591782d2d0b459",
124
+ "reasons": [
125
+ "Agent package or transitive local Python import"
126
+ ]
127
+ },
128
+ {
129
+ "path": "source/agent_retarget/perturb.py",
130
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/perturb.py",
131
+ "bytes": 5683,
132
+ "sha256": "ffb4cf848255b05d40a8323c50a936d4412063dbbb3c301382fc6b6b7fac6ada",
133
+ "reasons": [
134
+ "Agent package or transitive local Python import"
135
+ ]
136
+ },
137
+ {
138
+ "path": "source/agent_retarget/retarget.py",
139
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/retarget.py",
140
+ "bytes": 6923,
141
+ "sha256": "1186b3ddb496321d65e0bf998fa1d0a88cb8ab36541b313870c5f096056680c6",
142
+ "reasons": [
143
+ "Agent package or transitive local Python import"
144
+ ]
145
+ },
146
+ {
147
+ "path": "source/agent_retarget/source.py",
148
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/source.py",
149
+ "bytes": 5846,
150
+ "sha256": "e805e99094af5975c0ec44aae6a90f67859d09f0a7d1f855804f72df95e2c824",
151
+ "reasons": [
152
+ "Agent package or transitive local Python import"
153
+ ]
154
+ },
155
+ {
156
+ "path": "source/agent_retarget/trackc/__init__.py",
157
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/trackc/__init__.py",
158
+ "bytes": 305,
159
+ "sha256": "f7326751cb0d23acf779e8fc672523954d97ffd5c6025ab229876c24fe8b8af3",
160
+ "reasons": [
161
+ "Agent package or transitive local Python import"
162
+ ]
163
+ },
164
+ {
165
+ "path": "source/agent_retarget/trackc/config_dualarm.py",
166
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/trackc/config_dualarm.py",
167
+ "bytes": 4746,
168
+ "sha256": "bc2264c82ddc59a9c9650887e0a88f665baaf01ed7b09369e356fdbeb2fe4973",
169
+ "reasons": [
170
+ "Agent package or transitive local Python import"
171
+ ]
172
+ },
173
+ {
174
+ "path": "source/agent_retarget/trackc/eval_dualarm.py",
175
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/trackc/eval_dualarm.py",
176
+ "bytes": 32552,
177
+ "sha256": "ae4372e3c839b7d6b914c0dc603a7e497f09080c6165d2fcc25ec05052b921ef",
178
+ "reasons": [
179
+ "Agent package or transitive local Python import"
180
+ ]
181
+ },
182
+ {
183
+ "path": "source/agent_retarget/trackc/ik_dualarm.py",
184
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/trackc/ik_dualarm.py",
185
+ "bytes": 20556,
186
+ "sha256": "5ce18bc2e2209849a39f7283414ee3c4cc2c2fe28c34ef24b7eb128afcb07b42",
187
+ "reasons": [
188
+ "Agent package or transitive local Python import"
189
+ ]
190
+ },
191
+ {
192
+ "path": "source/agent_retarget/trackc/robots.py",
193
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/trackc/robots.py",
194
+ "bytes": 2389,
195
+ "sha256": "094aad47659bb0bf798dca9c52524da5bf92c7bdcedce66683dd834f1b92ba2b",
196
+ "reasons": [
197
+ "Agent package or transitive local Python import"
198
+ ]
199
+ },
200
+ {
201
+ "path": "source/agent_retarget/trackc/source_dualarm.py",
202
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/agent_retarget/trackc/source_dualarm.py",
203
+ "bytes": 6472,
204
+ "sha256": "e1efc16ea0f211ddc721f7b69fda3d55273c65588153c22a8bcc997a6c4aa69c",
205
+ "reasons": [
206
+ "Agent package or transitive local Python import"
207
+ ]
208
+ },
209
+ {
210
+ "path": "source/constrained_waist.py",
211
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/constrained_waist.py",
212
+ "bytes": 9001,
213
+ "sha256": "e1f1bd5558a149cd390901be88dc44f01aac3f3f0c2308c787b341b9bf593a82",
214
+ "reasons": [
215
+ "Agent package or transitive local Python import"
216
+ ]
217
+ },
218
+ {
219
+ "path": "source/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/assets/astribot_s1_asset_for_gripper.xml",
220
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/assets/astribot_s1_asset_for_gripper.xml",
221
+ "bytes": 7114,
222
+ "sha256": "ec55926a0f465bcb34d3fc3098ac3d1dc68152644e41c427a22ac8c5412b7b1f",
223
+ "reasons": [
224
+ "Optional tabletop_scene.build_scene metadata input; existing compiled scenes remain authoritative"
225
+ ]
226
+ },
227
+ {
228
+ "path": "source/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/model_with_effector/astribot_s1_model_with_gripper.xml",
229
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/model_with_effector/astribot_s1_model_with_gripper.xml",
230
+ "bytes": 17202,
231
+ "sha256": "53fd2c3d4f892edd219c2ea3a0ff7639b697f78286a75f4df85cf4e9bf897452",
232
+ "reasons": [
233
+ "Optional tabletop_scene.build_scene metadata input; existing compiled scenes remain authoritative"
234
+ ]
235
+ },
236
+ {
237
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj",
238
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj",
239
+ "bytes": 133,
240
+ "sha256": "5b661cff41ccbad9dc39a9f9eae090b5b79b3334e2db9e14e9b41a97d8a48571",
241
+ "reasons": [
242
+ "Original pointer metadata used by optional builder to select STL fallback"
243
+ ]
244
+ },
245
+ {
246
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj",
247
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj",
248
+ "bytes": 133,
249
+ "sha256": "e22e2ff697d5a7afc13da9679c1979a0c9ed78f70206bafdc973f6d1e835c07d",
250
+ "reasons": [
251
+ "Original pointer metadata used by optional builder to select STL fallback"
252
+ ]
253
+ },
254
+ {
255
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj",
256
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj",
257
+ "bytes": 133,
258
+ "sha256": "8693639b786ece05aa740895fdad645eea8559ddbcf9ec5319ef8485f1018816",
259
+ "reasons": [
260
+ "Original pointer metadata used by optional builder to select STL fallback"
261
+ ]
262
+ },
263
+ {
264
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj",
265
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj",
266
+ "bytes": 133,
267
+ "sha256": "1ecb8dce693d5eaace11dbdcd93734bf1a755cdcc388496110ea1a82128c31f2",
268
+ "reasons": [
269
+ "Original pointer metadata used by optional builder to select STL fallback"
270
+ ]
271
+ },
272
+ {
273
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL",
274
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL",
275
+ "bytes": 393484,
276
+ "sha256": "f5ce4a1ca6343fa73aac37e9ab1581224eae72b13e906592e253f5b9ff71b7e7",
277
+ "reasons": [
278
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
279
+ "mesh referenced by source/scene/s1_tabletop.xml"
280
+ ]
281
+ },
282
+ {
283
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL",
284
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL",
285
+ "bytes": 1168184,
286
+ "sha256": "29a31a52440708e5257005fcaa766d782b6e9895a7d641cf96818db5939b72b5",
287
+ "reasons": [
288
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
289
+ "mesh referenced by source/scene/s1_tabletop.xml"
290
+ ]
291
+ },
292
+ {
293
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL",
294
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL",
295
+ "bytes": 160984,
296
+ "sha256": "b6c9d2fb9539f3865c15f86dae8bfd88e23daab3a8136775a7f5e840519a9ccf",
297
+ "reasons": [
298
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
299
+ "mesh referenced by source/scene/s1_tabletop.xml"
300
+ ]
301
+ },
302
+ {
303
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL",
304
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL",
305
+ "bytes": 1431884,
306
+ "sha256": "a8d48fa6ed9eae1d1b85be42937c9f162fb9039a630943f8fae9b511c1fb711a",
307
+ "reasons": [
308
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
309
+ "mesh referenced by source/scene/s1_tabletop.xml"
310
+ ]
311
+ },
312
+ {
313
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL",
314
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL",
315
+ "bytes": 325584,
316
+ "sha256": "cf0ae423d242e076a628c4181afcd0f42c677d94f5b31582e79997b5620ac043",
317
+ "reasons": [
318
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
319
+ "mesh referenced by source/scene/s1_tabletop.xml"
320
+ ]
321
+ },
322
+ {
323
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL",
324
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL",
325
+ "bytes": 1988484,
326
+ "sha256": "a8301d519a7cac044de0e9b1dda82147382aed2d0b64b5c2d7035461464a21ae",
327
+ "reasons": [
328
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
329
+ "mesh referenced by source/scene/s1_tabletop.xml"
330
+ ]
331
+ },
332
+ {
333
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL",
334
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL",
335
+ "bytes": 626484,
336
+ "sha256": "c2a3a57e115c59006eb37ac8dbc28736e2366a048ea2e1545731910ad4c897f7",
337
+ "reasons": [
338
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
339
+ "mesh referenced by source/scene/s1_tabletop.xml"
340
+ ]
341
+ },
342
+ {
343
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL",
344
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL",
345
+ "bytes": 216184,
346
+ "sha256": "650d570d2e0d2978fc8b870adf2495e8cd24944b6e3a2da3c0fad0a48db2fd8f",
347
+ "reasons": [
348
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
349
+ "mesh referenced by source/scene/s1_tabletop.xml"
350
+ ]
351
+ },
352
+ {
353
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL",
354
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL",
355
+ "bytes": 394684,
356
+ "sha256": "a2d63475f85bf98fc0e7569ee5aeb554ff9dc0d6abe10e85b5e58d17c822946e",
357
+ "reasons": [
358
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
359
+ "mesh referenced by source/scene/s1_tabletop.xml"
360
+ ]
361
+ },
362
+ {
363
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL",
364
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL",
365
+ "bytes": 1170384,
366
+ "sha256": "9074ba1114c0d0fb9f950c678689f5e2536beadf84c8b24a872165c84066583d",
367
+ "reasons": [
368
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
369
+ "mesh referenced by source/scene/s1_tabletop.xml"
370
+ ]
371
+ },
372
+ {
373
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL",
374
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL",
375
+ "bytes": 455284,
376
+ "sha256": "8c2ac3e5c2039b5e3e9127f1e612520b4e76863619e6d4853d5f640e988df401",
377
+ "reasons": [
378
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
379
+ ]
380
+ },
381
+ {
382
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL",
383
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL",
384
+ "bytes": 60584,
385
+ "sha256": "93024aba1a6171b305fefe00618b446457e19f32159460e1e4f463bf5163c4cd",
386
+ "reasons": [
387
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
388
+ ]
389
+ },
390
+ {
391
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL",
392
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL",
393
+ "bytes": 82084,
394
+ "sha256": "4c461d9621422ea16ddfc133ec57b196ad073576425c27e66a096ff879ac71e6",
395
+ "reasons": [
396
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
397
+ ]
398
+ },
399
+ {
400
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL",
401
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL",
402
+ "bytes": 455284,
403
+ "sha256": "10ce463e0fb7bfb632b310f9f47ce746be98383ed2538f118c4fb4ce69971c55",
404
+ "reasons": [
405
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
406
+ ]
407
+ },
408
+ {
409
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL",
410
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL",
411
+ "bytes": 60584,
412
+ "sha256": "88e771f4b181eeebdc83e2e5239dbedcaa6b496b2cc5e5896e1ebc4b9586de2b",
413
+ "reasons": [
414
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
415
+ ]
416
+ },
417
+ {
418
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL",
419
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL",
420
+ "bytes": 82084,
421
+ "sha256": "df220a8f4c534498c769ff83ebfbc2a7920db8223e8f93629abe71d71083b9e9",
422
+ "reasons": [
423
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
424
+ ]
425
+ },
426
+ {
427
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL",
428
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL",
429
+ "bytes": 1086384,
430
+ "sha256": "887e309b8db7285917c26d272a84a3c56b30638e1f4e71e2b23930a9d3244db1",
431
+ "reasons": [
432
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
433
+ ]
434
+ },
435
+ {
436
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL",
437
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL",
438
+ "bytes": 148284,
439
+ "sha256": "82a65945d782623b806f4c59f53bfaef39d14bdd5a84f2e21a25867122493242",
440
+ "reasons": [
441
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
442
+ "mesh referenced by source/scene/s1_tabletop.xml"
443
+ ]
444
+ },
445
+ {
446
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_1.STL",
447
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_1.STL",
448
+ "bytes": 83184,
449
+ "sha256": "9e9c1792b072579214109d18438caf8594820452319c0bd8dca34e1b23276798",
450
+ "reasons": [
451
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
452
+ ]
453
+ },
454
+ {
455
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_2.STL",
456
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_2.STL",
457
+ "bytes": 9665084,
458
+ "sha256": "94170698aea56450148d63cfff41daf899de7eab03d9fe716ff22959cca73306",
459
+ "reasons": [
460
+ "Actual STL fallback for optional source scene builder"
461
+ ]
462
+ },
463
+ {
464
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL",
465
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL",
466
+ "bytes": 9484534,
467
+ "sha256": "88d76fa4c7834bb756298db81907c204cfcb7a918eb4e1380fbc07bc894a2a2c",
468
+ "reasons": [
469
+ "Actual STL fallback for optional source scene builder",
470
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
471
+ "mesh referenced by source/scene/s1_tabletop.xml"
472
+ ]
473
+ },
474
+ {
475
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL",
476
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL",
477
+ "bytes": 2927384,
478
+ "sha256": "a35f95371318c34c2b61b5003ded18d9bd5af7910a42a052974e1ac02f639783",
479
+ "reasons": [
480
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
481
+ "mesh referenced by source/scene/s1_tabletop.xml"
482
+ ]
483
+ },
484
+ {
485
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL",
486
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL",
487
+ "bytes": 8721384,
488
+ "sha256": "30237e4da5116ada620cdeccea5766fc1a3cf152f6f7892ded49f52ae71878a6",
489
+ "reasons": [
490
+ "Actual STL fallback for optional source scene builder",
491
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
492
+ "mesh referenced by source/scene/s1_tabletop.xml"
493
+ ]
494
+ },
495
+ {
496
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL",
497
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL",
498
+ "bytes": 2721384,
499
+ "sha256": "eab30e56b62eb82c185fd601f73d28b3c948975ea427b250a5ce0ff58b2aeaab",
500
+ "reasons": [
501
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
502
+ "mesh referenced by source/scene/s1_tabletop.xml"
503
+ ]
504
+ },
505
+ {
506
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL",
507
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL",
508
+ "bytes": 7149984,
509
+ "sha256": "f0a1e9860d36598beec63562a27f88733216cc7d8db9796274e381b5d90c362c",
510
+ "reasons": [
511
+ "Actual STL fallback for optional source scene builder",
512
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
513
+ "mesh referenced by source/scene/s1_tabletop.xml"
514
+ ]
515
+ },
516
+ {
517
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LF_Link.STL",
518
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LF_Link.STL",
519
+ "bytes": 3733184,
520
+ "sha256": "4bf080c0908855a21de278d5c3d356f9a3e04bc7e967671bf21fdd91b220cc6a",
521
+ "reasons": [
522
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
523
+ ]
524
+ },
525
+ {
526
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LR_Link.STL",
527
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LR_Link.STL",
528
+ "bytes": 3733184,
529
+ "sha256": "4bf080c0908855a21de278d5c3d356f9a3e04bc7e967671bf21fdd91b220cc6a",
530
+ "reasons": [
531
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
532
+ ]
533
+ },
534
+ {
535
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RF_Link.STL",
536
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RF_Link.STL",
537
+ "bytes": 3733184,
538
+ "sha256": "4bf080c0908855a21de278d5c3d356f9a3e04bc7e967671bf21fdd91b220cc6a",
539
+ "reasons": [
540
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
541
+ ]
542
+ },
543
+ {
544
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RR_Link.STL",
545
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RR_Link.STL",
546
+ "bytes": 3733184,
547
+ "sha256": "4bf080c0908855a21de278d5c3d356f9a3e04bc7e967671bf21fdd91b220cc6a",
548
+ "reasons": [
549
+ "mesh referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
550
+ ]
551
+ },
552
+ {
553
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_head_link_2.png",
554
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_head_link_2.png",
555
+ "bytes": 245361,
556
+ "sha256": "9a9b16978f8d857c74383f61af9487e30157e9d1d559c99de6530b2004c93502",
557
+ "reasons": [
558
+ "texture referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
559
+ ]
560
+ },
561
+ {
562
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_base_link.png",
563
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_base_link.png",
564
+ "bytes": 562140,
565
+ "sha256": "5857003d2083766116a8bbe292c37ec0af390ac73ae4355a5df6b179a872d72c",
566
+ "reasons": [
567
+ "texture referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
568
+ ]
569
+ },
570
+ {
571
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_2.png",
572
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_2.png",
573
+ "bytes": 502245,
574
+ "sha256": "5edecacd88d04d38cc28ae2cbbf2dbd172f9996c1575b0762cea33b5795f84f7",
575
+ "reasons": [
576
+ "texture referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
577
+ ]
578
+ },
579
+ {
580
+ "path": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_4.png",
581
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_4.png",
582
+ "bytes": 41498,
583
+ "sha256": "a314b1341074cca6aa64ec00e0b0d23a91431a360535b7f0fdc9729d6bfccd15",
584
+ "reasons": [
585
+ "texture referenced by implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml"
586
+ ]
587
+ },
588
+ {
589
+ "path": "source/models/trackc/astribot_s1_ik/astribot_s1_ik.xml",
590
+ "original_path": "/pfs/yichen/r2r/models/trackc/astribot_s1_ik/astribot_s1_ik.xml",
591
+ "bytes": 7375,
592
+ "sha256": "4bafaec28873be6736f2f3b7e88215190d43c45ed2589b0bef840c3bffee0fbd",
593
+ "reasons": [
594
+ "MJCF model or include"
595
+ ]
596
+ },
597
+ {
598
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/base_link.STL",
599
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/base_link.STL",
600
+ "bytes": 607384,
601
+ "sha256": "fd4a3d6d0266205fe3f725f048645be66592c23564db22e08b0807d5569b2c64",
602
+ "reasons": [
603
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
604
+ ]
605
+ },
606
+ {
607
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/gripper_base.STL",
608
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/gripper_base.STL",
609
+ "bytes": 649484,
610
+ "sha256": "2895bfa6f1eef2d0ad2cb9dfdedd5f6c760ec07388bcde2b4d1e412e1189c9cb",
611
+ "reasons": [
612
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
613
+ ]
614
+ },
615
+ {
616
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link1.STL",
617
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link1.STL",
618
+ "bytes": 447784,
619
+ "sha256": "9ee6e1d67c0241f42a0dbaf5c676d19230375ed078ee1943bb8c4c37ab303d14",
620
+ "reasons": [
621
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
622
+ ]
623
+ },
624
+ {
625
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link2.STL",
626
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link2.STL",
627
+ "bytes": 3658384,
628
+ "sha256": "0d37675b699b643f2e15348de99aed535fac10dc5f09a79b8e4b0acfaf4e0378",
629
+ "reasons": [
630
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
631
+ ]
632
+ },
633
+ {
634
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link3.STL",
635
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link3.STL",
636
+ "bytes": 1845784,
637
+ "sha256": "e8ae51f17c0c7f6d67b753922e2cc269f5e8372a65734f859231639a64fe8fad",
638
+ "reasons": [
639
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
640
+ ]
641
+ },
642
+ {
643
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link4.STL",
644
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link4.STL",
645
+ "bytes": 877984,
646
+ "sha256": "efa33022976218f246f736a6133494b5d0e5486e8b50b52900c42f285ae85558",
647
+ "reasons": [
648
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
649
+ ]
650
+ },
651
+ {
652
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link5.STL",
653
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link5.STL",
654
+ "bytes": 833684,
655
+ "sha256": "a1c69d1c7f6f8c60e2c82331c0f444725200ed4053d3e5ec23aa82cb5db5b29f",
656
+ "reasons": [
657
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
658
+ ]
659
+ },
660
+ {
661
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link6.STL",
662
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link6.STL",
663
+ "bytes": 58884,
664
+ "sha256": "88374973bc3bd9e7389b5853cd6e555af9731c30b658b1ee6f85be34a126cb92",
665
+ "reasons": [
666
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
667
+ ]
668
+ },
669
+ {
670
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link7.STL",
671
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link7.STL",
672
+ "bytes": 104384,
673
+ "sha256": "475a7d8db056524d7659fadf5a2c307d62791047b6214d733dfc7846ed1c613d",
674
+ "reasons": [
675
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
676
+ ]
677
+ },
678
+ {
679
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link8.STL",
680
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/meshes/link8.STL",
681
+ "bytes": 104384,
682
+ "sha256": "3f88d534a85e28a33ef7d2061adacbd1d25214aa9325f9e464aad0f9e4b74606",
683
+ "reasons": [
684
+ "mesh referenced by source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml"
685
+ ]
686
+ },
687
+ {
688
+ "path": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
689
+ "original_path": "/pfs/yichen/r2r/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
690
+ "bytes": 6423,
691
+ "sha256": "3c2e4bf29dd7fc80acfbb056ad711548bdd57f5c26f2e0fcb43f179b8e02f726",
692
+ "reasons": [
693
+ "MJCF model or include"
694
+ ]
695
+ },
696
+ {
697
+ "path": "source/scene/s1_tabletop.json",
698
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/scene/s1_tabletop.json",
699
+ "bytes": 3709,
700
+ "sha256": "cfc5b762890cbca7654212eb78428b3a38bc4a0249fc60ccce49bef00f8f8f31",
701
+ "reasons": [
702
+ "Scene metadata and provenance"
703
+ ]
704
+ },
705
+ {
706
+ "path": "source/scene/s1_tabletop.xml",
707
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/scene/s1_tabletop.xml",
708
+ "bytes": 14508,
709
+ "sha256": "b06105a8999dd7564f73b2811d7ef6708488a45ae4e575fd4ed755702c26d035",
710
+ "reasons": [
711
+ "MJCF model or include"
712
+ ]
713
+ },
714
+ {
715
+ "path": "source/scene/task_frame_contract.json",
716
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/scene/task_frame_contract.json",
717
+ "bytes": 4892,
718
+ "sha256": "7d4b2933aa4f4e97c9b7a2272fa36136c0fd4989dbe44e6b76d3dc062bd14e33",
719
+ "reasons": [
720
+ "Scene metadata and provenance"
721
+ ]
722
+ },
723
+ {
724
+ "path": "source/scene_binding.py",
725
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/scene_binding.py",
726
+ "bytes": 2230,
727
+ "sha256": "0595b20e102f2d0a2fe2fdcf86156249397e1e11ccdae9d687231f31df0c311b",
728
+ "reasons": [
729
+ "Agent package or transitive local Python import"
730
+ ]
731
+ },
732
+ {
733
+ "path": "source/table_clearance_ik.py",
734
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/table_clearance_ik.py",
735
+ "bytes": 5141,
736
+ "sha256": "d392b7d809aa12d497bc2acc2469de5111b771ce3a8384ff0a2c23da0182dc18",
737
+ "reasons": [
738
+ "Agent package or transitive local Python import"
739
+ ]
740
+ },
741
+ {
742
+ "path": "source/tabletop_scene.py",
743
+ "original_path": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/tabletop_scene.py",
744
+ "bytes": 6414,
745
+ "sha256": "3f389aa08c1f7b166ae7ca359164d52012fb9bb75581e770b8643202b41e982f",
746
+ "reasons": [
747
+ "Agent package or transitive local Python import"
748
+ ]
749
+ }
750
+ ],
751
+ "xml_dependencies": [
752
+ {
753
+ "xml": "source/scene/s1_tabletop.xml",
754
+ "tag": "mesh",
755
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL",
756
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL"
757
+ },
758
+ {
759
+ "xml": "source/scene/s1_tabletop.xml",
760
+ "tag": "mesh",
761
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL",
762
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL"
763
+ },
764
+ {
765
+ "xml": "source/scene/s1_tabletop.xml",
766
+ "tag": "mesh",
767
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL",
768
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL"
769
+ },
770
+ {
771
+ "xml": "source/scene/s1_tabletop.xml",
772
+ "tag": "mesh",
773
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL",
774
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL"
775
+ },
776
+ {
777
+ "xml": "source/scene/s1_tabletop.xml",
778
+ "tag": "mesh",
779
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL",
780
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL"
781
+ },
782
+ {
783
+ "xml": "source/scene/s1_tabletop.xml",
784
+ "tag": "mesh",
785
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL",
786
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL"
787
+ },
788
+ {
789
+ "xml": "source/scene/s1_tabletop.xml",
790
+ "tag": "mesh",
791
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL",
792
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL"
793
+ },
794
+ {
795
+ "xml": "source/scene/s1_tabletop.xml",
796
+ "tag": "mesh",
797
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL",
798
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL"
799
+ },
800
+ {
801
+ "xml": "source/scene/s1_tabletop.xml",
802
+ "tag": "mesh",
803
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL",
804
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL"
805
+ },
806
+ {
807
+ "xml": "source/scene/s1_tabletop.xml",
808
+ "tag": "mesh",
809
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL",
810
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL"
811
+ },
812
+ {
813
+ "xml": "source/scene/s1_tabletop.xml",
814
+ "tag": "mesh",
815
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL",
816
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL"
817
+ },
818
+ {
819
+ "xml": "source/scene/s1_tabletop.xml",
820
+ "tag": "mesh",
821
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL",
822
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL"
823
+ },
824
+ {
825
+ "xml": "source/scene/s1_tabletop.xml",
826
+ "tag": "mesh",
827
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL",
828
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL"
829
+ },
830
+ {
831
+ "xml": "source/scene/s1_tabletop.xml",
832
+ "tag": "mesh",
833
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL",
834
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL"
835
+ },
836
+ {
837
+ "xml": "source/scene/s1_tabletop.xml",
838
+ "tag": "mesh",
839
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL",
840
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL"
841
+ },
842
+ {
843
+ "xml": "source/scene/s1_tabletop.xml",
844
+ "tag": "mesh",
845
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL",
846
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL"
847
+ },
848
+ {
849
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
850
+ "tag": "mesh",
851
+ "original_reference": "../meshes/base_link.STL",
852
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/base_link.STL"
853
+ },
854
+ {
855
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
856
+ "tag": "mesh",
857
+ "original_reference": "../meshes/link1.STL",
858
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link1.STL"
859
+ },
860
+ {
861
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
862
+ "tag": "mesh",
863
+ "original_reference": "../meshes/link2.STL",
864
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link2.STL"
865
+ },
866
+ {
867
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
868
+ "tag": "mesh",
869
+ "original_reference": "../meshes/link3.STL",
870
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link3.STL"
871
+ },
872
+ {
873
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
874
+ "tag": "mesh",
875
+ "original_reference": "../meshes/link4.STL",
876
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link4.STL"
877
+ },
878
+ {
879
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
880
+ "tag": "mesh",
881
+ "original_reference": "../meshes/link5.STL",
882
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link5.STL"
883
+ },
884
+ {
885
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
886
+ "tag": "mesh",
887
+ "original_reference": "../meshes/link6.STL",
888
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link6.STL"
889
+ },
890
+ {
891
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
892
+ "tag": "mesh",
893
+ "original_reference": "../meshes/gripper_base.STL",
894
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/gripper_base.STL"
895
+ },
896
+ {
897
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
898
+ "tag": "mesh",
899
+ "original_reference": "../meshes/link7.STL",
900
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link7.STL"
901
+ },
902
+ {
903
+ "xml": "source/models/trackc/piper_isaac_sim/piper_description/mujoco_model/piper_description.xml",
904
+ "tag": "mesh",
905
+ "original_reference": "../meshes/link8.STL",
906
+ "packaged_target": "source/models/trackc/piper_isaac_sim/piper_description/meshes/link8.STL"
907
+ },
908
+ {
909
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
910
+ "tag": "texture",
911
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_base_link.png",
912
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_base_link.png"
913
+ },
914
+ {
915
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
916
+ "tag": "texture",
917
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_2.png",
918
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_2.png"
919
+ },
920
+ {
921
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
922
+ "tag": "texture",
923
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_4.png",
924
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_4.png"
925
+ },
926
+ {
927
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
928
+ "tag": "texture",
929
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_head_link_2.png",
930
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_head_link_2.png"
931
+ },
932
+ {
933
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
934
+ "tag": "mesh",
935
+ "original_reference": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj",
936
+ "packaged_target": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj"
937
+ },
938
+ {
939
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
940
+ "tag": "mesh",
941
+ "original_reference": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj",
942
+ "packaged_target": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj"
943
+ },
944
+ {
945
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
946
+ "tag": "mesh",
947
+ "original_reference": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj",
948
+ "packaged_target": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj"
949
+ },
950
+ {
951
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
952
+ "tag": "mesh",
953
+ "original_reference": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj",
954
+ "packaged_target": "implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj"
955
+ },
956
+ {
957
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
958
+ "tag": "mesh",
959
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RF_Link.STL",
960
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RF_Link.STL"
961
+ },
962
+ {
963
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
964
+ "tag": "mesh",
965
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LF_Link.STL",
966
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LF_Link.STL"
967
+ },
968
+ {
969
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
970
+ "tag": "mesh",
971
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RR_Link.STL",
972
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RR_Link.STL"
973
+ },
974
+ {
975
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
976
+ "tag": "mesh",
977
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LR_Link.STL",
978
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LR_Link.STL"
979
+ },
980
+ {
981
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
982
+ "tag": "mesh",
983
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL",
984
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL"
985
+ },
986
+ {
987
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
988
+ "tag": "mesh",
989
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL",
990
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL"
991
+ },
992
+ {
993
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
994
+ "tag": "mesh",
995
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL",
996
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL"
997
+ },
998
+ {
999
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1000
+ "tag": "mesh",
1001
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_1.STL",
1002
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_1.STL"
1003
+ },
1004
+ {
1005
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1006
+ "tag": "mesh",
1007
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL",
1008
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL"
1009
+ },
1010
+ {
1011
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1012
+ "tag": "mesh",
1013
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL",
1014
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL"
1015
+ },
1016
+ {
1017
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1018
+ "tag": "mesh",
1019
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL",
1020
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL"
1021
+ },
1022
+ {
1023
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1024
+ "tag": "mesh",
1025
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL",
1026
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL"
1027
+ },
1028
+ {
1029
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1030
+ "tag": "mesh",
1031
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL",
1032
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL"
1033
+ },
1034
+ {
1035
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1036
+ "tag": "mesh",
1037
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL",
1038
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL"
1039
+ },
1040
+ {
1041
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1042
+ "tag": "mesh",
1043
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL",
1044
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL"
1045
+ },
1046
+ {
1047
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1048
+ "tag": "mesh",
1049
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL",
1050
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL"
1051
+ },
1052
+ {
1053
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1054
+ "tag": "mesh",
1055
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL",
1056
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL"
1057
+ },
1058
+ {
1059
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1060
+ "tag": "mesh",
1061
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL",
1062
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL"
1063
+ },
1064
+ {
1065
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1066
+ "tag": "mesh",
1067
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL",
1068
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL"
1069
+ },
1070
+ {
1071
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1072
+ "tag": "mesh",
1073
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL",
1074
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL"
1075
+ },
1076
+ {
1077
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1078
+ "tag": "mesh",
1079
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL",
1080
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL"
1081
+ },
1082
+ {
1083
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1084
+ "tag": "mesh",
1085
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL",
1086
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL"
1087
+ },
1088
+ {
1089
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1090
+ "tag": "mesh",
1091
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL",
1092
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL"
1093
+ },
1094
+ {
1095
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1096
+ "tag": "mesh",
1097
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL",
1098
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL"
1099
+ },
1100
+ {
1101
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1102
+ "tag": "mesh",
1103
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL",
1104
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL"
1105
+ },
1106
+ {
1107
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1108
+ "tag": "mesh",
1109
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL",
1110
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL"
1111
+ },
1112
+ {
1113
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1114
+ "tag": "mesh",
1115
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL",
1116
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL"
1117
+ },
1118
+ {
1119
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1120
+ "tag": "mesh",
1121
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL",
1122
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL"
1123
+ },
1124
+ {
1125
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1126
+ "tag": "mesh",
1127
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL",
1128
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL"
1129
+ },
1130
+ {
1131
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1132
+ "tag": "mesh",
1133
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL",
1134
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL"
1135
+ },
1136
+ {
1137
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1138
+ "tag": "mesh",
1139
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL",
1140
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL"
1141
+ },
1142
+ {
1143
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1144
+ "tag": "mesh",
1145
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL",
1146
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL"
1147
+ },
1148
+ {
1149
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1150
+ "tag": "mesh",
1151
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL",
1152
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL"
1153
+ },
1154
+ {
1155
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1156
+ "tag": "mesh",
1157
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL",
1158
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL"
1159
+ },
1160
+ {
1161
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1162
+ "tag": "mesh",
1163
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL",
1164
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL"
1165
+ },
1166
+ {
1167
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1168
+ "tag": "mesh",
1169
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL",
1170
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL"
1171
+ },
1172
+ {
1173
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1174
+ "tag": "mesh",
1175
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL",
1176
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL"
1177
+ },
1178
+ {
1179
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1180
+ "tag": "mesh",
1181
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL",
1182
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL"
1183
+ },
1184
+ {
1185
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1186
+ "tag": "mesh",
1187
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL",
1188
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL"
1189
+ },
1190
+ {
1191
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1192
+ "tag": "mesh",
1193
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL",
1194
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL"
1195
+ },
1196
+ {
1197
+ "xml": "implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
1198
+ "tag": "mesh",
1199
+ "original_reference": "/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL",
1200
+ "packaged_target": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL"
1201
+ }
1202
+ ],
1203
+ "optional_builder_pointer_metadata": [
1204
+ {
1205
+ "pointer": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj",
1206
+ "actual_stl_fallback": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL"
1207
+ },
1208
+ {
1209
+ "pointer": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj",
1210
+ "actual_stl_fallback": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL"
1211
+ },
1212
+ {
1213
+ "pointer": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj",
1214
+ "actual_stl_fallback": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL"
1215
+ },
1216
+ {
1217
+ "pointer": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj",
1218
+ "actual_stl_fallback": "source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_2.STL"
1219
+ }
1220
+ ],
1221
+ "external_python_import_roots": [
1222
+ "h5py",
1223
+ "mimicgen",
1224
+ "mujoco",
1225
+ "numpy",
1226
+ "pyarrow",
1227
+ "robosuite"
1228
+ ],
1229
+ "file_count": 80,
1230
+ "total_original_bytes": 217568930
1231
+ }
1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a6dc2fa33de59fd0502c6482eaabc48d846c1ecc863d74f1ec33f83fcd96360
3
+ size 38496139
1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd7b42ad341963e0aaa7e898411078173ba2613a5eff60140232c7d04d0b36da
3
+ size 40001354
1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3f639a37cc63757da571bbeeedd130c98afd798af6ba33f1a7960884549b1e3
3
+ size 33347575
1500case/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:955db3acb335e179d35a0ad76f537109f6d2ab0b74fd6d9d5d0db7ed7ef14a32
3
+ size 28906301
1500case/implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml ADDED
@@ -0,0 +1,457 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <mujoco model="astribot_s1">
2
+ <compiler angle="radian" />
3
+ <option impratio="100" integrator="implicit" timestep=".002" viscosity="0.1" gravity="0 0 -9.81" solver="Newton" tolerance="1e-12" iterations="100" />
4
+ <asset>
5
+ <texture type="2d" name="groundplane" builtin="checker" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3" width="500" height="500" />
6
+ <material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2" />
7
+ </asset>
8
+ <default class="main">
9
+ <site size="0.005 0 0" rgba="0.4 0.9 0.4 1" />
10
+ <joint limited="true" axis="0 0 1" />
11
+ <general ctrllimited="true" forcelimited="true" ctrlrange="-6.2831 6.2831" dyntype="none" biastype="affine" />
12
+ <default class="visual">
13
+ <geom type="mesh" contype="0" conaffinity="0" group="2" />
14
+ </default>
15
+ <default class="collision">
16
+ <geom type="capsule" group="3" />
17
+ <default class="eef_collision">
18
+ <geom type="cylinder" />
19
+ </default>
20
+ </default>
21
+ <default class="Widget">
22
+ <geom contype="0" conaffinity="0" group="2" rgba="1 1 1 1" />
23
+ </default>
24
+ <default class="size3">
25
+ <joint armature="0.1" damping="10" />
26
+ <general forcerange="-265 265" />
27
+ </default>
28
+ <default class="size2">
29
+ <joint armature="0.1" damping="10" />
30
+ <general forcerange="-142 142" />
31
+ </default>
32
+ <default class="size1">
33
+ <joint armature="0.1" damping="10" />
34
+ <general forcerange="-20 20" />
35
+ </default>
36
+ <default class="free">
37
+ <joint type="free" limited="false" armature="0" damping="0" />
38
+ </default>
39
+ <default class="torso_size1">
40
+ <joint limited="true" axis="0 0 1" armature="0.1" damping="10" />
41
+ <general ctrllimited="true" forcelimited="true" forcerange="-465 465" ctrlrange="-3.14 3.15" dyntype="none" biastype="affine" />
42
+ </default>
43
+ <default class="chassis_size1">
44
+ <joint limited="false" axis="0 0 1" armature="0.0" damping="10" />
45
+ <general ctrllimited="false" forcelimited="false" forcerange="-5000 5000" ctrlrange="-5000 5000" dyntype="none" biastype="affine" />
46
+ </default>
47
+ <default class="gripper_size1">
48
+ <joint limited="true" axis="0 0 1" armature="0.02" damping="0.3" />
49
+ <general ctrllimited="true" forcelimited="true" ctrlrange="0 1.14 " biastype="affine" forcerange="-10 10" gainprm="100" biasprm="0 -100 -4" />
50
+ </default>
51
+ </default>
52
+ <asset>
53
+ <texture name="T_torso_base_link" type="2d" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_base_link.png" />
54
+ <texture name="T_torso_link_2" type="2d" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_2.png" />
55
+ <texture name="T_torso_link_4" type="2d" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_4.png" />
56
+ <texture name="T_head_link_2" type="2d" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/textures/astribot_head_link_2.png" />
57
+ <material name="M_torso_base_link" texture="T_torso_base_link" specular="0.4" shininess="0.3" />
58
+ <material name="M_torso_link_2" texture="T_torso_link_2" specular="0.4" shininess="0.3" />
59
+ <material name="M_torso_link_4" texture="T_torso_link_4" specular="0.5" shininess="0.3" />
60
+ <material name="M_head_link_2" texture="T_head_link_2" specular="0.3" shininess="0.2" />
61
+ <material name="M_white_shell" rgba="0.973 0.976 0.984 1" specular="0.5" shininess="0.3" />
62
+ <material name="M_black_neck" rgba="0.098 0.098 0.11 1" specular="0.1" shininess="0.05" />
63
+ <material name="M_dark_mechanism" rgba="0.216 0.216 0.235 1" specular="0.3" shininess="0.2" />
64
+ <material name="M_rubber_wheel" rgba="0.149 0.149 0.157 1" specular="0.05" shininess="0.02" />
65
+ <mesh name="astribot_torso_base_link" file="/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj" />
66
+ <mesh name="astribot_torso_link_2" file="/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj" />
67
+ <mesh name="astribot_torso_link_4" file="/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj" />
68
+ <mesh name="astribot_head_link_2" file="/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/recovered_assets/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj" />
69
+ <mesh name="wheel_RF_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RF_Link.STL" />
70
+ <mesh name="wheel_LF_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LF_Link.STL" />
71
+ <mesh name="wheel_RR_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RR_Link.STL" />
72
+ <mesh name="wheel_LR_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LR_Link.STL" />
73
+ <mesh name="astribot_torso_link_1" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL" />
74
+ <mesh name="astribot_torso_link_3" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL" />
75
+ <mesh name="astribot_head_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL" />
76
+ <mesh name="astribot_head_link_1" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_1.STL" />
77
+ <mesh name="astribot_arm_left_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL" />
78
+ <mesh name="astribot_arm_right_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL" />
79
+ <mesh name="astribot_arm_link_1" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL" />
80
+ <mesh name="astribot_arm_left_link_2" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL" />
81
+ <mesh name="astribot_arm_link_3" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL" />
82
+ <mesh name="astribot_arm_link_4" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL" />
83
+ <mesh name="astribot_arm_link_5" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL" />
84
+ <mesh name="astribot_arm_link_6" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL" />
85
+ <mesh name="astribot_arm_link_7" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL" />
86
+ <mesh name="astribot_arm_right_link_2" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL" />
87
+ <mesh name="gripper_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL" />
88
+ <mesh name="gripper_L1_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL" />
89
+ <mesh name="gripper_L11_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL" />
90
+ <mesh name="gripper_L2_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL" />
91
+ <mesh name="gripper_R1_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL" />
92
+ <mesh name="gripper_R11_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL" />
93
+ <mesh name="gripper_R2_Link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL" />
94
+ </asset>
95
+ <worldbody>
96
+ <light pos="0 0 2.0" dir="0 0 -1" directional="true" />
97
+ <geom name="floor" size="0 0 0.05" type="plane" material="groundplane" contype="2" conaffinity="13" />
98
+ <camera name="human" pos="2.107 2.011 1.6" xyaxes="-0.001 1.000 0.000 -0.277 -0.000 0.961" />
99
+ <body name="chassis_base" pos="-0.0 0.0 0.097" euler="0 0 -1.57">
100
+ <inertial pos="-0.0076187 -0.0020711 0.013725" quat="0.019455 0.708067 -0.0183173 0.70564" mass="6.7123" diaginertia="0.148701 0.08243 0.079229" />
101
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_torso_base_link" mesh="astribot_torso_base_link" />
102
+ <site name="astribot_chassis_imu_site" pos="0 0 0" />
103
+ <body name="wheel_RF_Link" pos="0.216347 -0.216347 -0.015" quat="0.270599 0.65328 -0.2706 0.653282" gravcomp="0">
104
+ <inertial pos="2.7624e-07 -1.7583e-07 0.014539" quat="0.270598 0.653281 -0.270598 0.653281" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876" />
105
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_RF_Link" />
106
+ </body>
107
+ <body name="wheel_LF_Link" pos="0.216347 0.216347 -0.015" quat="0.270599 -0.65328 -0.2706 -0.653282" gravcomp="0">
108
+ <inertial pos="2.7617e-07 -1.7589e-07 0.014539" quat="0.270598 0.653281 -0.270598 0.653281" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876" />
109
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_LF_Link" />
110
+ </body>
111
+ <body name="wheel_RR_Link" pos="-0.216347 -0.211347 -0.015" quat="0.65328 0.270597 -0.653283 0.270598" gravcomp="0">
112
+ <inertial pos="-2.7619e-07 1.7583e-07 0.014539" quat="0.270598 0.653281 -0.270598 0.653281" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876" />
113
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_RR_Link" />
114
+ </body>
115
+ <body name="wheel_LR_Link" pos="-0.216347 0.211347 -0.015" quat="0.65328 -0.270597 -0.653283 -0.270598" gravcomp="0">
116
+ <inertial pos="0.0019998 -0.0070713 0.014539" quat="0.653281 0.270598 -0.653281 0.270598" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876" />
117
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_LR_Link" />
118
+ </body>
119
+ <body name="astribot_torso_link_1" pos="0 0 0.12" quat="0.499998 -0.5 0.5 0.500002" gravcomp="0">
120
+ <inertial pos="-0.078229 0.033333 0" quat="0.70346 0.70346 0.0717209 0.0717209" mass="9.2571" diaginertia="0.397539 0.374664 0.137718" />
121
+ <joint name="astribot_torso_joint_1" pos="0 0 0" axis="0 0 1" range="0.0 1.5" />
122
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_torso_link_1" />
123
+ <body name="astribot_torso_link_2" pos="-0.38 0 0" gravcomp="0">
124
+ <inertial pos="-0.23187 0.033333 0" quat="0.0851505 0.715372 -0.0840248 0.688427" mass="5.6183" diaginertia="0.0175257 0.0129591 0.00795872" />
125
+ <joint name="astribot_torso_joint_2" pos="0 0 0" axis="0 0 1" range="-2.35 0.0" />
126
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_torso_link_2" mesh="astribot_torso_link_2" />
127
+ <body name="astribot_torso_link_3" pos="-0.39 0 0" gravcomp="0" quat="0.98962549373999498 0 0 0.14367109013253554">
128
+ <inertial pos="0.133333 -0.086872 0" quat="0.00834705 0.708024 0.00970003 0.706073" mass="0.49013" diaginertia="0.000380401 0.000365211 0.000222118" />
129
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_torso_link_3" />
130
+ <body name="astribot_torso_link_4" pos="0 0 0" quat="0.49969040546151655 0.50030740665236773 -0.49969440546076005 -0.50030740419236785" gravcomp="0">
131
+ <inertial pos="0.00476227 -4.56967e-05 0.242913" quat="0.999954 7.7949e-05 0.00906445 -0.00297427" mass="11.7741" diaginertia="0.0165787 0.0149043 0.0110611" />
132
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_torso_link_4" mesh="astribot_torso_link_4" />
133
+ <geom pos="0 0 0.46765" type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_black_neck" mesh="astribot_head_base_link" />
134
+ <geom pos="0 0.06449 0.36823" quat="0.579228 -0.40558 -0.40558 -0.579228" type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_left_base_link" />
135
+ <geom pos="0 -0.06449 0.36823" quat="0.579228 0.40558 -0.40558 0.579228" type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_right_base_link" />
136
+ <body name="astribot_head_link_1" pos="0 0 0.46765" gravcomp="0">
137
+ <inertial pos="0.0744479 0.0340434 -0.148896" quat="0.710346 -0.0335656 0.0294335 0.702436" mass="0.18685" diaginertia="4.79716e-05 4.56699e-05 3.77084e-05" />
138
+ <joint name="astribot_head_joint_1" pos="0 0 0" axis="0 0 1" range="-1.6 1.6" />
139
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_dark_mechanism" mesh="astribot_head_link_1" />
140
+ <body name="astribot_head_link_2" pos="0 0 0" quat="0.707105 -0.707108 0 0" gravcomp="0">
141
+ <camera name="head_rgbd" pos="0.0603 -0.2139 -0.0277" quat="0.7025 -0.0295 -0.7100 -0.0135" fovy="51.4175" />
142
+ <body name="astribot_head_camera_base_link" pos="0.09 0.0 0.08" quat="0.0000 0.0000 -1.0 0.0" gravcomp="0">
143
+ </body>
144
+ <inertial pos="0.00705824 -0.144726 -0.00061724" quat="0.696314 0.714797 -0.0643815 -0.00814535" mass="0.970124" diaginertia="0.00559994 0.00544762 0.00147305" />
145
+ <joint name="astribot_head_joint_2" pos="0 0 0" axis="0 0 1" range="-1.0 1.0" />
146
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_head_link_2" mesh="astribot_head_link_2" />
147
+ </body>
148
+ </body>
149
+ <body name="astribot_arm_left_link_1" pos="-2.29129e-09 0.150002 0.399354" quat="0.579228 -0.40558 -0.40558 -0.579228" gravcomp="0">
150
+ <inertial pos="-0.0545455 -0.0306519 -0.0291245" quat="0.799744 0.00150164 -0.00673322 0.600302" mass="0.659304" diaginertia="0.000653094 0.000647485 0.000501341" />
151
+ <joint name="astribot_arm_left_joint_1" pos="0 0 0" axis="0 0 1" range="-3.087 1.517" />
152
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_1" />
153
+ <body name="astribot_arm_left_link_2" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
154
+ <inertial pos="-0.0727273 0.00957826 0.0542806" quat="0.979046 0.195867 -0.0151095 -0.0536387" mass="1.60392" diaginertia="0.00361844 0.00305818 0.00149762" />
155
+ <joint name="astribot_arm_left_joint_2" pos="0 0 0" axis="0 0 1" range="-1.517 0.55" />
156
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_left_link_2" />
157
+ <body name="astribot_arm_left_link_3" pos="0 0.05 0" quat="0.499998 0.5 -0.500002 -0.5" gravcomp="0">
158
+ <inertial pos="-0.0054798 0.00064517 0.0858537" quat="0.742648 -0.0317889 -0.0338067 0.668072" mass="2.21205" diaginertia="0.0178489 0.0176537 0.00205017" />
159
+ <joint name="astribot_arm_left_joint_3" pos="0 0 0" axis="0 0 1" range="-3.08 1.517" />
160
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_3" />
161
+ <body name="astribot_arm_left_link_4" pos="0.03 0 0.309" quat="0.707105 -0.707108 0 0" gravcomp="0">
162
+ <inertial pos="0.0157758 -0.111111 0.0151356" quat="0.516854 0.517425 -0.45414 0.508813" mass="0.329291" diaginertia="0.000501311 0.000477171 0.000367278" />
163
+ <joint name="astribot_arm_left_joint_4" pos="0 0 0" axis="0 0 1" range="0.0 2.55" />
164
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_4" />
165
+ <body name="astribot_arm_left_link_5" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
166
+ <inertial pos="-0.00984351 0.00748991 0.136847" quat="0.999961 -0.00684676 0.000823261 0.00549176" mass="1.11677" diaginertia="0.00454095 0.00438988 0.000793736" />
167
+ <joint name="astribot_arm_left_joint_5" pos="0 0 0" axis="0 0 1" range="-2.37 2.37" />
168
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_5" />
169
+ <body name="astribot_arm_left_link_6" pos="0 0 0.277" quat="0.707105 -0.707108 0 0" gravcomp="0">
170
+ <inertial pos="0.010363 -0.00408524 -0.0404713" quat="0.99999 0.00126801 -0.0015825 0.00407582" mass="0.202188" diaginertia="0.000164741 0.00015608 8.55488e-05" />
171
+ <joint name="astribot_arm_left_joint_6" pos="0 0 0" axis="0 0 1" range="-0.78 0.78" />
172
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_6" />
173
+ <body name="astribot_arm_left_link_7" pos="0 0 0" quat="0.707105 0 0.707108 0" gravcomp="0">
174
+ <inertial pos="0.00185812 -0.0895091 0.00257872" quat="0.711438 0.701239 0.0218365 -0.0405392" mass="1.45143" diaginertia="0.00202892 0.00199405 0.000442623" />
175
+ <joint name="astribot_arm_left_joint_7" pos="0 0 0" axis="0 0 1" range="-1.55 1.55" />
176
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_7" />
177
+ <site name="arm_left_tool" pos="0 -0.15 0" />
178
+ <body name="arm_left_tool_cam" pos="0 -0.15 0">
179
+ <camera name="left_wrist_rgbd" pos="0.011420996159648984 0.058882000224149605 0.044260118849329295" quat="0.703108425353722 -0.7109134990656752 -0.009037420129074155 -0.012604129490710232" fovy="57" />
180
+ </body>
181
+ <site name="force_torque_sensor_left" />
182
+ <body name="astribot_arm_left_tool_link" pos="0 -0.048 0" euler="1.5707963 0 0" gravcomp="0">
183
+ <body name="astribot_gripper_left_base" pos="0.0 0.0 .0">
184
+ <geom type="mesh" contype="0" conaffinity="0" rgba="0.973 0.976 0.984 1" mesh="gripper_base_link" />
185
+ <geom name="astribot_gripper_right_left_geom" type="box" size=" 0.02 0.0135 0.01" pos="0.00 0 0.07" rgba="0.5 0.2 0.2 1" friction="0.7" solimp="0.95 0.99 0.001" solref="0.004 1" priority="1" contype="8" conaffinity="14" />
186
+ <inertial pos="0.0 0.0 0.04" quat="0.0 0.0 -0.0 1.0" mass="0.4" diaginertia="0.001 0.001 0.001" />
187
+ <body name="astribot_gripper_left_Link_L1" pos="0.0145 0 0.0510999999999999">
188
+ <joint class="gripper_size1" name="astribot_gripper_left_joint_L1" pos="0 0 0" axis="0 -1 0" range="0 0.93 " damping="5" />
189
+ <geom name="astribot_gripper_left_geom_L1" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_L1_Link" />
190
+ <inertial pos="0.0238640864176058 9.47687900128855E-11 0.0229075443586898" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
191
+ <body name="astribot_gripper_left_Link_L11" pos="0.0412500000000001 0 0.036379080527138" euler="0 0 0">
192
+ <joint class="gripper_size1" name="astribot_gripper_left_joint_L11" pos="0 0 0" axis="0 1 0" range="-0 1.00" />
193
+ <inertial pos="0.00580213800883545 -8.25165165516798E-05 0.0308700387872592" quat="0.0 0.0 -0.0 1.0" mass="0.067" diaginertia="0.001 0.001 0.001" />
194
+ <geom name="astribot_gripper_left_geom_L11" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_L11_Link" />
195
+ <geom name="astribot_gripper_left_geom_L112" type="box" size=" 0.005 0.0135 0.03" pos="-0.003 0 0.036" rgba="0.5 0.2 0.2 1" friction="1.7" solimp="0.95 0.99 0.001" solref="0.004 1" priority="1" contype="8" conaffinity="14" />
196
+ </body>
197
+ </body>
198
+ <body name="astribot_gripper_left_Link_L2" pos="0.0325 0 0.0510999999999999">
199
+ <joint class="gripper_size1" name="astribot_gripper_left_joint_L2" pos="0 0 0" axis="0 1 0" range="-1.00 0" />
200
+ <geom name="astribot_gripper_left_geom_L2" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_L2_Link" />
201
+ <inertial pos="0.0140847588556024 1.38103934263007E-10 0.0136360450679544" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
202
+ </body>
203
+ <body name="astribot_gripper_left_Link_R1" pos="-0.0144999999999999 0 0.0510999999999939">
204
+ <joint class="gripper_size1" name="astribot_gripper_left_joint_R1" pos="0 0 0" axis="0 1 0" range="0 0.93 " damping="5" />
205
+ <geom name="astribot_gripper_left_geom_R1" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_R1_Link" />
206
+ <inertial pos="-0.0238640864176057 -9.47685797632123E-11 0.0229075443586915" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
207
+ <body name="astribot_gripper_left_Link_R11" pos="-0.0412499999999999 0 0.0363790805271382" euler="0 0.03 0">
208
+ <joint class="gripper_size1" name="astribot_gripper_left_joint_R11" pos="0 0 0" axis="0 1 0" range="-1.00 0" />
209
+ <inertial pos="-0.00580213800888738 8.25165165509265E-05 0.030870038787216" quat="0.0 0.0 -0.0 1.0" mass="0.067" diaginertia="0.001 0.001 0.001" />
210
+ <geom name="astribot_gripper_left_geom_R11" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_R11_Link" />
211
+ <geom name="astribot_gripper_left_geom_R112" type="box" size=" 0.005 0.0135 0.03" pos="0.003 0 0.036" rgba="0.5 0.2 0.2 1" friction="0.7" solimp="0.95 0.99 0.001" solref="0.004 1" priority="1" contype="8" conaffinity="14" />
212
+ </body>
213
+ </body>
214
+ <body name="astribot_gripper_left_Link_R2" pos="-0.0325 0 0.0510999999999999">
215
+ <joint class="gripper_size1" name="astribot_gripper_left_joint_R2" pos="0 0 0" axis="0 1 0" range="-0 1.00" />
216
+ <inertial pos="-0.0140847588556023 -1.38096956128494E-10 0.0136360450679544" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
217
+ <geom name="astribot_gripper_left_geom_R2" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_R2_Link" />
218
+ </body>
219
+ </body>
220
+ </body>
221
+ <geom type="mesh" mesh="physical_astribot_arm_link_7" name="physical_robot_astribot_arm_left_link_7_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
222
+ </body>
223
+ <geom type="mesh" mesh="physical_astribot_arm_link_6" name="physical_robot_astribot_arm_left_link_6_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
224
+ </body>
225
+ <geom type="mesh" mesh="physical_astribot_arm_link_5" name="physical_robot_astribot_arm_left_link_5_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
226
+ </body>
227
+ <geom type="mesh" mesh="physical_astribot_arm_link_4" name="physical_robot_astribot_arm_left_link_4_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
228
+ </body>
229
+ <geom type="mesh" mesh="physical_astribot_arm_link_3" name="physical_robot_astribot_arm_left_link_3_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
230
+ </body>
231
+ <geom type="mesh" mesh="physical_astribot_arm_left_link_2" name="physical_robot_astribot_arm_left_link_2_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
232
+ </body>
233
+ <geom type="mesh" mesh="physical_astribot_arm_link_1" name="physical_robot_astribot_arm_left_link_1_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
234
+ </body>
235
+ <body name="astribot_arm_right_link_1" pos="-2.29129e-09 -0.150002 0.399354" quat="0.579228 0.40558 -0.40558 0.579228" gravcomp="0">
236
+ <inertial pos="-0.0545455 -0.0306519 -0.0291245" quat="0.799744 0.00150164 -0.00673322 0.600302" mass="0.659304" diaginertia="0.000653094 0.000647485 0.000501341" />
237
+ <joint name="astribot_arm_right_joint_1" pos="0 0 0" axis="0 0 1" range="-1.517 3.087" />
238
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_1" />
239
+ <body name="astribot_arm_right_link_2" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
240
+ <inertial pos="-0.0727273 0.00957826 -0.0542806" quat="0.977722 -0.198255 0.000268699 -0.0689497" mass="1.60392" diaginertia="0.003953 0.0034509 0.001474" />
241
+ <joint name="astribot_arm_right_joint_2" pos="0 0 0" axis="0 0 1" range="-1.517 0.55" />
242
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_right_link_2" />
243
+ <body name="astribot_arm_right_link_3" pos="0 0.05 0" quat="0.499998 0.5 -0.500002 -0.5" gravcomp="0">
244
+ <inertial pos="-0.0054798 0.00064517 0.0858537" quat="0.742648 -0.0317889 -0.0338067 0.668072" mass="2.21205" diaginertia="0.0178489 0.0176537 0.00205017" />
245
+ <joint name="astribot_arm_right_joint_3" pos="0 0 0" axis="0 0 1" range="-1.517 3.08" />
246
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_3" />
247
+ <body name="astribot_arm_right_link_4" pos="0.03 0 0.309" quat="0.707105 -0.707108 0 0" gravcomp="0">
248
+ <inertial pos="0.0157758 -0.111111 0.0151356" quat="0.516854 0.517425 -0.45414 0.508813" mass="0.329291" diaginertia="0.000501311 0.000477171 0.000367278" />
249
+ <joint name="astribot_arm_right_joint_4" pos="0 0 0" axis="0 0 1" range="0.0 2.55" />
250
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_4" />
251
+ <body name="astribot_arm_right_link_5" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
252
+ <inertial pos="-0.00984351 0.00748991 0.136847" quat="0.999961 -0.00684676 0.000823261 0.00549176" mass="1.11677" diaginertia="0.00454095 0.00438988 0.000793736" />
253
+ <joint name="astribot_arm_right_joint_5" pos="0 0 0" axis="0 0 1" range="-2.37 2.37" />
254
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_5" />
255
+ <body name="astribot_arm_right_link_6" pos="0 0 0.277" quat="0.707105 -0.707108 0 0" gravcomp="0">
256
+ <inertial pos="0.010363 -0.00408524 -0.0404713" quat="0.99999 0.00126801 -0.0015825 0.00407582" mass="0.202188" diaginertia="0.000164741 0.00015608 8.55488e-05" />
257
+ <joint name="astribot_arm_right_joint_6" pos="0 0 0" axis="0 0 1" range="-0.78 0.78" />
258
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_6" />
259
+ <body name="astribot_arm_right_link_7" pos="0 0 0" quat="0.707105 0 0.707108 0" gravcomp="0">
260
+ <inertial pos="0.00185812 -0.0895091 0.00257872" quat="0.711438 0.701239 0.0218365 -0.0405392" mass="1.45143" diaginertia="0.00202892 0.00199405 0.000442623" />
261
+ <joint name="astribot_arm_right_joint_7" pos="0 0 0" axis="0 0 1" range="-1.55 1.55" />
262
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_7" />
263
+ <site name="arm_right_tool" pos="0 -0.15 0" />
264
+ <body name="arm_right_tool_cam" pos="0 -0.15 0">
265
+ <camera name="right_wrist_rgbd" pos="0.00772 0.05592 0.04319" quat="-0.7130607009975457 0.7006910271198059 0.013493708973317153 0.019860539389038687" fovy="57" />
266
+ </body>
267
+ <site name="force_torque_sensor_right" />
268
+ <body name="astribot_arm_right_tool_link" pos="0 -0.048 0" euler="1.5707963 0 0" gravcomp="0">
269
+ <body name="astribot_gripper_right_base" pos="0.0 0.0 .0">
270
+ <geom type="mesh" contype="0" conaffinity="0" rgba="0.973 0.976 0.984 1" mesh="gripper_base_link" />
271
+ <geom name="astribot_gripper_right_right_geom" type="box" size=" 0.02 0.0135 0.01" pos="0.00 0 0.07" rgba="0.5 0.2 0.2 1" friction="0.7" solimp="0.95 0.99 0.001" solref="0.004 1" priority="1" contype="8" conaffinity="14" />
272
+ <inertial pos="0.0 0.0 0.04" quat="0.0 0.0 -0.0 1.0" mass="0.4" diaginertia="0.001 0.001 0.001" />
273
+ <body name="astribot_gripper_right_Link_L1" pos="0.0145 0 0.0510999999999999">
274
+ <joint class="gripper_size1" name="astribot_gripper_right_joint_L1" pos="0 0 0" axis="0 -1 0" range="0 0.93 " damping="5" />
275
+ <geom name="astribot_gripper_right_geom_L1" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_L1_Link" />
276
+ <inertial pos="0.0238640864176058 9.47687900128855E-11 0.0229075443586898" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
277
+ <body name="astribot_gripper_right_Link_L11" pos="0.0412500000000001 0 0.036379080527138" euler="0 0 0">
278
+ <joint class="gripper_size1" name="astribot_gripper_right_joint_L11" pos="0 0 0" axis="0 1 0" range="-0 1.00" />
279
+ <inertial pos="0.00580213800883545 -8.25165165516798E-05 0.0308700387872592" quat="0.0 0.0 -0.0 1.0" mass="0.067" diaginertia="0.001 0.001 0.001" />
280
+ <geom name="astribot_gripper_right_geom_L11" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_L11_Link" />
281
+ <geom name="astribot_gripper_right_geom_L112" type="box" size=" 0.005 0.0135 0.03" pos="-0.003 0 0.036" rgba="0.5 0.2 0.2 1" friction="1.7" solimp="0.95 0.99 0.001" solref="0.004 1" priority="1" contype="8" conaffinity="14" />
282
+ </body>
283
+ </body>
284
+ <body name="astribot_gripper_right_Link_L2" pos="0.0325 0 0.0510999999999999">
285
+ <joint class="gripper_size1" name="astribot_gripper_right_joint_L2" pos="0 0 0" axis="0 1 0" range="-1.00 0" />
286
+ <geom name="astribot_gripper_right_geom_L2" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_L2_Link" />
287
+ <inertial pos="0.0140847588556024 1.38103934263007E-10 0.0136360450679544" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
288
+ </body>
289
+ <body name="astribot_gripper_right_Link_R1" pos="-0.0144999999999999 0 0.0510999999999939">
290
+ <joint class="gripper_size1" name="astribot_gripper_right_joint_R1" pos="0 0 0" axis="0 1 0" range="0 0.93 " damping="5" />
291
+ <geom name="astribot_gripper_right_geom_R1" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_R1_Link" />
292
+ <inertial pos="-0.0238640864176057 -9.47685797632123E-11 0.0229075443586915" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
293
+ <body name="astribot_gripper_right_Link_R11" pos="-0.0412499999999999 0 0.0363790805271382" euler="0 0.03 0">
294
+ <joint class="gripper_size1" name="astribot_gripper_right_joint_R11" pos="0 0 0" axis="0 1 0" range="-1.00 0" />
295
+ <inertial pos="-0.00580213800888738 8.25165165509265E-05 0.030870038787216" quat="0.0 0.0 -0.0 1.0" mass="0.067" diaginertia="0.001 0.001 0.001" />
296
+ <geom name="astribot_gripper_right_geom_R11" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_R11_Link" />
297
+ <geom name="astribot_gripper_right_geom_R112" type="box" size=" 0.005 0.0135 0.03" pos="0.003 0 0.036" rgba="0.5 0.2 0.2 1" friction="0.7" solimp="0.95 0.99 0.001" solref="0.004 1" priority="1" contype="8" conaffinity="14" />
298
+ </body>
299
+ </body>
300
+ <body name="astribot_gripper_right_Link_R2" pos="-0.0325 0 0.0510999999999999">
301
+ <joint class="gripper_size1" name="astribot_gripper_right_joint_R2" pos="0 0 0" axis="0 1 0" range="-0 1.00" />
302
+ <inertial pos="-0.0140847588556023 -1.38096956128494E-10 0.0136360450679544" quat="0.0 0.0 -0.0 1.0" mass="0.03" diaginertia="0.001 0.001 0.001" />
303
+ <geom name="astribot_gripper_right_geom_R2" contype="0" conaffinity="0" type="mesh" rgba="0.08 0.08 0.09 1" mesh="gripper_R2_Link" />
304
+ </body>
305
+ </body>
306
+ </body>
307
+ <geom type="mesh" mesh="physical_astribot_arm_link_7" name="physical_robot_astribot_arm_right_link_7_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
308
+ </body>
309
+ <geom type="mesh" mesh="physical_astribot_arm_link_6" name="physical_robot_astribot_arm_right_link_6_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
310
+ </body>
311
+ <geom type="mesh" mesh="physical_astribot_arm_link_5" name="physical_robot_astribot_arm_right_link_5_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
312
+ </body>
313
+ <geom type="mesh" mesh="physical_astribot_arm_link_4" name="physical_robot_astribot_arm_right_link_4_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
314
+ </body>
315
+ <geom type="mesh" mesh="physical_astribot_arm_link_3" name="physical_robot_astribot_arm_right_link_3_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
316
+ </body>
317
+ <geom type="mesh" mesh="physical_astribot_arm_right_link_2" name="physical_robot_astribot_arm_right_link_2_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
318
+ </body>
319
+ <geom type="mesh" mesh="physical_astribot_arm_link_1" name="physical_robot_astribot_arm_right_link_1_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
320
+ </body>
321
+ <geom type="mesh" mesh="physical_astribot_torso_link_4" name="physical_robot_astribot_torso_link_4_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
322
+ <geom pos="0 0 0.46765" type="mesh" mesh="physical_astribot_head_base_link" name="physical_robot_astribot_torso_link_4_1" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
323
+ <geom pos="0 0.06449 0.36823" quat="0.579228 -0.40558 -0.40558 -0.579228" type="mesh" mesh="physical_astribot_arm_left_base_link" name="physical_robot_astribot_torso_link_4_2" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
324
+ <geom pos="0 -0.06449 0.36823" quat="0.579228 0.40558 -0.40558 0.579228" type="mesh" mesh="physical_astribot_arm_right_base_link" name="physical_robot_astribot_torso_link_4_3" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
325
+ </body>
326
+ <geom type="mesh" mesh="physical_astribot_torso_link_3" name="physical_robot_astribot_torso_link_3_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
327
+ </body>
328
+ <geom type="mesh" mesh="physical_astribot_torso_link_2" name="physical_robot_astribot_torso_link_2_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
329
+ </body>
330
+ <geom type="mesh" mesh="physical_astribot_torso_link_1" name="physical_robot_astribot_torso_link_1_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
331
+ </body>
332
+ <geom type="mesh" mesh="physical_astribot_torso_base_link" name="physical_robot_chassis_base_0" contype="1" conaffinity="6" density="0" rgba=".4 .5 .6 .15" group="3" friction=".8 .01 .001" solref=".004 1" />
333
+ </body>
334
+ <body name="worktable" pos="0.0 -0.75 0">
335
+ <geom name="worktable_top" type="box" pos="0 0 0.725" size="0.6 0.4 0.025" contype="2" conaffinity="13" rgba=".43 .29 .17 1" friction=".8 .01 .001" solref=".004 1" />
336
+ <geom name="worktable_leg_0" type="box" pos="-0.53 -0.33 0.35" size=".025 .025 0.35" contype="2" conaffinity="13" rgba=".25 .27 .3 1" friction=".8 .01 .001" solref=".004 1" />
337
+ <geom name="worktable_leg_1" type="box" pos="-0.53 0.33 0.35" size=".025 .025 0.35" contype="2" conaffinity="13" rgba=".25 .27 .3 1" friction=".8 .01 .001" solref=".004 1" />
338
+ <geom name="worktable_leg_2" type="box" pos="0.53 -0.33 0.35" size=".025 .025 0.35" contype="2" conaffinity="13" rgba=".25 .27 .3 1" friction=".8 .01 .001" solref=".004 1" />
339
+ <geom name="worktable_leg_3" type="box" pos="0.53 0.33 0.35" size=".025 .025 0.35" contype="2" conaffinity="13" rgba=".25 .27 .3 1" friction=".8 .01 .001" solref=".004 1" />
340
+ </body>
341
+ </worldbody>
342
+ <sensor>
343
+ <gyro name="astribot_chassis_base_imu_gyro" site="astribot_chassis_imu_site" />
344
+ <accelerometer name="astribot_chassis_base_imu_acc" site="astribot_chassis_imu_site" />
345
+ </sensor>
346
+ <actuator>
347
+ <general class="torso_size1" name="astribot_torso_joint_1" joint="astribot_torso_joint_1" forcerange="-465 465" gainprm="10000" biasprm="0 -10000 -1000" />
348
+ <general class="torso_size1" name="astribot_torso_joint_2" joint="astribot_torso_joint_2" gainprm="10000" biasprm="0 -10000 -1000" />
349
+ <general class="torso_size1" name="astribot_head_joint_1" joint="astribot_head_joint_1" gainprm="100" biasprm="0 -100 -10" />
350
+ <general class="torso_size1" name="astribot_head_joint_2" joint="astribot_head_joint_2" gainprm="100" biasprm="0 -100 -10" />
351
+ </actuator>
352
+ <actuator>
353
+ <general class="size3" name="astribot_arm_left_joint_1" joint="astribot_arm_left_joint_1" gainprm="100" biasprm="0 -100 -10" />
354
+ <general class="size3" name="astribot_arm_left_joint_2" joint="astribot_arm_left_joint_2" gainprm="100" biasprm="0 -100 -10" />
355
+ <general class="size3" name="astribot_arm_left_joint_3" joint="astribot_arm_left_joint_3" gainprm="100" biasprm="0 -100 -10" />
356
+ <general class="size2" name="astribot_arm_left_joint_4" joint="astribot_arm_left_joint_4" gainprm="500" biasprm="0 -500 -50" />
357
+ <general class="size2" name="astribot_arm_left_joint_5" joint="astribot_arm_left_joint_5" gainprm="500" biasprm="0 -500 -50" />
358
+ <general class="size1" name="astribot_arm_left_joint_6" joint="astribot_arm_left_joint_6" gainprm="200" biasprm="0 -200 -20" />
359
+ <general class="size1" name="astribot_arm_left_joint_7" joint="astribot_arm_left_joint_7" gainprm="200" biasprm="0 -200 -20" />
360
+ </actuator>
361
+ <sensor>
362
+ <force name="astribot_arm_left_force_sensor" site="force_torque_sensor_left" />
363
+ <torque name="astribot_arm_left_torque_sensor" site="force_torque_sensor_left" />
364
+ </sensor>
365
+ <tendon>
366
+ <fixed name="gripper_left_split">
367
+ <joint joint="astribot_gripper_left_joint_R1" coef="0.5" />
368
+ <joint joint="astribot_gripper_left_joint_L1" coef="0.5" />
369
+ </fixed>
370
+ </tendon>
371
+ <actuator>
372
+ <general name="astribot_gripper_left_joint_L1" tendon="gripper_left_split" forcerange="-200 200" ctrlrange="0 100" gainprm="4.65 0 0" biasprm="0 -500 -10" forcelimited="true" gaintype="fixed" biastype="affine" />
373
+ </actuator>
374
+ <contact>
375
+ <exclude body1="astribot_gripper_left_base" body2="astribot_gripper_left_Link_L1" />
376
+ <exclude body1="astribot_gripper_left_base" body2="astribot_gripper_left_Link_L2" />
377
+ <exclude body1="astribot_gripper_left_Link_L1" body2="astribot_gripper_left_Link_L2" />
378
+ <exclude body1="astribot_gripper_left_Link_L1" body2="astribot_gripper_left_Link_L11" />
379
+ <exclude body1="astribot_gripper_left_Link_L2" body2="astribot_gripper_left_Link_L11" />
380
+ <exclude body1="astribot_gripper_left_base" body2="astribot_gripper_left_Link_R1" />
381
+ <exclude body1="astribot_gripper_left_base" body2="astribot_gripper_left_Link_R2" />
382
+ <exclude body1="astribot_gripper_left_Link_R1" body2="astribot_gripper_left_Link_R2" />
383
+ <exclude body1="astribot_gripper_left_Link_R1" body2="astribot_gripper_left_Link_R11" />
384
+ <exclude body1="astribot_gripper_left_Link_R2" body2="astribot_gripper_left_Link_R11" />
385
+ </contact>
386
+ <equality>
387
+ <joint joint1="astribot_gripper_left_joint_R1" joint2="astribot_gripper_left_joint_L1" solimp="0.95 0.99 0.001" solref="0.005 1" />
388
+ <joint joint1="astribot_gripper_left_joint_R1" joint2="astribot_gripper_left_joint_R2" solimp="0.95 0.99 0.001" solref="0.005 1" />
389
+ <joint joint1="astribot_gripper_left_joint_R1" joint2="astribot_gripper_left_joint_R11" polycoef="0.00 -1 0 0 0" />
390
+ <joint joint1="astribot_gripper_left_joint_L1" joint2="astribot_gripper_left_joint_L2" polycoef="0 -1 0 0 0" solimp="0.95 0.99 0.001" solref="0.005 1" />
391
+ <joint joint1="astribot_gripper_left_joint_L1" joint2="astribot_gripper_left_joint_L11" polycoef="0.00 1 0 0 0" />
392
+ </equality>
393
+ <actuator>
394
+ <general class="size3" name="astribot_arm_right_joint_1" joint="astribot_arm_right_joint_1" gainprm="100" biasprm="0 -100 -10" />
395
+ <general class="size3" name="astribot_arm_right_joint_2" joint="astribot_arm_right_joint_2" gainprm="100" biasprm="0 -100 -10" />
396
+ <general class="size3" name="astribot_arm_right_joint_3" joint="astribot_arm_right_joint_3" gainprm="100" biasprm="0 -100 -10" />
397
+ <general class="size2" name="astribot_arm_right_joint_4" joint="astribot_arm_right_joint_4" gainprm="500" biasprm="0 -500 -50" />
398
+ <general class="size2" name="astribot_arm_right_joint_5" joint="astribot_arm_right_joint_5" gainprm="500" biasprm="0 -500 -50" />
399
+ <general class="size1" name="astribot_arm_right_joint_6" joint="astribot_arm_right_joint_6" gainprm="200" biasprm="0 -200 -20" />
400
+ <general class="size1" name="astribot_arm_right_joint_7" joint="astribot_arm_right_joint_7" gainprm="200" biasprm="0 -200 -20" />
401
+ </actuator>
402
+ <sensor>
403
+ <force name="astribot_arm_right_force_sensor" site="force_torque_sensor_right" />
404
+ <torque name="astribot_arm_right_torque_sensor" site="force_torque_sensor_right" />
405
+ <tendonpos name="gripper_left_tendon_length" tendon="gripper_left_split" />
406
+ <tendonpos name="gripper_right_tendon_length" tendon="gripper_right_split" />
407
+ </sensor>
408
+ <tendon>
409
+ <fixed name="gripper_right_split">
410
+ <joint joint="astribot_gripper_right_joint_R1" coef="0.5" />
411
+ <joint joint="astribot_gripper_right_joint_L1" coef="0.5" />
412
+ </fixed>
413
+ </tendon>
414
+ <actuator>
415
+ <general name="astribot_gripper_right_joint_L1" tendon="gripper_right_split" forcerange="-200 200" ctrlrange="0 100" gainprm="4.65 0 0" biasprm="0 -500 -10" forcelimited="true" gaintype="fixed" biastype="affine" />
416
+ </actuator>
417
+ <contact>
418
+ <exclude body1="astribot_gripper_right_base" body2="astribot_gripper_right_Link_L1" />
419
+ <exclude body1="astribot_gripper_right_base" body2="astribot_gripper_right_Link_L2" />
420
+ <exclude body1="astribot_gripper_right_Link_L1" body2="astribot_gripper_right_Link_L2" />
421
+ <exclude body1="astribot_gripper_right_Link_L1" body2="astribot_gripper_right_Link_L11" />
422
+ <exclude body1="astribot_gripper_right_Link_L2" body2="astribot_gripper_right_Link_L11" />
423
+ <exclude body1="astribot_gripper_right_base" body2="astribot_gripper_right_Link_R1" />
424
+ <exclude body1="astribot_gripper_right_base" body2="astribot_gripper_right_Link_R2" />
425
+ <exclude body1="astribot_gripper_right_Link_R1" body2="astribot_gripper_right_Link_R2" />
426
+ <exclude body1="astribot_gripper_right_Link_R1" body2="astribot_gripper_right_Link_R11" />
427
+ <exclude body1="astribot_gripper_right_Link_R2" body2="astribot_gripper_right_Link_R11" />
428
+ </contact>
429
+ <equality>
430
+ <joint joint1="astribot_gripper_right_joint_R1" joint2="astribot_gripper_right_joint_L1" solimp="0.95 0.99 0.001" solref="0.005 1" />
431
+ <joint joint1="astribot_gripper_right_joint_R1" joint2="astribot_gripper_right_joint_R2" solimp="0.95 0.99 0.001" solref="0.005 1" />
432
+ <joint joint1="astribot_gripper_right_joint_R1" joint2="astribot_gripper_right_joint_R11" polycoef="0.00 -1 0 0 0" />
433
+ <joint joint1="astribot_gripper_right_joint_L1" joint2="astribot_gripper_right_joint_L2" polycoef="0 -1 0 0 0" solimp="0.95 0.99 0.001" solref="0.005 1" />
434
+ <joint joint1="astribot_gripper_right_joint_L1" joint2="astribot_gripper_right_joint_L11" polycoef="0.00 1 0 0 0" />
435
+ </equality>
436
+ <asset>
437
+ <mesh name="physical_astribot_arm_left_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL" />
438
+ <mesh name="physical_astribot_arm_left_link_2" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL" />
439
+ <mesh name="physical_astribot_arm_link_1" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL" />
440
+ <mesh name="physical_astribot_arm_link_3" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL" />
441
+ <mesh name="physical_astribot_arm_link_4" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL" />
442
+ <mesh name="physical_astribot_arm_link_5" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL" />
443
+ <mesh name="physical_astribot_arm_link_6" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL" />
444
+ <mesh name="physical_astribot_arm_link_7" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL" />
445
+ <mesh name="physical_astribot_arm_right_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL" />
446
+ <mesh name="physical_astribot_arm_right_link_2" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL" />
447
+ <mesh name="physical_astribot_head_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL" />
448
+ <mesh name="physical_astribot_torso_base_link" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_base_link.STL" />
449
+ <mesh name="physical_astribot_torso_link_1" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL" />
450
+ <mesh name="physical_astribot_torso_link_2" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_2.STL" />
451
+ <mesh name="physical_astribot_torso_link_3" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL" />
452
+ <mesh name="physical_astribot_torso_link_4" file="/pfs/yichen/r2r/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_4.STL" />
453
+ </asset>
454
+ <equality>
455
+ <joint name="user_torso_sum" joint1="astribot_torso_joint_2" joint2="astribot_torso_joint_1" polycoef="-0.28403 -1 0 0 0" solref=".004 1" solimp=".9999 .9999 .001 .5 2" />
456
+ </equality>
457
+ </mujoco>
1500case/implementation_revisions/physical_constraints_17/scene_manifest.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "scope": "physical_scene_adapter_not_task_verified",
3
+ "scene": "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_constraints_17/s1_tabletop_physical.xml",
4
+ "scene_sha256": "32080253a239bb695fca4076a52fcf7d7ca328da8ac988a275658b9d28f77cae",
5
+ "inputs": {
6
+ "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/implementation_revisions/physical_backend_preflight_16/s1_component_candidate_2ms.xml": "02d96dd36c7c430dda5aac047f92ef401876e02714cded192bcd09769509227b",
7
+ "/pfs/yichen/r2r/results/iclr2027_v21_cobot_all1500_fromzero_ops_memory20_20260913/source/scene/s1_tabletop.xml": "b06105a8999dd7564f73b2811d7ef6708488a45ae4e575fd4ed755702c26d035"
8
+ },
9
+ "locked_joints": {
10
+ "astribot_torso_joint_3": 0.28834,
11
+ "astribot_torso_joint_4": -0.00123
12
+ },
13
+ "coupled_joint_sum_rad": -0.28403,
14
+ "coupling": "MuJoCo joint equality, finite residual measured separately",
15
+ "table": "Exact fixed synthetic v21 table, not real calibration",
16
+ "arm_collision": "Per-link convex hulls copied from v21; environment contacts enabled",
17
+ "robot_self_collision": "Not enabled in dynamics; separate body-surface checking still required",
18
+ "gripper_collision": "Official moving box contact primitives",
19
+ "physical_robot_geoms": [
20
+ "physical_robot_chassis_base_0",
21
+ "physical_robot_astribot_torso_link_1_0",
22
+ "physical_robot_astribot_torso_link_2_0",
23
+ "physical_robot_astribot_torso_link_3_0",
24
+ "physical_robot_astribot_torso_link_4_0",
25
+ "physical_robot_astribot_torso_link_4_1",
26
+ "physical_robot_astribot_torso_link_4_2",
27
+ "physical_robot_astribot_torso_link_4_3",
28
+ "physical_robot_astribot_arm_left_link_1_0",
29
+ "physical_robot_astribot_arm_left_link_2_0",
30
+ "physical_robot_astribot_arm_left_link_3_0",
31
+ "physical_robot_astribot_arm_left_link_4_0",
32
+ "physical_robot_astribot_arm_left_link_5_0",
33
+ "physical_robot_astribot_arm_left_link_6_0",
34
+ "physical_robot_astribot_arm_left_link_7_0",
35
+ "physical_robot_astribot_arm_right_link_1_0",
36
+ "physical_robot_astribot_arm_right_link_2_0",
37
+ "physical_robot_astribot_arm_right_link_3_0",
38
+ "physical_robot_astribot_arm_right_link_4_0",
39
+ "physical_robot_astribot_arm_right_link_5_0",
40
+ "physical_robot_astribot_arm_right_link_6_0",
41
+ "physical_robot_astribot_arm_right_link_7_0"
42
+ ],
43
+ "task_objects_present": false,
44
+ "task_verifier_present": false,
45
+ "task_success": null,
46
+ "source_episode_evaluations_added": 0,
47
+ "api_requests_added": 0
48
+ }
1500case/relocate_dependency_bundle.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Create a separate portable copy of the manifest-listed RSSR dependencies."""
2
+ from pathlib import Path
3
+ import argparse
4
+ import hashlib
5
+ import json
6
+
7
+
8
+ def main():
9
+ parser = argparse.ArgumentParser(description=__doc__)
10
+ parser.add_argument('--destination', type=Path, required=True)
11
+ args = parser.parse_args()
12
+ source = Path(__file__).resolve().parent
13
+ target = args.destination.absolute()
14
+ if target.exists() or target == source or target in source.parents:
15
+ raise ValueError('Destination must be a new directory, separate from the original download')
16
+ manifest = json.loads((source / 'dependency_bundle_manifest.json').read_text())
17
+ replacements = [
18
+ (manifest['source_experiment_root'], str(target)),
19
+ ('/pfs/yichen/r2r/models', str(target / 'source/models')),
20
+ ]
21
+ replacements.sort(key=lambda item: len(item[0]), reverse=True)
22
+ receipt = []
23
+ for row in manifest['files']:
24
+ relative = Path(row['path'])
25
+ if relative.is_absolute() or '..' in relative.parts:
26
+ raise ValueError('Invalid manifest path')
27
+ original = source / relative
28
+ data = original.read_bytes()
29
+ if hashlib.sha256(data).hexdigest() != row['sha256']:
30
+ raise ValueError('Original dependency checksum mismatch: ' + str(relative))
31
+ if relative.suffix.lower() in ('.py', '.xml', '.json'):
32
+ text = data.decode('utf-8')
33
+ for old, new in replacements:
34
+ text = text.replace(old, new)
35
+ data = text.encode('utf-8')
36
+ destination = target / relative
37
+ destination.parent.mkdir(parents=True, exist_ok=True)
38
+ destination.write_bytes(data)
39
+ receipt.append({'path': str(relative), 'original_sha256': row['sha256'],
40
+ 'portable_sha256': hashlib.sha256(data).hexdigest()})
41
+ (target / 'relocation_receipt.json').write_text(json.dumps(
42
+ {'original_download': str(source), 'destination': str(target),
43
+ 'path_replacements': replacements, 'files': receipt}, indent=2) + '\n')
44
+ print(json.dumps({'destination': str(target), 'files': len(receipt),
45
+ 'originals_modified': False}))
46
+
47
+
48
+ if __name__ == '__main__':
49
+ main()
1500case/source/agent_retarget/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from .config import RetargetConfig, SEARCH_SPACE # noqa: F401
1500case/source/agent_retarget/config.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ retarget 配置空间 Θ。
3
+
4
+ 设计原则(对应 agent 设计文档):
5
+ · core_params:数值/离散型参数,CEM / 随机搜索 与 agent 搜索的是同一个空间
6
+ · 每个字段都标注了它对应六类问题里的哪一类,便于 agent 做诊断→修复的关联
7
+ · 默认值 = 朴素转换(identity retarget),即"什么都不修"的 baseline
8
+ """
9
+ from dataclasses import dataclass, field, asdict
10
+ from typing import Tuple
11
+
12
+ # JOINT_POSITION 控制器单个策略步能命令的关节角增量上限(rad)。
13
+ # 实测:源演示在 20Hz 下有 13~27% 的帧需要超过 0.05rad(robosuite 默认值)的关节位移,
14
+ # 峰值 0.25rad。沿用默认值会让手臂持续落后、误差累积成 179mm 的末端偏差,
15
+ # 于是"IK 解得好不好"被执行层的限速掩盖。取 0.3rad 让执行层不再是瓶颈。
16
+ JOINT_OUTPUT_MAX = 0.3
17
+
18
+
19
+ @dataclass
20
+ class RetargetConfig:
21
+ # ---------- ① 几何标定类(Class I,闭式可解) ----------
22
+ # 控制点偏移:在目标本体的夹爪坐标系下施加,用于补偿 flange→TCP 距离差异
23
+ # (UR5e+Robotiq85 为 0.145m,Panda+PandaGripper 为 0.097m)
24
+ tcp_offset: Tuple[float, float, float] = (0.0, 0.0, 0.0)
25
+ # 控制点固定旋转偏移(轴角,夹爪坐标系):补偿末端坐标轴朝向约定差异
26
+ tcp_rotation_offset: Tuple[float, float, float] = (0.0, 0.0, 0.0)
27
+ # 基座外参偏移(世界系):本例两本体基座相同,保留字段以支持其它本体对
28
+ base_offset: Tuple[float, float, float] = (0.0, 0.0, 0.0)
29
+ # 仅作用于抓取之后的末端偏移(夹爪坐标系):补偿"物体被夹在手里的相对位姿"差异。
30
+ # 这类偏移不能作用于全程,否则会破坏接近阶段的抓取几何。
31
+ post_grasp_offset: Tuple[float, float, float] = (0.0, 0.0, 0.0)
32
+
33
+ # ---------- ② 运动学结构类(Class II,无闭式解,仅 ik_joint 模式下生效) ----------
34
+ # 位置/姿态残差权重:目标位姿在目标本体上够不到时,决定牺牲哪一个
35
+ ik_pos_weight: float = 1.0
36
+ ik_rot_weight: float = 1.0
37
+ # Levenberg-Marquardt 阻尼 λ:大 = 近奇异位形稳定但收敛慢,小 = 收敛快但易发散
38
+ ik_damping: float = 0.05
39
+ # 冗余消解的零空间二级目标构型:
40
+ # "none"=不施加(朴素做法,7-DoF 的一维零空间被任意消解 -> 臂形漂移/肘部翻转)
41
+ # "init"=目标本体默认构型 "mid"=关节行程中点(最大化离限位距离)
42
+ # "prev"=上一帧的解(直接惩罚臂形变化,抑制跳变最有效)
43
+ ik_nullspace_target: str = "none"
44
+ ik_nullspace_gain: float = 0.0
45
+ # 每帧求解的初值:"prev"=上一帧解(连续),"init"=每帧从默认构型重解(各帧独立)
46
+ ik_warm_start: str = "prev"
47
+ # 关节限位安全边界(rad):把可行区间从两端各收缩这么多
48
+ ik_joint_limit_margin: float = 0.0
49
+ # 上游共享自由度(躯干 / 升降柱 / 移动底座)参与冗余消解的权重。
50
+ # 0 = 冻结上游,只用手臂求解(朴素做法:目标本体多出的自由度被浪费)
51
+ # 0~1 = 上游参与但移动得比手臂少("底座慢、手臂快"的优先级)
52
+ # >1 = 优先动上游
53
+ # 目标位姿落在手臂可达集之外时,这是唯一能真正扩大可达集的参数 ——
54
+ # 放松姿态权重只是牺牲精度,并不能把末端送到更远的地方。
55
+ upstream_weight: float = 0.0
56
+ # 收敛预算
57
+ ik_max_iters: int = 50
58
+ ik_tol: float = 1.0
59
+
60
+ # ---------- ③ 末端执行器/抓取适配类 ----------
61
+ # 夹爪指令线性重映射:cmd' = clip(scale * cmd + bias, -1, 1)
62
+ gripper_command_scale: float = 1.0
63
+ gripper_command_bias: float = 0.0
64
+ # 抓取时序提前/延后的控制步数(正数=提前闭合),补偿夹爪行程/闭合速度差异
65
+ grasp_lead_steps: int = 0
66
+
67
+ # ---------- ④ 动作表示/控制类 ----------
68
+ # 位姿伺服增益(1.0=一步走完全部误差,<1 更保守)
69
+ pos_gain: float = 1.0
70
+ ori_gain: float = 1.0
71
+ # 每个源时间步允许消耗的控制步数(>1 给目标本体更多时间收敛到位)
72
+ steps_per_source_step: int = 1
73
+ # 在首次闭合夹爪的那一步额外停留的控制步数(让夹爪完全合拢再移动)
74
+ settle_steps_at_grasp: int = 0
75
+ # 时间重采样倍率(<1 拉长轨迹,>1 压缩)
76
+ time_scale: float = 1.0
77
+
78
+ # ---------- ⑤ 接触动力学类 ----------
79
+ # OSC 位置/姿态刚度缩放(相对于源本体使用的 kp=150)
80
+ kp_scale: float = 1.0
81
+
82
+ # ---------- 元信息 ----------
83
+ # 由 agent 填写的修复历史,仅用于日志与表4统计,不影响执行
84
+ notes: list = field(default_factory=list)
85
+
86
+ def to_dict(self):
87
+ return asdict(self)
88
+
89
+ @classmethod
90
+ def from_dict(cls, d):
91
+ d = {k: v for k, v in d.items() if k in cls.__dataclass_fields__}
92
+ return cls(**d)
93
+
94
+
95
+ # CEM / 随机搜索可搜索的字段及其取值范围(与 operators.PARAM_RANGES 保持一致,
96
+ # 保证 agent 与无推理基线搜索的是同一个空间,对比才公平)
97
+ SEARCH_SPACE = {
98
+ "tcp_offset": ((-0.10, -0.10, -0.10), (0.10, 0.10, 0.10)),
99
+ "tcp_rotation_offset": ((-0.6, -0.6, -0.6), (0.6, 0.6, 0.6)),
100
+ "post_grasp_offset": ((-0.10, -0.10, -0.10), (0.10, 0.10, 0.10)),
101
+ "gripper_command_scale": (0.2, 3.0),
102
+ "gripper_command_bias": (-1.0, 1.0),
103
+ "grasp_lead_steps": (-15, 15),
104
+ "pos_gain": (0.2, 2.0),
105
+ "ori_gain": (0.2, 2.0),
106
+ "steps_per_source_step": (1, 4),
107
+ "settle_steps_at_grasp": (0, 30),
108
+ # 上界放到 10:实测 ik_joint 模式下 kp_scale 1→3 把末端跟踪误差从 49mm 单调降到
109
+ # 28mm 仍未见底,卡在 3.0 会让"执行层跟不上参考轨迹"这类问题没有出路可走
110
+ "kp_scale": (0.3, 10.0),
111
+ # ② 运动学结构类(只在 ik_joint 模式下生效)
112
+ "ik_pos_weight": (0.2, 3.0),
113
+ "ik_rot_weight": (0.0, 3.0),
114
+ "ik_damping": (0.001, 0.5),
115
+ "ik_nullspace_gain": (0.0, 1.0),
116
+ "ik_joint_limit_margin": (0.0, 0.3),
117
+ "upstream_weight": (0.0, 2.0),
118
+ "ik_nullspace_target": ("none", "init", "mid", "prev"),
119
+ "ik_warm_start": ("prev", "init"),
120
+ }
121
+
122
+ # 枚举型字段(随机搜索/CEM 要按类别采样,不能当连续量插值)
123
+ ENUM_FIELDS = {
124
+ k: v for k, v in SEARCH_SPACE.items() if isinstance(v[0], str)
125
+ }
1500case/source/agent_retarget/embodiment.py ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 本体尺度与无量纲描述符。
3
+
4
+ 为什么需要这一层
5
+ ----------------
6
+ retarget 的诊断量大多是**长度**(mm)。绝对长度在不同本体上含义完全不同:
7
+ 50mm 残差对臂展 0.3m 的桌面臂是 17%、对 0.7m 的六轴臂是 7%、对 1.2m 的人形臂是 4%。
8
+ 只要阈值写成 mm,规则就绑死在某一类机器人的尺度上,经验也无法跨本体检索。
9
+
10
+ 因此本模块提供两件事:
11
+ · scale_m —— 目标本体的内在长度尺度(臂展),由运动学结构算出,不来自机型表
12
+ · *_rel —— 把长度类诊断量除以 scale_m 得到的无量纲量
13
+
14
+ 所有守卫、参数范围与经验签名都应使用无量纲量,这样:
15
+ · 同一条经验可以在尺度不同的本体对之间检索命中
16
+ · "偏置大不大"变成"相对臂展百分之几",与机器人大小无关
17
+
18
+ 注意:**成功判据仍然保留绝对 mm**。任务容差由被操作物体的尺寸决定,
19
+ 与机器人臂展无关(真机验收也是看绝对精度),不能归一化掉。
20
+ """
21
+ from dataclasses import dataclass, field, asdict
22
+
23
+ import numpy as np
24
+
25
+ #: 缺少运动学信息时的兜底臂展(m)。取值使长度类参数范围在
26
+ #: 六轴桌面臂(Piper/Panda 一类)上与历史绝对范围基本一致,保证旧实验可比。
27
+ DEFAULT_REACH_M = 0.7
28
+
29
+ #: 长度类诊断字段 -> 无量纲字段名。值为向量时取 L2 范数。
30
+ LENGTH_FIELDS_MM = {
31
+ "pos_err_mean_mm": "pos_err_rel",
32
+ "pos_err_max_mm": "pos_err_max_rel",
33
+ "ik_pos_residual_mean_mm": "ik_pos_residual_rel",
34
+ "ik_pos_residual_max_mm": "ik_pos_residual_max_rel",
35
+ "pos_bias_world_mm": "pos_bias_world_rel",
36
+ "pos_bias_gripper_frame_mm": "pos_bias_gripper_rel",
37
+ "left_pos_err_mean_mm": "left_pos_err_rel",
38
+ "right_pos_err_mean_mm": "right_pos_err_rel",
39
+ }
40
+
41
+
42
+ def chain_reach(model, data, joint_names, site_name=None):
43
+ """
44
+ 用运动学链算臂展(m):沿关节锚点依次累加间距,末端接到工具 site。
45
+
46
+ 这是"完全伸展时末端能离肩多远"的上界估计。选它而不是采样工作空间,
47
+ 因为它 O(n)、确定性,且对连杆整体缩放严格线性 —— 正是尺度归一化需要的性质。
48
+
49
+ site_name 为空或模型里没有该 site 时(源本体模型常常只有连杆、不带工具 site),
50
+ 退化到链末关节所在连杆的几何末端,仍是同一个量纲的臂展估计。
51
+ """
52
+ import mujoco
53
+
54
+ mujoco.mj_resetData(model, data)
55
+ mujoco.mj_forward(model, data)
56
+
57
+ jnt_ids = []
58
+ for name in joint_names:
59
+ jid = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_JOINT, name)
60
+ if jid >= 0:
61
+ jnt_ids.append(jid)
62
+ sid = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_SITE,
63
+ site_name) if site_name else -1
64
+ return chain_reach_by_ids(model, data, jnt_ids, sid)
65
+
66
+
67
+ def chain_reach_by_ids(model, data, jnt_ids, site_id=-1):
68
+ """chain_reach 的按索引版本:给只有关节/site 索引(例如 robosuite 里)的调用方用。"""
69
+ import mujoco
70
+
71
+ mujoco.mj_resetData(model, data)
72
+ mujoco.mj_forward(model, data)
73
+
74
+ pts, last_bid = [], -1
75
+ for jid in jnt_ids:
76
+ last_bid = int(model.jnt_bodyid[jid])
77
+ pts.append(np.array(data.xpos[last_bid], dtype=float))
78
+
79
+ if site_id is not None and site_id >= 0:
80
+ pts.append(np.array(data.site_xpos[site_id], dtype=float))
81
+ elif last_bid >= 0:
82
+ tip = _body_tip(model, data, last_bid)
83
+ if tip is not None:
84
+ pts.append(tip)
85
+
86
+ if len(pts) < 2:
87
+ return None
88
+ return float(sum(np.linalg.norm(pts[i + 1] - pts[i]) for i in range(len(pts) - 1)))
89
+
90
+
91
+ def _body_tip(model, data, bid):
92
+ """连杆上离其原点最远的几何中心,用来给没有工具 site 的链补上末端。"""
93
+ origin = np.array(data.xpos[bid], dtype=float)
94
+ best, best_d = None, -1.0
95
+ for gid in range(model.body_geomadr[bid],
96
+ model.body_geomadr[bid] + model.body_geomnum[bid]):
97
+ p = np.array(data.geom_xpos[gid], dtype=float)
98
+ d = float(np.linalg.norm(p - origin))
99
+ if d > best_d:
100
+ best, best_d = p, d
101
+ return best
102
+
103
+
104
+ def trajectory_extent(traj_list):
105
+ """
106
+ 用末端轨迹的包围盒对角长度估计源本体的动作尺度(m)。
107
+
108
+ 在拿不到源本体模型时作为 scale 的替代:它测的是"这段演示用掉多大空间",
109
+ 与臂展同量纲,足以支撑 reach_ratio 这类比值型描述符。
110
+ """
111
+ vals = []
112
+ for traj in traj_list:
113
+ if traj is None or len(traj) == 0:
114
+ continue
115
+ arr = np.asarray(traj, dtype=float)
116
+ vals.append(float(np.linalg.norm(arr.max(axis=0) - arr.min(axis=0))))
117
+ return float(np.mean(vals)) if vals else None
118
+
119
+
120
+ @dataclass
121
+ class Embodiment:
122
+ """
123
+ 一次 retarget 的本体对描述符。
124
+
125
+ 刻意**不含**机器人名字:agent 与经验签名只应看到这些可测量、无量纲的量,
126
+ 这样"在什么样的本体对上适用"才是可判定、可跨对迁移的。
127
+ 名字只用于人读的日志。
128
+ """
129
+ scale_m: float = DEFAULT_REACH_M # 目标本体臂展,长度归一化的分母
130
+ source_scale_m: float = None # 源本体臂展
131
+ #: source_scale_m 是否真的量自源本体运动学。拿不到源模型时它会退化成任务跨度,
132
+ #: 此时 reach_ratio 混了两种量,必须让下游知道,不能悄悄当臂展比用。
133
+ source_scale_is_reach: bool = True
134
+ task_extent_m: float = None # 演示末端轨迹跨度:任务尺度,不是本体尺度
135
+ dof_target: int = None # 目标单链自由度
136
+ dof_source: int = None # 源单链自由度
137
+ n_chains: int = 1 # 运动链数量(单臂=1,双臂=2)
138
+ #: 手臂上游、被各链共享的自由度数:躯干/升降柱=固定底座,底盘=移动底座。
139
+ #: 它是"可达集能否被扩大"的结构性前提,也是固定底座与移动底座的唯一差别。
140
+ upstream_dof: int = 0
141
+ source_name: str = "" # 仅用于日志
142
+ target_name: str = ""
143
+
144
+ @property
145
+ def reach_ratio(self):
146
+ """目标/源 尺度比。>1 表示目标本体更大。"""
147
+ if not self.source_scale_m or not self.scale_m:
148
+ return None
149
+ return round(self.scale_m / self.source_scale_m, 4)
150
+
151
+ @property
152
+ def task_extent_rel(self):
153
+ """任务跨度 / 目标臂展。>1 表示这段演示要求的活动范围超出单臂可达半径。"""
154
+ if not self.task_extent_m or not self.scale_m:
155
+ return None
156
+ return round(self.task_extent_m / self.scale_m, 4)
157
+
158
+ @property
159
+ def dof_diff(self):
160
+ """目标比源多出的自由度数,等于 IK 零空间维数的上界。"""
161
+ if self.dof_target is None or self.dof_source is None:
162
+ return None
163
+ return int(self.dof_target - self.dof_source)
164
+
165
+ def descriptor_fields(self):
166
+ """
167
+ 进入诊断报告、可被经验签名引用的无量纲描述符。
168
+
169
+ 这些字段让一条经验能表达"我适用于目标本体明显更大、且多一个冗余自由度
170
+ 的这类本体对",而不是"我适用于 S1"。
171
+ """
172
+ return {
173
+ "embodiment_scale_m": round(float(self.scale_m), 4) if self.scale_m else None,
174
+ "embodiment_reach_ratio": self.reach_ratio,
175
+ "embodiment_reach_ratio_is_exact": bool(self.source_scale_is_reach),
176
+ "embodiment_task_extent_rel": self.task_extent_rel,
177
+ "embodiment_dof_diff": self.dof_diff,
178
+ "embodiment_n_chains": int(self.n_chains),
179
+ "upstream_dof": int(self.upstream_dof),
180
+ }
181
+
182
+ def to_dict(self):
183
+ d = asdict(self)
184
+ d.update(self.descriptor_fields())
185
+ return d
186
+
187
+
188
+ def normalize_report(report, scale_m):
189
+ """
190
+ 就地补上长度类诊断量的无量纲版本。
191
+
192
+ 向量字段取 L2 范数后归一化:守卫关心的是"偏得多不多",方向信息仍保留在原字段里。
193
+ """
194
+ if not scale_m or scale_m <= 0:
195
+ scale_m = DEFAULT_REACH_M
196
+ scale_mm = scale_m * 1000.0
197
+ for src, dst in LENGTH_FIELDS_MM.items():
198
+ v = report.get(src)
199
+ if v is None:
200
+ continue
201
+ arr = np.asarray(v, dtype=float)
202
+ mag = float(np.linalg.norm(arr)) if arr.ndim else float(arr)
203
+ report[dst] = round(mag / scale_mm, 6)
204
+ return report
205
+
206
+
207
+ def rel_to_mm(rel, scale_m):
208
+ """把无量纲阈值换回 mm,用于人读的错误信息。"""
209
+ if not scale_m or scale_m <= 0:
210
+ scale_m = DEFAULT_REACH_M
211
+ return rel * scale_m * 1000.0
1500case/source/agent_retarget/envs.py ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """环境构建,以及在两个本体之间同步物体初始状态。"""
2
+ import json
3
+
4
+ import h5py
5
+ import numpy as np
6
+ import robosuite
7
+ import mimicgen # noqa: F401 -- 注册 Square_D0 / Threading_D0 等环境
8
+ from robosuite.controllers import load_controller_config
9
+
10
+ from .config import JOINT_OUTPUT_MAX
11
+
12
+ # 各任务里"被操作物体"的自由关节名(用于跨本体同步初始状态 + 提取物体轨迹 GT)
13
+ TASK_OBJECT_JOINTS = {
14
+ "Square": ["SquareNut_joint0", "RoundNut_joint0"],
15
+ "Threading": ["needle_joint0", "tripod_joint0"],
16
+ }
17
+
18
+ # 任务里"任务相关"的那个物体(GT 物体轨迹只看它)
19
+ TASK_PRIMARY_OBJECT = {
20
+ "Square": "SquareNut",
21
+ "Threading": "needle",
22
+ }
23
+
24
+
25
+ def task_family(env_name):
26
+ """Square_D0 -> Square, Threading_D1 -> Threading"""
27
+ return env_name.split("_D")[0]
28
+
29
+
30
+ def read_env_args(dataset_path):
31
+ with h5py.File(dataset_path, "r") as f:
32
+ return json.loads(f["data"].attrs["env_args"])
33
+
34
+
35
+ def make_env(env_name, robot, kp_scale=1.0, controller="OSC_POSE"):
36
+ """
37
+ 创建低维(无图像)环境。
38
+
39
+ controller 由执行方式决定:
40
+ · OSC_POSE 任务空间闭环跟踪(与 MimicGen 数据集一致),IK 隐含在控制器内
41
+ · JOINT_POSITION 关节空间回放,用于执行显式 IK 解出的关节轨迹
42
+
43
+ initialization_noise=None 是刻意设置:robosuite 默认会给机器人初始关节角加
44
+ 高斯噪声(magnitude=0.02),会让同一份配置的 rollout 结果在不同次运行间变化。
45
+ agent 的搜索必须建立在确定性评测之上,否则无法区分"修复生效"和"运气好"。
46
+ """
47
+ ctrl = load_controller_config(default_controller=controller)
48
+ if controller == "OSC_POSE":
49
+ ctrl["kp"] = 150.0 * kp_scale
50
+ else:
51
+ # 关节空间控制器只接受 delta 关节角,上限见 JOINT_OUTPUT_MAX 的说明
52
+ ctrl["kp"] = float(np.asarray(ctrl["kp"], dtype=float).mean()) * kp_scale
53
+ ctrl["output_max"], ctrl["output_min"] = JOINT_OUTPUT_MAX, -JOINT_OUTPUT_MAX
54
+ return robosuite.make(
55
+ env_name=env_name,
56
+ robots=robot,
57
+ has_renderer=False,
58
+ has_offscreen_renderer=False,
59
+ use_camera_obs=False,
60
+ use_object_obs=True,
61
+ ignore_done=True,
62
+ control_freq=20,
63
+ initialization_noise=None,
64
+ controller_configs=ctrl,
65
+ )
66
+
67
+
68
+ def object_joint_names(env_name):
69
+ fam = task_family(env_name)
70
+ if fam in TASK_OBJECT_JOINTS:
71
+ return TASK_OBJECT_JOINTS[fam]
72
+ # 兜底:所有自由关节
73
+ return None
74
+
75
+
76
+ def discover_object_joints(env):
77
+ """从环境里发现所有自由关节(type==0 即 mjJNT_FREE),用作物体关节名。"""
78
+ return [
79
+ env.sim.model.joint_id2name(i)
80
+ for i in range(env.sim.model.njnt)
81
+ if env.sim.model.jnt_type[i] == 0
82
+ ]
83
+
84
+
85
+ def get_object_state(env, joint_names):
86
+ """读取物体自由关节的 (pos, quat)。"""
87
+ return {name: np.array(env.sim.data.get_joint_qpos(name)) for name in joint_names}
88
+
89
+
90
+ def set_object_state(env, obj_state):
91
+ """把物体摆到指定位姿,并清零速度,使目标本体的场景与源演示初始场景一致。"""
92
+ for name, qpos in obj_state.items():
93
+ env.sim.data.set_joint_qpos(name, qpos)
94
+ env.sim.data.set_joint_qvel(name, np.zeros(6))
95
+ env.sim.forward()
96
+
97
+
98
+ def eef_pose(env):
99
+ """当前末端控制点(grip_site)在世界系下的位姿。"""
100
+ site_id = env.sim.model.site_name2id(env.robots[0].controller.eef_name)
101
+ pos = np.array(env.sim.data.site_xpos[site_id])
102
+ mat = np.array(env.sim.data.site_xmat[site_id]).reshape(3, 3)
103
+ return pos, mat
1500case/source/agent_retarget/evaluate.py ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 确定性 Evaluator:给一个配置 Θ,返回在一批 demo 上的聚合诊断报告。
3
+
4
+ agent 搜索、随机搜索、CEM 都通过这一个接口评测,保证对比公平。
5
+ 两个工程要点:
6
+ · 源演示的状态重放(提取 GT)很慢但与 Θ 无关,因此缓存到 npz,评测只跑目标本体
7
+ · 环境关掉了 initialization_noise,同一个 Θ 重复评测结果完全一致
8
+ """
9
+ import hashlib
10
+ import json
11
+ import os
12
+ import pickle
13
+ from collections import Counter
14
+
15
+ import numpy as np
16
+
17
+ from . import envs as E
18
+ from .config import RetargetConfig
19
+ from .embodiment import DEFAULT_REACH_M
20
+ from .instrument import diagnose, rollout
21
+ from .retarget import Retargeter
22
+ from .source import GTTrace, SourceDemo, load_demo
23
+
24
+ CACHE_DIR = os.environ["ICLR_DEMO_CACHE"]
25
+ EVAL_CACHE_DIR = os.environ["ICLR_EVAL_CACHE"]
26
+
27
+ # 磁盘缓存的版本号。缓存键只包含 (Θ, 模式, 故障, 数据集, 本体, demo 集合),
28
+ # 因此**任何不体现在 Θ 里的管线改动都必须 +1**,否则会静默读到过期结果:
29
+ # · 新增/改名诊断报告字段(旧缓存里读不到新字段)
30
+ # · 改动执行层语义(曾因改了 JOINT_OUTPUT_MAX 而没升版本,读到旧的 179mm 结果)
31
+ # · 改动 IK 求解器的数值行为
32
+ PIPELINE_VERSION = 7 # v7: 位姿信任域配平(ROT_BALANCE),改变 IK 的数值行为
33
+
34
+ # 各执行模式对应的目标本体控制器
35
+ MODE_CONTROLLER = {
36
+ "open_loop": "OSC_POSE",
37
+ "pose_tracking": "OSC_POSE",
38
+ "ik_joint": "JOINT_POSITION",
39
+ }
40
+
41
+
42
+ def _cache_path(dataset, demo_key):
43
+ tag = os.path.basename(dataset).replace(".hdf5", "")
44
+ return os.path.join(CACHE_DIR, "native_source_unchecked_v11", tag, f"{demo_key}.pkl")
45
+
46
+
47
+ def load_demo_cached(dataset, demo_key, source_env_factory):
48
+ """带磁盘缓存的源演示加载。source_env_factory 只在缓存缺失时被调用。"""
49
+ path = _cache_path(dataset, demo_key)
50
+ if os.path.exists(path):
51
+ with open(path, "rb") as f:
52
+ d = pickle.load(f)
53
+ return SourceDemo(**d["demo"]), GTTrace(**d["gt"])
54
+
55
+ demo, gt = load_demo(dataset, demo_key, source_env_factory())
56
+ os.makedirs(os.path.dirname(path), exist_ok=True)
57
+ tmp = path + f".tmp{os.getpid()}"
58
+ with open(tmp, "wb") as f:
59
+ pickle.dump({"demo": demo.__dict__, "gt": gt.__dict__}, f)
60
+ os.replace(tmp, path)
61
+ return demo, gt
62
+
63
+
64
+ class Evaluator:
65
+ """
66
+ 对固定的 (数据集, 目标本体, 执行模式, demo 集合) 评测任意 Θ。
67
+
68
+ 用法:
69
+ ev = Evaluator(dataset, "Panda", mode="pose_tracking", demo_ids=range(10))
70
+ report = ev(cfg) # 聚合诊断报告
71
+ """
72
+
73
+ def __init__(self, dataset, target_robot, mode="pose_tracking", demo_ids=range(10),
74
+ perturb=None, cache_evals=True):
75
+ from .perturb import Perturbation
76
+
77
+ self.dataset = dataset
78
+ self.target_robot = target_robot
79
+ self.mode = mode
80
+ # 注入的已知故障:影响执行,但不出现在 agent 的观测里
81
+ self.perturb = perturb or Perturbation()
82
+ self.demo_ids = list(demo_ids)
83
+ self.env_args = E.read_env_args(dataset)
84
+ self.env_name = self.env_args["env_name"]
85
+ self.source_robot = self.env_args["env_kwargs"]["robots"][0]
86
+
87
+ if mode not in MODE_CONTROLLER:
88
+ raise ValueError(f"未知模式 '{mode}',可用:{sorted(MODE_CONTROLLER)}")
89
+
90
+ self._source_env = None
91
+ self._target_env = None
92
+ self._target_kp = None
93
+ self._ik_solver = None
94
+ self._eval_cache = {} if cache_evals else None
95
+ self.n_rollouts = 0 # 统计真实仿真开销(论文里报"评测预算")
96
+
97
+ all_demos = [
98
+ load_demo_cached(dataset, f"demo_{i}", self._get_source_env)
99
+ for i in self.demo_ids
100
+ ]
101
+ # Keep every selected public demonstration; source success is not assessed.
102
+ self.demos = all_demos
103
+ self.n_skipped_gt_fail = 0
104
+ if not self.demos:
105
+ raise ValueError("Empty source demonstration selection")
106
+
107
+ # ---------- 环境惰性构建与复用 ----------
108
+ def _get_source_env(self):
109
+ if self._source_env is None:
110
+ self._source_env = E.make_env(self.env_name, self.source_robot)
111
+ return self._source_env
112
+
113
+ def _get_target_env(self, kp_scale):
114
+ # kp 写在 controller 配置里,改动需要重建环境
115
+ if self._target_env is None or self._target_kp != kp_scale:
116
+ if self._target_env is not None:
117
+ self._target_env.close()
118
+ self._target_env = E.make_env(
119
+ self.env_name, self.target_robot, kp_scale=kp_scale,
120
+ controller=MODE_CONTROLLER[self.mode],
121
+ )
122
+ self._target_kp = kp_scale
123
+ self._ik_solver = None # 环境重建后求解器持有的模型句柄失效
124
+ return self._target_env
125
+
126
+ def _get_ik_solver(self, env):
127
+ if self._ik_solver is None:
128
+ from .ik import IKSolver
129
+
130
+ self._ik_solver = IKSolver(env)
131
+ return self._ik_solver
132
+
133
+ # ---------- 评测 ----------
134
+ def __call__(self, cfg: RetargetConfig, mode=None):
135
+ mode = mode or self.mode
136
+ key = self.config_key(cfg, mode, self.perturb)
137
+ if self._eval_cache is not None and key in self._eval_cache:
138
+ return self._eval_cache[key]
139
+
140
+ # 磁盘缓存跨进程共享:同一设置下的 4 种策略都会先评测默认 Θ,
141
+ # 不共享就要重复跑 4 遍相同的仿真
142
+ disk = self._disk_get(key)
143
+ if disk is not None:
144
+ if self._eval_cache is not None:
145
+ self._eval_cache[key] = disk
146
+ return disk
147
+
148
+ env = self._get_target_env(cfg.kp_scale)
149
+ solver = self._get_ik_solver(env) if mode == "ik_joint" else None
150
+ reports = []
151
+ for demo, gt in self.demos:
152
+ rt = Retargeter(demo, cfg, mode=mode, perturb=self.perturb, ik_solver=solver)
153
+ rec = rollout(env, demo, rt, gt)
154
+ rep = diagnose(rec, demo, gt)
155
+ rep["demo"] = demo.demo_key
156
+ reports.append(rep)
157
+ self.n_rollouts += 1
158
+
159
+ agg = aggregate(reports)
160
+ agg["mode"] = mode
161
+ agg["env"] = self.env_name
162
+ agg["source_robot"] = self.source_robot
163
+ agg["target_robot"] = self.target_robot
164
+ agg["n_demos"] = len(reports)
165
+ agg["_per_demo"] = reports
166
+ if self._eval_cache is not None:
167
+ self._eval_cache[key] = agg
168
+ self._disk_put(key, agg)
169
+ return agg
170
+
171
+ # ---------- 跨进程磁盘评测缓存 ----------
172
+ def _disk_tag(self):
173
+ """同一 tag 下的评测结果才可互换:数据集、本体、模式、故障、demo 集合都要一致。"""
174
+ ids = hashlib.sha256(json.dumps(self.demo_ids).encode()).hexdigest()[:20]
175
+ return (
176
+ f"v{PIPELINE_VERSION}"
177
+ f"__{os.path.basename(self.dataset).replace('.hdf5', '')}"
178
+ f"__{self.target_robot}__{self.mode}__{self.perturb.name}__{ids}"
179
+ )
180
+
181
+ def _disk_path(self, key):
182
+ return os.path.join(EVAL_CACHE_DIR, self._disk_tag(), f"{key}.json")
183
+
184
+ def _disk_get(self, key):
185
+ path = self._disk_path(key)
186
+ if not os.path.exists(path):
187
+ return None
188
+ try:
189
+ with open(path) as f:
190
+ return json.load(f)
191
+ except (json.JSONDecodeError, OSError):
192
+ return None # 缓存损坏(例如上次被中断)则重算
193
+
194
+ def _disk_put(self, key, agg):
195
+ path = self._disk_path(key)
196
+ os.makedirs(os.path.dirname(path), exist_ok=True)
197
+ tmp = path + f".tmp{os.getpid()}"
198
+ try:
199
+ with open(tmp, "w") as f:
200
+ json.dump(agg, f, default=float)
201
+ os.replace(tmp, path) # 原子替换,避免并行进程读到半截文件
202
+ except OSError:
203
+ pass
204
+
205
+ @staticmethod
206
+ def config_key(cfg, mode, perturb=None):
207
+ d = cfg.to_dict()
208
+ d.pop("notes", None)
209
+ pt = perturb.to_dict() if perturb is not None else {"name": "F0_none"}
210
+ return hashlib.md5(
211
+ json.dumps({"cfg": d, "mode": mode, "perturb": pt}, sort_keys=True).encode()
212
+ ).hexdigest()
213
+
214
+ def close(self):
215
+ for env in (self._source_env, self._target_env):
216
+ if env is not None:
217
+ env.close()
218
+
219
+
220
+ def _mean(reports, key):
221
+ vals = [r[key] for r in reports if r.get(key) is not None]
222
+ return float(np.mean(vals)) if vals else None
223
+
224
+
225
+ def _vec_mean(reports, key):
226
+ vals = [r[key] for r in reports if r.get(key) is not None]
227
+ return np.array(vals).mean(axis=0).round(4).tolist() if vals else None
228
+
229
+
230
+ def _vec_std(reports, key):
231
+ vals = [r[key] for r in reports if r.get(key) is not None]
232
+ return np.array(vals).std(axis=0).round(4).tolist() if vals else None
233
+
234
+
235
+ def aggregate(reports):
236
+ """把逐 demo 报告压成一份聚合诊断报告(这就是喂给 agent 的观测)。"""
237
+ return {
238
+ "success_rate": float(np.mean([r["success"] for r in reports])),
239
+ "gt_success_rate": None, # Deliberately unmeasured, not assumed successful.
240
+ "grasp_rate": float(np.mean([r["grasp_achieved"] for r in reports])),
241
+ "failure_phases": dict(Counter(r["failure_phase"] for r in reports)),
242
+ "pos_err_mean_mm": _mean(reports, "pos_err_mean_mm"),
243
+ "pos_err_max_mm": _mean(reports, "pos_err_max_mm"),
244
+ "pos_bias_gripper_frame_mm": _vec_mean(reports, "pos_bias_gripper_frame_mm"),
245
+ "pos_bias_gripper_frame_std_across_demos_mm": _vec_std(
246
+ reports, "pos_bias_gripper_frame_mm"
247
+ ),
248
+ "ori_err_mean_deg": _mean(reports, "ori_err_mean_deg"),
249
+ "ori_err_max_deg": _mean(reports, "ori_err_max_deg"),
250
+ "ori_bias_gripper_frame_deg": _vec_mean(reports, "ori_bias_gripper_frame_deg"),
251
+ "ori_bias_gripper_frame_std_deg": _vec_std(reports, "ori_bias_gripper_frame_deg"),
252
+ "object_residual_gripper_frame_mm": _vec_mean(
253
+ reports, "object_residual_gripper_frame_mm"
254
+ ),
255
+ "object_residual_gripper_frame_std_mm": _vec_std(
256
+ reports, "object_residual_gripper_frame_mm"
257
+ ),
258
+ "object_orientation_residual_gripper_frame_deg": _vec_mean(
259
+ reports, "object_orientation_residual_gripper_frame_deg"
260
+ ),
261
+ "object_orientation_residual_gripper_frame_std_deg": _vec_std(
262
+ reports, "object_orientation_residual_gripper_frame_deg"
263
+ ),
264
+ "grasp_geometry_gap_m": _vec_mean(reports, "grasp_geometry_gap_m"),
265
+ "grasp_geometry_gap_std_m": _vec_std(reports, "grasp_geometry_gap_m"),
266
+ "grasp_orientation_gap_deg": _vec_mean(reports, "grasp_orientation_gap_deg"),
267
+ "grasp_orientation_gap_std_deg": _vec_std(reports, "grasp_orientation_gap_deg"),
268
+ "grasp_step_delta": _mean(reports, "grasp_step_delta"),
269
+ "grasp_duration_ratio": _mean(reports, "grasp_duration_ratio"),
270
+ "object_pos_err_mean_mm": _mean(reports, "object_pos_err_mean_mm"),
271
+ "object_pos_err_final_mm": _mean(reports, "object_pos_err_final_mm"),
272
+ "object_displacement_m": _mean(reports, "object_displacement_m"),
273
+ "gt_object_displacement_m": _mean(reports, "gt_object_displacement_m"),
274
+ "joint_limit_saturated_ratio": _mean(reports, "joint_limit_saturated_ratio"),
275
+ "joint_limit_saturated_joints": sorted(
276
+ {j for r in reports for j in r["joint_limit_saturated_joints"]}
277
+ ),
278
+ "joint_vel_max": _vec_mean(reports, "joint_vel_max"),
279
+ # ---- IK 阶段(② 运动学结构类的直接证据,仅 ik_joint 模式非空)----
280
+ "ik_pos_residual_mean_mm": _mean(reports, "ik_pos_residual_mean_mm"),
281
+ "ik_pos_residual_max_mm": _mean(reports, "ik_pos_residual_max_mm"),
282
+ "ik_rot_residual_mean_deg": _mean(reports, "ik_rot_residual_mean_deg"),
283
+ "ik_rot_residual_max_deg": _mean(reports, "ik_rot_residual_max_deg"),
284
+ "ik_unconverged_ratio": _mean(reports, "ik_unconverged_ratio"),
285
+ "ik_iters_mean": _mean(reports, "ik_iters_mean"),
286
+ "ik_joint_jump_max_rad": _mean(reports, "ik_joint_jump_max_rad"),
287
+ "ik_joint_jump_per_joint_rad": _vec_mean(reports, "ik_joint_jump_per_joint_rad"),
288
+ "ik_n_large_joint_jumps": _mean(reports, "ik_n_large_joint_jumps"),
289
+ "ik_min_singular_value": _mean(reports, "ik_min_singular_value"),
290
+ "ik_solution_min_slack_rad": _vec_mean(reports, "ik_solution_min_slack_rad"),
291
+ "ik_solution_limit_hit_ratio": _mean(reports, "ik_solution_limit_hit_ratio"),
292
+ "ik_joint_track_err_mean_rad": _mean(reports, "ik_joint_track_err_mean_rad"),
293
+ "ik_joint_track_err_max_rad": _mean(reports, "ik_joint_track_err_max_rad"),
294
+ }
295
+
296
+
297
+ #: 保真度项的半衰尺度与权重。
298
+ #: 半衰尺度取臂展的 5%(0.7m 臂上约 35mm):误差到这个量级时保真度减半,
299
+ #: 与"抓取级精度"同量级,所以分数的敏感区正好压在有意义的误差范围上。
300
+ FIDELITY_TAU_REL = 0.05
301
+ FIDELITY_WEIGHT = 200.0
302
+
303
+ #: 姿态保真度的半衰角与权重。角度本身已无量纲,不需要按臂展归一。
304
+ #: 权重取位置项的四分之一:姿态错了通常仍能完成任务,位置错了不能。
305
+ ORI_FIDELITY_TAU_DEG = 10.0
306
+ ORI_FIDELITY_WEIGHT = 50.0
307
+
308
+ #: 旋转角的物理上限。越界只可能来自数值发散,截断以免污染分数。
309
+ ORI_ERR_MAX_DEG = 180.0
310
+
311
+
312
+ def pos_err_rel(agg):
313
+ """位置误差相对目标臂展的无量纲值。Track C 已直接给出;Track A/B 用尺度换算。"""
314
+ rel = agg.get("pos_err_rel")
315
+ if rel is not None:
316
+ return float(rel)
317
+ mm = agg.get("pos_err_mean_mm")
318
+ if mm is None:
319
+ return None
320
+ scale_m = agg.get("embodiment_scale_m") or DEFAULT_REACH_M
321
+ return float(mm) / (float(scale_m) * 1000.0)
322
+
323
+
324
+ def score(agg):
325
+ """
326
+ 标量目标:任务成功率为主,retarget 保真度为稠密项。
327
+
328
+ 为什么保真度不能写成 "−误差×小系数"
329
+ ----------------------------------
330
+ 100 条 demo 下多成功 1 条就是 +10 分,而线性误差项每毫米只值 0.02 分,
331
+ 于是"精度换成功率"永远划算:实测出现过均值误差从 118mm 劣化到 230mm、
332
+ 分数却因为多成功 3 条而上升的情况 —— 优化器报告进步,retarget 质量反而退了一倍。
333
+ 这里改成有界、无量纲、且在整个误差范围内都保留梯度的洛伦兹型保真度:
334
+ · 无量纲(除以臂展)—— 换个尺寸的本体,同一分数含义不变
335
+ · 有界(0~FIDELITY_WEIGHT)—— 不会喧宾夺主盖过成功率
336
+ · 长尾不饱和 —— 成功率还是 0 的平台期仍有方向,这正是最需要梯度的时候
337
+
338
+ 姿态项同理必须有界。它原先写成 "−ori_err_mean_deg × 0.01",看着无害,
339
+ 但一旦姿态误差因数值问题发散(曾读到 6.37e9 度),这一项就能把 1000 量级的
340
+ 成功率项彻底淹没:实��有一次复用做到了 success_rate=1.00、位置误差 1.8mm
341
+ (全实验最好),却因为一个假的姿态读数被判为退步而丢弃。
342
+
343
+ 接触类字段(grasp_rate 等)只在评测器真正测到时计入 —— 缺省/None
344
+ 表示纯运动学评测,避免把假的 grasp_rate=1 写进分数。
345
+ """
346
+ s = (agg.get("success_rate") or 0.0) * 1000.0
347
+ grasp = agg.get("grasp_rate")
348
+ if grasp is not None:
349
+ s += float(grasp) * 100.0
350
+ s += (agg.get("grasp_duration_ratio") or 0.0) * 20.0
351
+ s -= (agg.get("object_pos_err_final_mm") or 0.0) * 0.05
352
+ rel = pos_err_rel(agg)
353
+ if rel is not None:
354
+ s += FIDELITY_WEIGHT / (1.0 + max(rel, 0.0) / FIDELITY_TAU_REL)
355
+ ori = agg.get("ori_err_mean_deg")
356
+ if ori is not None:
357
+ ori = min(max(float(ori), 0.0), ORI_ERR_MAX_DEG)
358
+ s += ORI_FIDELITY_WEIGHT / (1.0 + ori / ORI_FIDELITY_TAU_DEG)
359
+ if agg.get("ik_unconverged_ratio") is not None:
360
+ s -= float(agg["ik_unconverged_ratio"]) * 15.0
361
+ if agg.get("table_collision_fraction") is not None:
362
+ s -= 200.0 * agg["table_collision_fraction"]
363
+ s -= min(100., float(agg.get("table_penetration_max_mm") or 0.))
364
+ s -= 50.0 * min(2., max(0., float(agg.get("joint_path_jump_max_rad") or 0.) - .3))
365
+ return float(s)
1500case/source/agent_retarget/ik.py ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 显式逆运动学阶段:把源本体的末端位姿轨迹解成目标本体的关节轨迹。
3
+
4
+ 为什么要自己写而不用 robosuite 自带的 IK_POSE:
5
+ agent 要修的就是 IK 的配置本身(零空间二级目标、位置/姿态权重、阻尼、warm start、
6
+ 限位边界)。现成控制器把这些旋钮封在内部,agent 无从下手。这里把它们全部提到
7
+ Θ 里,于是"运动学结构类"(Class II)问题才真正可诊断、可修复。
8
+
9
+ 这一阶段产生的故障与几何标定类故障性质不同,**没有闭式解**:
10
+ · 源本体 6-DoF 的位姿轨迹交给 7-DoF 的目标本体,有一维零空间。朴素逐帧 IK
11
+ 任意消解它 —— 相邻帧可能落到完全不同的臂形上(肘部翻转),关节轨迹出现跳变
12
+ · 零空间目标选得不好会把手臂推向关节限位,末端跟着失真
13
+ · 近奇异位形下阻尼不足 -> 关节速度爆炸;阻尼过大 -> 跟不上
14
+ 这些只能靠"观测遥测 -> 调整策略 -> 重解 -> 验证"的循环处理,正是 agent 的用武之地。
15
+
16
+ 求解器:带零空间投影与限位回避的阻尼最小二乘(Levenberg-Marquardt)。
17
+ """
18
+ import os
19
+
20
+ import mujoco
21
+ import numpy as np
22
+
23
+ from .embodiment import DEFAULT_REACH_M, chain_reach_by_ids
24
+
25
+ # 收敛判据(与 Θ 里的 ik_tol 相乘得到实际阈值)。长度类常数以臂展为单位表示,
26
+ # 否则同一份 Θ 换个尺寸的机器人就会隐式变松或变紧。参考臂展下与原先的 1mm 等价。
27
+ POS_TOL_REL = 1e-3 / DEFAULT_REACH_M
28
+ BASE_ROT_TOL = np.radians(1.0)
29
+
30
+ # 数值安全限幅(求解器内部实现细节,不属于 Θ)。
31
+ # 不做限幅的裸 DLS 在近奇异位形下会发散:实测 λ=0.005 时残差从 9.5mm 恶化到 105mm、
32
+ # 关节跳变达 2rad —— 那是数值发散,不是"阻尼太小"这个物理结论。
33
+ POS_STEP_REL = 0.05 / DEFAULT_REACH_M # 单次迭代最多消除 7% 臂展的位置误差
34
+ MAX_ROT_STEP = np.radians(30.0) # 角度天然无量纲,无需归一化
35
+ MAX_DQ_STEP = 0.2 # 单次迭代任一关节最多转 0.2rad
36
+
37
+ #: 位置与姿态的信任域必须在**关节空间**里等价,否则位姿等权只是名义上的。
38
+ #: 位置步长 POS_STEP_REL·L 米对应的关节增量约为 POS_STEP_REL·L / L = POS_STEP_REL
39
+ #: 弧度(位置雅可比幅值 ~L),而姿态步长 MAX_ROT_STEP 弧度对应的关节增量就是它本身。
40
+ #: 两者相差 MAX_ROT_STEP / POS_STEP_REL ≈ 8.2 倍,dq 随后又被 MAX_DQ_STEP 统一裁剪,
41
+ #: 于是姿态需求吃掉整个步长预算、位置几乎不动 —— 表现为位置和姿态同时收敛失败。
42
+ #: 这个因子把两个信任域拉平,使 ik_rot_weight=1.0 真正表示"位姿等权"。
43
+ #: 它由两个无量纲常数之比构成,因此本身不随本体大小变化,与 ik_damping 按臂展缩放
44
+ #: 属于同一类归一化修正。
45
+ #: 设 R2R_LEGACY_ROT_WEIGHT=1 可退回修正前的行为,用于复现 2026-08-21 之前的结果。
46
+ ROT_BALANCE = POS_STEP_REL / MAX_ROT_STEP
47
+ if os.environ.get("R2R_LEGACY_ROT_WEIGHT") == "1":
48
+ ROT_BALANCE = 1.0
49
+
50
+
51
+ def _clip_norm(v, max_norm):
52
+ n = np.linalg.norm(v)
53
+ return v * (max_norm / n) if n > max_norm else v
54
+
55
+
56
+ def _axisangle_from_mat(R):
57
+ """
58
+ 旋转矩阵 -> 轴角向量(模长为旋转角,rad,恒 ≤ π)。
59
+
60
+ ang→π 时 sin(ang) 下溢,反对称部分 [R21-R12, ...] 的真值 2·sin(ang)·a 会退化到
61
+ 与浮点噪声同量级,再除以 2·sin(ang) 就会放大出天文数字(实测姿态误差读到过
62
+ 6.37e9 度)。因此接近 π 时改从对称部分取轴:ang=π 处 (R+I)/2 = a·aᵀ,
63
+ 取对角元最大的列归一化即得 ±a(此时 ±a 表示同一个旋转,符号无所谓)。
64
+ 最后统一"单位轴 × 角度",模长由构造保证等于 ang。
65
+ """
66
+ c = (np.trace(R) - 1.0) / 2.0
67
+ ang = float(np.arccos(np.clip(c, -1.0, 1.0)))
68
+ if ang < 1e-9:
69
+ return np.zeros(3)
70
+
71
+ v = np.array([R[2, 1] - R[1, 2], R[0, 2] - R[2, 0], R[1, 0] - R[0, 1]])
72
+ if np.sin(ang) > 1e-6:
73
+ axis = v
74
+ else:
75
+ M = (R + np.eye(3)) / 2.0
76
+ axis = M[:, int(np.argmax(np.diag(M)))]
77
+ if float(axis @ v) < 0.0:
78
+ axis = -axis
79
+
80
+ n = float(np.linalg.norm(axis))
81
+ if n < 1e-12:
82
+ return np.zeros(3)
83
+ return axis / n * ang
84
+
85
+
86
+ class IKSolver:
87
+ """
88
+ 对固定的(目标本体模型, 末端 site)求解逐帧 IK。
89
+
90
+ 用法:
91
+ soc = IKSolver(env)
92
+ q_traj, telem = solver.solve_trajectory(targets_pos, targets_mat, cfg)
93
+ """
94
+
95
+ def __init__(self, env):
96
+ self.model = env.sim.model._model
97
+ self.data = mujoco.MjData(self.model)
98
+ robot = env.robots[0]
99
+
100
+ self.site_id = env.sim.model.site_name2id(robot.controller.eef_name)
101
+ self.jnt_idx = list(robot._ref_joint_indexes)
102
+ self.qpos_adr = np.array(
103
+ [env.sim.model.jnt_qposadr[i] for i in self.jnt_idx], dtype=int
104
+ )
105
+ self.dof_adr = np.array(
106
+ [env.sim.model.jnt_dofadr[i] for i in self.jnt_idx], dtype=int
107
+ )
108
+ self.n = len(self.jnt_idx)
109
+ self.jnt_range = np.array(env.sim.model.jnt_range[self.jnt_idx], dtype=float)
110
+ self.q_init = np.array(robot.init_qpos, dtype=float)
111
+ # 关节行程中点:ik_nullspace_target="mid" 时用它,最大化离限位的距离
112
+ self.q_mid = self.jnt_range.mean(axis=1)
113
+ # 求解基准 qpos(含物体与夹爪),只改机械臂关节
114
+ self.qpos0 = np.array(env.sim.data.qpos, dtype=float)
115
+ self.scale_m = (chain_reach_by_ids(self.model, self.data,
116
+ self.jnt_idx, self.site_id)
117
+ or DEFAULT_REACH_M)
118
+
119
+ self._jacp = np.zeros((3, self.model.nv))
120
+ self._jacr = np.zeros((3, self.model.nv))
121
+
122
+ # ---------------------------------------------------------- 正运动学
123
+ def _fk(self, q):
124
+ self.data.qpos[:] = self.qpos0
125
+ self.data.qpos[self.qpos_adr] = q
126
+ mujoco.mj_kinematics(self.model, self.data)
127
+ mujoco.mj_comPos(self.model, self.data)
128
+ pos = np.array(self.data.site_xpos[self.site_id])
129
+ mat = np.array(self.data.site_xmat[self.site_id]).reshape(3, 3)
130
+ return pos, mat
131
+
132
+ def _jacobian(self):
133
+ mujoco.mj_jacSite(self.model, self.data, self._jacp, self._jacr, self.site_id)
134
+ return self._jacp[:, self.dof_adr], self._jacr[:, self.dof_adr]
135
+
136
+ def forward_kinematics(self, q):
137
+ return self._fk(q)
138
+
139
+ # ---------------------------------------------------------- 单帧求解
140
+ def solve_frame(self, tgt_pos, tgt_mat, q_seed, cfg):
141
+ """
142
+ 返回 (q, 单帧遥测)。
143
+ 遥测里的残差是**求解器自己知道的**误差,与执行阶段的跟踪误差是两回事:
144
+ 残差大 = 目标位姿在目标本体上够不到(结构性不可达),不是控制问题。
145
+ """
146
+ w_p = float(cfg.ik_pos_weight)
147
+ w_r = float(cfg.ik_rot_weight) * ROT_BALANCE
148
+ # 雅可比元素量纲 m/rad 随臂展线性增长,JJᵀ ~ L²,阻尼必须同步缩放,
149
+ # 否则同一个 λ 在大本体上等效欠阻尼、在小本体上过阻尼
150
+ lam = float(cfg.ik_damping) * self.scale_m / DEFAULT_REACH_M
151
+ k_ns = float(cfg.ik_nullspace_gain)
152
+ margin = float(cfg.ik_joint_limit_margin)
153
+ pos_tol = POS_TOL_REL * self.scale_m * float(cfg.ik_tol)
154
+ pos_step = POS_STEP_REL * self.scale_m
155
+ rot_tol = BASE_ROT_TOL * float(cfg.ik_tol)
156
+
157
+ q_ns = self._nullspace_reference(q_seed, cfg)
158
+ lo = self.jnt_range[:, 0] + margin
159
+ hi = self.jnt_range[:, 1] - margin
160
+ # 边界过宽会导致区间反转,此时退回原始限位
161
+ bad = lo >= hi
162
+ lo[bad], hi[bad] = self.jnt_range[bad, 0], self.jnt_range[bad, 1]
163
+
164
+ q = np.clip(np.array(q_seed, dtype=float), lo, hi)
165
+ n_iters, converged = 0, False
166
+ min_sv = np.inf
167
+ for n_iters in range(1, int(cfg.ik_max_iters) + 1):
168
+ cur_pos, cur_mat = self._fk(q)
169
+ e_pos = tgt_pos - cur_pos
170
+ e_rot = _axisangle_from_mat(tgt_mat @ cur_mat.T)
171
+ # 收敛判据只检查**权重非零**的分量:把姿态权重降到 0 就等于宣布不再管姿态,
172
+ # 此时仍要求姿态达标会让每一帧都判为"未收敛",掩盖真实的求解质量
173
+ if (np.linalg.norm(e_pos) < pos_tol or w_p == 0.0) and \
174
+ (np.linalg.norm(e_rot) < rot_tol or w_r == 0.0):
175
+ converged = True
176
+ break
177
+
178
+ Jp, Jr = self._jacobian()
179
+ J = np.vstack([w_p * Jp, w_r * Jr])
180
+ # 限幅后再进 DLS:一次迭代只朝目标走一小步,避免远距离/近奇异下的发散
181
+ e = np.concatenate([
182
+ w_p * _clip_norm(e_pos, pos_step),
183
+ w_r * _clip_norm(e_rot, MAX_ROT_STEP),
184
+ ])
185
+
186
+ sv = np.linalg.svd(J, compute_uv=False)
187
+ min_sv = min(min_sv, float(sv[-1]))
188
+
189
+ # 阻尼最小二乘:dq = J^T (J J^T + λ²I)^-1 e
190
+ JJt = J @ J.T + (lam ** 2) * np.eye(6)
191
+ dq = J.T @ np.linalg.solve(JJt, e)
192
+
193
+ # 零空间二级目标:在不影响末端位姿的子空间里把关节拉向参考构型
194
+ if k_ns > 0.0 and q_ns is not None:
195
+ J_pinv = J.T @ np.linalg.solve(JJt, np.eye(6))
196
+ N = np.eye(self.n) - J_pinv @ J
197
+ dq = dq + N @ (k_ns * (q_ns - q))
198
+
199
+ dq = np.clip(dq, -MAX_DQ_STEP, MAX_DQ_STEP)
200
+ q = np.clip(q + dq, lo, hi)
201
+
202
+ cur_pos, cur_mat = self._fk(q)
203
+ telem = {
204
+ "pos_residual_m": float(np.linalg.norm(tgt_pos - cur_pos)),
205
+ "rot_residual_rad": float(
206
+ np.linalg.norm(_axisangle_from_mat(tgt_mat @ cur_mat.T))
207
+ ),
208
+ "n_iters": n_iters,
209
+ "converged": converged,
210
+ "min_singular_value": float(min_sv) if np.isfinite(min_sv) else None,
211
+ }
212
+ return q, telem
213
+
214
+ def _nullspace_reference(self, q_seed, cfg):
215
+ """零空间二级目标的参考构型。这是 7-DoF 冗余消解的核心选择。"""
216
+ mode = cfg.ik_nullspace_target
217
+ if mode == "none":
218
+ return None
219
+ if mode == "init":
220
+ return self.q_init
221
+ if mode == "mid":
222
+ return self.q_mid
223
+ if mode == "prev":
224
+ # 拉向上一帧的解:直接惩罚臂形变化,是抑制肘部翻转最直接的手段
225
+ return np.array(q_seed, dtype=float)
226
+ raise ValueError(f"未知的 ik_nullspace_target='{mode}'")
227
+
228
+ # ---------------------------------------------------------- 整条轨迹
229
+ def solve_trajectory(self, targets_pos, targets_mat, cfg):
230
+ """
231
+ 逐帧求解并返回 (关节轨迹, 轨迹级遥测)。
232
+
233
+ warm start 决定每帧的初值:
234
+ · "prev" 用上一帧的解(连续,但一旦跳到别的臂形就会一路错下去)
235
+ · "init" 每帧都从默认构型重解(各帧独立,最容易出现相邻帧臂形突变)
236
+ """
237
+ q_traj, telems = [], []
238
+ q_seed = self.q_init.copy()
239
+ for tgt_pos, tgt_mat in zip(targets_pos, targets_mat):
240
+ q, telem = self.solve_frame(tgt_pos, tgt_mat, q_seed, cfg)
241
+ q_traj.append(q)
242
+ telems.append(telem)
243
+ q_seed = q if cfg.ik_warm_start == "prev" else self.q_init.copy()
244
+
245
+ q_traj = np.array(q_traj)
246
+ return q_traj, self._aggregate(q_traj, telems)
247
+
248
+ def _aggregate(self, q_traj, telems):
249
+ pos_res = np.array([t["pos_residual_m"] for t in telems])
250
+ rot_res = np.array([t["rot_residual_rad"] for t in telems])
251
+ n_iters = np.array([t["n_iters"] for t in telems])
252
+ conv = np.array([t["converged"] for t in telems])
253
+ svs = [t["min_singular_value"] for t in telems
254
+ if t["min_singular_value"] is not None]
255
+
256
+ # 相邻帧关节角跳变:零空间漂移/肘部翻转的直接证据。
257
+ # 末端位姿是连续的,所以关节轨迹本应连续;出现大跳变只能是冗余消解跳到了
258
+ # 另一个臂形(对 6-DoF 源 -> 7-DoF 目标,这是本体差异固有的结构型故障)
259
+ if len(q_traj) > 1:
260
+ dq = np.abs(np.diff(q_traj, axis=0))
261
+ jump_max = float(dq.max())
262
+ jump_per_joint = dq.max(axis=0).round(4).tolist()
263
+ # 一帧内某关节动超过 0.5rad,在 20Hz 下已经不是可执行的平滑运动
264
+ n_jumps = int((dq.max(axis=1) > 0.5).sum())
265
+ else:
266
+ jump_max, jump_per_joint, n_jumps = 0.0, [0.0] * self.n, 0
267
+
268
+ slack = np.minimum(
269
+ q_traj - self.jnt_range[:, 0], self.jnt_range[:, 1] - q_traj
270
+ )
271
+ return {
272
+ "ik_pos_residual_mean_mm": float(pos_res.mean() * 1000),
273
+ "ik_pos_residual_max_mm": float(pos_res.max() * 1000),
274
+ "ik_rot_residual_mean_deg": float(np.degrees(rot_res).mean()),
275
+ "ik_rot_residual_max_deg": float(np.degrees(rot_res).max()),
276
+ "ik_unconverged_ratio": float(1.0 - conv.mean()),
277
+ "ik_iters_mean": float(n_iters.mean()),
278
+ "ik_joint_jump_max_rad": jump_max,
279
+ "ik_joint_jump_per_joint_rad": jump_per_joint,
280
+ "ik_n_large_joint_jumps": n_jumps,
281
+ "ik_min_singular_value": float(np.min(svs)) if svs else None,
282
+ "ik_solution_min_slack_rad": slack.min(axis=0).round(4).tolist(),
283
+ "ik_solution_limit_hit_ratio": float((slack < 0.05).any(axis=1).mean()),
284
+ }
1500case/source/agent_retarget/instrument.py ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Instrumentation:在目标本体上执行转换后的轨迹,并产出**结构化诊断报告**。
3
+
4
+ 这是整个 agent 设计的地基:agent 能不能推理,取决于喂给它的是"物理上有意义的残差"
5
+ 还是"一个黑箱成功率"。因此这里刻意不只记 success,而是记录能直接支撑诊断的量:
6
+ · 位姿跟踪残差(含在夹爪坐标系下的**恒定偏置**,这是 flange→TCP 类问题的直接证据)
7
+ · 抓取时刻的"末端↔物体"相对位姿与 GT 的差(抓取几何不匹配的直接证据)
8
+ · 关节触限、关节速度尖峰(近奇异)、非预期碰撞(结构型问题的证据)
9
+ · 失败发生在哪个阶段(never_reached / no_grasp / grasp_lost / task_failed)
10
+ """
11
+ from dataclasses import dataclass, field
12
+ from typing import Dict, List
13
+
14
+ import numpy as np
15
+
16
+ from . import envs as E
17
+ from .source import collision_geoms_of
18
+
19
+
20
+ def _rot_angle(R):
21
+ """旋转矩阵对应的旋转角(rad)。"""
22
+ c = (np.trace(R) - 1.0) / 2.0
23
+ return float(np.arccos(np.clip(c, -1.0, 1.0)))
24
+
25
+
26
+ def _axisangle(R):
27
+ """旋转矩阵 -> 轴角向量(模长为旋转角,rad)。"""
28
+ ang = _rot_angle(R)
29
+ if ang < 1e-8:
30
+ return np.zeros(3)
31
+ axis = np.array([R[2, 1] - R[1, 2], R[0, 2] - R[2, 0], R[1, 0] - R[0, 1]])
32
+ return axis / (2.0 * np.sin(ang)) * ang
33
+
34
+
35
+ def _quat_wxyz_to_mat(q):
36
+ """MuJoCo 自由关节的四元数是 (w,x,y,z) 顺序,转旋转矩阵。"""
37
+ w, x, y, z = q
38
+ n = w * w + x * x + y * y + z * z
39
+ if n < 1e-12:
40
+ return np.eye(3)
41
+ s = 2.0 / n
42
+ return np.array([
43
+ [1 - s * (y * y + z * z), s * (x * y - w * z), s * (x * z + w * y)],
44
+ [s * (x * y + w * z), 1 - s * (x * x + z * z), s * (y * z - w * x)],
45
+ [s * (x * z - w * y), s * (y * z + w * x), 1 - s * (x * x + y * y)],
46
+ ])
47
+
48
+
49
+ def _mean_axisangle(mats):
50
+ """一组旋转矩阵的平均轴角向量(小角度下等价于旋转向量取均值)。"""
51
+ return np.mean([_axisangle(m) for m in mats], axis=0)
52
+
53
+
54
+ def rollout(target_env, demo, retargeter, gt=None):
55
+ """在目标本体上执行,返回逐步的原始记录。"""
56
+ cfg = retargeter.cfg
57
+ from scene_binding import bind_scene
58
+ bind_scene(target_env,demo)
59
+
60
+ robot = target_env.robots[0]
61
+ arm_joint_idx = robot._ref_joint_indexes
62
+ jnt_range = target_env.sim.model.jnt_range[arm_joint_idx]
63
+ # 关节 id 与 qpos 下标在 Panda 上恰好一致,但不能依赖这点:显式取 qpos 地址
64
+ qpos_adr = np.array(
65
+ [target_env.sim.model.jnt_qposadr[i] for i in arm_joint_idx], dtype=int
66
+ )
67
+
68
+ obj_joints = list(demo.object_init.keys())
69
+ primary_joint = gt.primary_joint if gt is not None else obj_joints[0]
70
+ primary_geoms = collision_geoms_of(target_env, primary_joint.split("_joint")[0])
71
+
72
+ rec = dict(
73
+ target_pos=[], achieved_pos=[], achieved_mat=[], pos_err=[], pos_err_gripper_frame=[],
74
+ ori_err_angle=[], ori_err_axisangle_gripper_frame=[],
75
+ joint_qpos=[], joint_vel=[], limit_slack=[],
76
+ grasp=[], object_pose=[], eef_to_obj_gripper_frame=[], gripper_cmd=[],
77
+ )
78
+
79
+ n_ctrl_steps = max(1, int(cfg.steps_per_source_step))
80
+ for t in range(retargeter.n_steps):
81
+ for _ in range(n_ctrl_steps + retargeter.extra_settle_steps(t)):
82
+ cur_pos, cur_mat = E.eef_pose(target_env)
83
+ cur_q = np.array(target_env.sim.data.qpos[qpos_adr])
84
+ action = retargeter.action(t, cur_pos, cur_mat, cur_q)
85
+ target_env.step(action)
86
+
87
+ cur_pos, cur_mat = E.eef_pose(target_env)
88
+ tgt_pos, tgt_mat = retargeter.targets_pos[t], retargeter.targets_mat[t]
89
+
90
+ err_world = cur_pos - tgt_pos
91
+ rec["target_pos"].append(tgt_pos.copy())
92
+ rec["achieved_pos"].append(cur_pos.copy())
93
+ rec["achieved_mat"].append(cur_mat.copy())
94
+ rec["pos_err"].append(err_world)
95
+ # 把误差旋到夹爪坐标系:若是 flange→TCP 类问题,这里会呈现恒定偏置
96
+ rec["pos_err_gripper_frame"].append(cur_mat.T @ err_world)
97
+ R_err = tgt_mat @ cur_mat.T
98
+ rec["ori_err_angle"].append(_rot_angle(R_err))
99
+ # 姿态误差写成夹爪系下的轴角向量,便于识别"恒定坐标轴约定偏差"
100
+ rec["ori_err_axisangle_gripper_frame"].append(_axisangle(cur_mat.T @ R_err @ cur_mat))
101
+
102
+ q = np.array(target_env.sim.data.qpos[qpos_adr])
103
+ rec["joint_qpos"].append(q)
104
+ rec["joint_vel"].append(np.array(target_env.sim.data.qvel[arm_joint_idx]))
105
+ # 距最近关节限位的余量(rad),越小越危险
106
+ rec["limit_slack"].append(np.minimum(q - jnt_range[:, 0], jnt_range[:, 1] - q))
107
+
108
+ rec["grasp"].append(
109
+ bool(target_env._check_grasp(gripper=robot.gripper, object_geoms=primary_geoms))
110
+ )
111
+ obj_qpos = np.array(target_env.sim.data.get_joint_qpos(primary_joint))
112
+ rec["object_pose"].append(obj_qpos)
113
+ rec["eef_to_obj_gripper_frame"].append(cur_mat.T @ (obj_qpos[:3] - cur_pos))
114
+ rec["gripper_cmd"].append(float(retargeter.gripper_seq[t]))
115
+
116
+ rec = {k: np.array(v) for k, v in rec.items()}
117
+ rec["success"] = bool(target_env._check_success())
118
+ rec["primary_joint"] = primary_joint
119
+ rec["ik_telemetry"] = retargeter.ik_telemetry
120
+ # IK 规划的关节轨迹 vs 实际执行到的关节角:区分"IK 解错了"和"关节轨迹跟不上"
121
+ if retargeter.q_traj is not None:
122
+ n = min(len(retargeter.q_traj), len(rec["joint_qpos"]))
123
+ rec["joint_track_err"] = rec["joint_qpos"][:n] - retargeter.q_traj[:n]
124
+ else:
125
+ rec["joint_track_err"] = None
126
+ return rec
127
+
128
+
129
+ def diagnose(rec, demo, gt):
130
+ """把逐步记录压缩成结构化诊断报告(喂给 agent 的就是这个 dict)。"""
131
+ pos_err = rec["pos_err"]
132
+ err_gf = rec["pos_err_gripper_frame"]
133
+
134
+ grasp = rec["grasp"]
135
+ grasp_idx = np.where(grasp)[0]
136
+ grasp_step = int(grasp_idx[0]) if len(grasp_idx) else -1
137
+
138
+ # 抓取几何不匹配:在 GT 抓取时刻,"末端→物体"的相对位置 与 目标本体上的对应量之差
139
+ grasp_geometry_gap = None
140
+ grasp_orientation_gap = None
141
+ if 0 <= gt.grasp_step < len(rec["eef_to_obj_gripper_frame"]):
142
+ s = gt.grasp_step
143
+ gt_traj = gt.object_traj[rec["primary_joint"]]
144
+ gt_obj = gt_traj[s][:3]
145
+ gt_eef = demo.eef_pos[s]
146
+ gt_mat = demo.eef_mat[s]
147
+ gt_rel = gt_mat.T @ (gt_obj - gt_eef)
148
+ tgt_rel = rec["eef_to_obj_gripper_frame"][s]
149
+ grasp_geometry_gap = (tgt_rel - gt_rel).tolist()
150
+
151
+ # 抓取瞬间的**朝向**差:位置量的旋转对偶。
152
+ # 必须测在抓取瞬间而不是抓取后的平均 —— 物体夹住后会自对齐,
153
+ # 平均量会把真实的朝向偏差冲淡(实测 17° 注入只剩 5°)。
154
+ R_rel_gt = gt_mat.T @ _quat_wxyz_to_mat(gt_traj[s][3:7])
155
+ R_rel_tgt = rec["achieved_mat"][s].T @ _quat_wxyz_to_mat(rec["object_pose"][s, 3:7])
156
+ grasp_orientation_gap = np.degrees(
157
+ _axisangle(R_rel_tgt @ R_rel_gt.T)
158
+ ).round(3).tolist()
159
+
160
+ # 物体轨迹与 GT 的偏差
161
+ gt_obj_traj = gt.object_traj[rec["primary_joint"]]
162
+ n = min(len(gt_obj_traj), len(rec["object_pose"]))
163
+ obj_resid = rec["object_pose"][:n, :3] - gt_obj_traj[:n, :3]
164
+ obj_pos_err = np.linalg.norm(obj_resid, axis=1)
165
+
166
+ # 抓取后阶段的物体位置残差(旋到夹爪系):反映"物体被夹在手里的相对位姿"差异,
167
+ # 是 fit_post_grasp_offset_from_object_residual 的输入
168
+ object_residual_gf = None
169
+ object_ori_residual_gf = None
170
+ if grasp_step >= 0:
171
+ held = np.where(grasp[:n])[0]
172
+ if len(held) >= 3:
173
+ mats = rec["achieved_mat"][held]
174
+ object_residual_gf = (
175
+ np.einsum("tji,tj->ti", mats, obj_resid[held]).mean(axis=0) * 1000
176
+ ).tolist()
177
+ # 被夹持物体的**姿态**残差(夹爪系轴角,度)。
178
+ # 参考轨迹里的旋转约定偏差在闭环跟踪下不会出现在姿态跟踪残差里
179
+ # (控制器忠实跟随了被污染的参考),只能靠物体在手内的姿态偏差观测到。
180
+ object_ori_residual_gf = np.degrees(
181
+ _mean_axisangle([
182
+ mats[i].T
183
+ @ (_quat_wxyz_to_mat(rec["object_pose"][t, 3:7])
184
+ @ _quat_wxyz_to_mat(gt_obj_traj[t, 3:7]).T)
185
+ @ mats[i]
186
+ for i, t in enumerate(held)
187
+ ])
188
+ ).round(3).tolist()
189
+
190
+ limit_slack = rec["limit_slack"]
191
+ saturated = limit_slack < 0.05 # 距限位 < 0.05rad 视为触限
192
+ joint_vel_max = np.abs(rec["joint_vel"]).max(axis=0)
193
+
194
+ # 失败阶段判定(确定性规则,不用 LLM —— LLM 绝不评判自己是否成功)
195
+ if rec["success"]:
196
+ phase = "success"
197
+ elif grasp_step < 0:
198
+ # 从未抓住:是没走到位,还是走到位了但抓不住
199
+ near = np.linalg.norm(err_gf, axis=1).min() < 0.02
200
+ phase = "no_grasp_despite_reaching" if near else "never_reached"
201
+ elif not grasp[-1]:
202
+ phase = "grasp_lost"
203
+ else:
204
+ phase = "task_failed_while_holding"
205
+
206
+ report = {
207
+ # ---- 结果 ----
208
+ "success": rec["success"],
209
+ "failure_phase": phase,
210
+ "gt_success": gt.success,
211
+ # ---- 位姿跟踪残差(① 几何标定类的证据)----
212
+ "pos_err_mean_mm": float(np.linalg.norm(pos_err, axis=1).mean() * 1000),
213
+ "pos_err_max_mm": float(np.linalg.norm(pos_err, axis=1).max() * 1000),
214
+ # 夹爪坐标系下的恒定偏置:若三个分量里某个显著非零且方差小 => 典型 TCP 偏移问题
215
+ "pos_bias_gripper_frame_mm": (err_gf.mean(axis=0) * 1000).tolist(),
216
+ "pos_bias_gripper_frame_std_mm": (err_gf.std(axis=0) * 1000).tolist(),
217
+ "ori_err_mean_deg": float(np.degrees(rec["ori_err_angle"]).mean()),
218
+ "ori_err_max_deg": float(np.degrees(rec["ori_err_angle"]).max()),
219
+ # 夹爪系下的姿态误差轴角均值:恒定分量说明是坐标轴约定问题
220
+ "ori_bias_gripper_frame_deg": np.degrees(
221
+ rec["ori_err_axisangle_gripper_frame"].mean(axis=0)
222
+ ).round(3).tolist(),
223
+ # ---- 抓取(③ 抓取适配类的证据)----
224
+ "grasp_achieved": grasp_step >= 0,
225
+ "grasp_step": grasp_step,
226
+ "gt_grasp_step": gt.grasp_step,
227
+ "grasp_step_delta": (grasp_step - gt.grasp_step) if grasp_step >= 0 else None,
228
+ "grasp_geometry_gap_m": grasp_geometry_gap,
229
+ "grasp_orientation_gap_deg": grasp_orientation_gap,
230
+ "grasp_duration_ratio": float(np.mean(grasp)),
231
+ # ---- 物体轨迹(与 GT 比对,形态无关的任务不变量)----
232
+ "object_pos_err_mean_mm": float(obj_pos_err.mean() * 1000),
233
+ "object_pos_err_final_mm": float(obj_pos_err[-1] * 1000),
234
+ "object_residual_gripper_frame_mm": object_residual_gf,
235
+ "object_orientation_residual_gripper_frame_deg": object_ori_residual_gf,
236
+ "object_displacement_m": float(
237
+ np.linalg.norm(rec["object_pose"][-1, :3] - rec["object_pose"][0, :3])
238
+ ),
239
+ "gt_object_displacement_m": float(
240
+ np.linalg.norm(gt_obj_traj[-1, :3] - gt_obj_traj[0, :3])
241
+ ),
242
+ # ---- 关节/结构(② 运动学结构类的证据)----
243
+ "joint_limit_saturated_ratio": float(saturated.any(axis=1).mean()),
244
+ "joint_limit_saturated_joints": np.where(saturated.any(axis=0))[0].tolist(),
245
+ "joint_min_slack_rad": limit_slack.min(axis=0).round(4).tolist(),
246
+ "joint_vel_max": joint_vel_max.round(3).tolist(),
247
+ "n_steps": int(len(pos_err)),
248
+ }
249
+
250
+ # ---- IK 阶段遥测(仅 ik_joint 模式)----
251
+ # 与上面的执行残差是两类不同证据:IK 残差大 = 目标位姿在目标本体上够不到(结构不可达),
252
+ # 关节跟踪误差大 = IK 解出来了但关节轨迹执行不下去(通常是关节跳变被限幅)
253
+ if rec["ik_telemetry"] is not None:
254
+ report.update(rec["ik_telemetry"])
255
+ jte = rec["joint_track_err"]
256
+ report["ik_joint_track_err_mean_rad"] = float(np.abs(jte).mean())
257
+ report["ik_joint_track_err_max_rad"] = float(np.abs(jte).max())
258
+
259
+ return report
1500case/source/agent_retarget/perturb.py ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 受控故障注入。
3
+
4
+ 朴素 retarget 在 robosuite 里的 UR5e→Panda 上已经能拿到不低的成功率(Square 0.62),
5
+ 失败模式也比较单一。更重要的是:只看成功率无法回答"agent 的推理买到了什么"——
6
+ CEM 也能提高成功率。
7
+
8
+ 因此在转换管线里注入**已知的**本体差异/标定错误:故障真因、以及理论上的正确补偿
9
+ 都是已知的,于是可以确定性地度量两件事:
10
+ · 诊断准确率:agent 给出的故障类别是否命中真因
11
+ · 修复精度:agent 最终的 Θ 与理论正确补偿的距离
12
+
13
+ 注入的量不属于 Θ,agent 在 prompt 里看不到它,只能从诊断报告里的残差反推。
14
+ 这正是真实场景的处境:URDF 里的 flange 偏移写错了、末端坐标轴约定不一致、
15
+ 夹爪行程映射没标定、控制频率与录制频率不一致 —— 都是"看不见但有迹可循"的。
16
+ """
17
+ from dataclasses import dataclass, field, asdict
18
+ from typing import Tuple
19
+
20
+
21
+ @dataclass
22
+ class Perturbation:
23
+ """注入到转换管线里的已知故障。默认为不注入。"""
24
+
25
+ name: str = "F0_none"
26
+ # 管线误以为的控制点位置(等价于 URDF flange→TCP 偏移写错)
27
+ tcp_offset_error: Tuple[float, float, float] = (0.0, 0.0, 0.0)
28
+ # 末端坐标轴约定错误(轴角,夹爪坐标系)
29
+ rotation_error: Tuple[float, float, float] = (0.0, 0.0, 0.0)
30
+ # 夹爪指令映射未标定
31
+ gripper_scale_error: float = 1.0
32
+ gripper_bias_error: float = 0.0
33
+ # 录制频率与执行频率不一致
34
+ time_scale_error: float = 1.0
35
+
36
+ # ---- 评估用(agent 看不到)----
37
+ ground_truth_category: str = ""
38
+ ground_truth_fix: dict = field(default_factory=dict)
39
+ description: str = ""
40
+
41
+ def to_dict(self):
42
+ return asdict(self)
43
+
44
+ @property
45
+ def is_identity(self):
46
+ return (
47
+ not any(self.tcp_offset_error)
48
+ and not any(self.rotation_error)
49
+ and self.gripper_scale_error == 1.0
50
+ and self.gripper_bias_error == 0.0
51
+ and self.time_scale_error == 1.0
52
+ )
53
+
54
+
55
+ FAULT_SUITE = {
56
+ "F0_none": Perturbation(
57
+ name="F0_none",
58
+ ground_truth_category="",
59
+ ground_truth_fix={},
60
+ description="不注入故障,只有两个本体固有的形态差异",
61
+ ),
62
+ "F1_tcp_offset": Perturbation(
63
+ name="F1_tcp_offset",
64
+ tcp_offset_error=(0.0, 0.0, 0.04),
65
+ ground_truth_category="C1_geometric_calibration",
66
+ ground_truth_fix={"tcp_offset": (0.0, 0.0, -0.04)},
67
+ description="控制点沿夹爪 z 轴写错 4cm(flange→TCP 偏移标定错误)",
68
+ ),
69
+ "F2_axis_convention": Perturbation(
70
+ name="F2_axis_convention",
71
+ rotation_error=(0.0, 0.0, 0.30),
72
+ ground_truth_category="C1_geometric_calibration",
73
+ ground_truth_fix={"tcp_rotation_offset": (0.0, 0.0, -0.30)},
74
+ description="末端绕夹爪 z 轴存在 17 度的坐标轴约定偏差",
75
+ ),
76
+ "F3_gripper_mapping": Perturbation(
77
+ name="F3_gripper_mapping",
78
+ gripper_scale_error=0.30,
79
+ ground_truth_category="C3_gripper_grasp",
80
+ ground_truth_fix={"gripper_command_scale": 1 / 0.30},
81
+ description="夹爪指令行程映射未标定,闭合指令被压缩到 30%",
82
+ ),
83
+ "F4_time_scale": Perturbation(
84
+ name="F4_time_scale",
85
+ time_scale_error=1.6,
86
+ ground_truth_category="C4_action_representation",
87
+ ground_truth_fix={"time_scale": 1 / 1.6},
88
+ description="录制频率与执行频率不一致,轨迹被压缩 1.6 倍",
89
+ ),
90
+ "F5_tcp_and_gripper": Perturbation(
91
+ name="F5_tcp_and_gripper",
92
+ tcp_offset_error=(0.0, 0.03, 0.03),
93
+ gripper_scale_error=0.4,
94
+ ground_truth_category="C1_geometric_calibration+C3_gripper_grasp",
95
+ ground_truth_fix={
96
+ "tcp_offset": (0.0, -0.03, -0.03),
97
+ "gripper_command_scale": 1 / 0.4,
98
+ },
99
+ description="复合故障:控制点偏移 + 夹爪映射未标定(需要多步修复)",
100
+ ),
101
+ }
102
+
103
+
104
+ def get(name):
105
+ if name not in FAULT_SUITE:
106
+ raise KeyError(f"未知故障 '{name}',可用:{sorted(FAULT_SUITE)}")
107
+ return FAULT_SUITE[name]
108
+
109
+
110
+ def fix_distance(cfg, perturb):
111
+ """
112
+ agent 最终的 Θ 与理论正确补偿之间的距离(越小越准)。
113
+ 只比较 ground_truth_fix 里出现的字段。
114
+ """
115
+ import numpy as np
116
+
117
+ if not perturb.ground_truth_fix:
118
+ return None
119
+ out = {}
120
+ for k, target in perturb.ground_truth_fix.items():
121
+ got = np.atleast_1d(np.asarray(getattr(cfg, k), dtype=float))
122
+ want = np.atleast_1d(np.asarray(target, dtype=float))
123
+ out[k] = {
124
+ "target": np.round(want, 5).tolist(),
125
+ "got": np.round(got, 5).tolist(),
126
+ "l2": float(np.linalg.norm(got - want)),
127
+ "relative": float(
128
+ np.linalg.norm(got - want) / max(np.linalg.norm(want), 1e-9)
129
+ ),
130
+ }
131
+ out["mean_relative_error"] = float(
132
+ np.mean([v["relative"] for k, v in out.items() if isinstance(v, dict)])
133
+ )
134
+ return out
135
+
136
+
137
+ def category_hit(predicted_categories, perturb):
138
+ """诊断是否命中真因。复合故障只要命中其中之一即算部分命中。"""
139
+ truth = perturb.ground_truth_category
140
+ if not truth:
141
+ return None
142
+ truth_set = set(truth.split("+"))
143
+ pred_set = set(predicted_categories)
144
+ inter = truth_set & pred_set
145
+ return {
146
+ "ground_truth": sorted(truth_set),
147
+ "predicted": sorted(pred_set),
148
+ "hit": len(inter) > 0,
149
+ "full_hit": truth_set <= pred_set,
150
+ "n_hit": len(inter),
151
+ }
1500case/source/agent_retarget/retarget.py ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 把源本体(UR5e)演示转换成目标本体(Panda)的动作序列。
3
+
4
+ 三种执行模式(对应实验方案表2里的几种执行方式):
5
+ · open_loop :直接把源演示的 delta 动作照搬给目标本体(最朴素的下限参照)
6
+ · pose_tracking :任务空间闭环伺服,IK 隐含在 OSC 控制器内部
7
+ · ik_joint :**显式解 IK** 得到关节轨迹,再在关节空间回放。
8
+ 这是"朴素 IK"基线,也是 agent 修复 IK 配置时使用的模式 ——
9
+ 只有在这个模式下,运动学结构类(Class II)问题才真正存在
10
+
11
+ Θ(RetargetConfig)里的参数在这里生效,默认值等价于"什么都不修"的朴素转换。
12
+ """
13
+ import numpy as np
14
+ import robosuite.utils.transform_utils as T
15
+
16
+ from .config import JOINT_OUTPUT_MAX, RetargetConfig
17
+
18
+ # OSC_POSE 的动作缩放(与 MimicGen 数据集的控制器配置一致)
19
+ POS_OUTPUT_MAX = 0.05 # action=1 对应 5cm 位移
20
+ ORI_OUTPUT_MAX = 0.5 # action=1 对应 0.5rad 旋转
21
+
22
+
23
+ class Retargeter:
24
+ """按 Θ 把源演示映射为目标本体每一步的动作。"""
25
+
26
+ def __init__(self, demo, cfg: RetargetConfig = None, mode="pose_tracking", perturb=None,
27
+ ik_solver=None):
28
+ from .perturb import Perturbation
29
+
30
+ self.demo = demo
31
+ self.cfg = cfg or RetargetConfig()
32
+ self.mode = mode
33
+ # 注入的已知故障:先施加故障,再施加 Θ 的补偿。agent 看不到它。
34
+ self.perturb = perturb or Perturbation()
35
+ self.targets_pos, self.targets_mat = self._build_targets()
36
+ self.gripper_seq = self._build_gripper_seq()
37
+ self.n_steps = len(self.targets_pos)
38
+ # 夹爪首次发出闭合指令的时间步,作为"抓取后阶段"的分界
39
+ closing = np.where(self.gripper_seq > 0)[0]
40
+ self.grasp_close_step = int(closing[0]) if len(closing) else -1
41
+ self._apply_post_grasp_offset()
42
+
43
+ # ik_joint 模式:在执行之前就把整条关节轨迹解出来。
44
+ # 求解遥测(残差/未收敛率/关节跳变)是 Class II 诊断的主要证据来源。
45
+ self.q_traj, self.ik_telemetry = None, None
46
+ if self.mode == "ik_joint":
47
+ if ik_solver is None:
48
+ raise ValueError("ik_joint 模式需要传入 ik_solver")
49
+ self.q_traj, self.ik_telemetry = ik_solver.solve_trajectory(
50
+ self.targets_pos, self.targets_mat, self.cfg
51
+ )
52
+
53
+ # ---------- 目标轨迹构造(含 Θ 里的几何标定与时间重采样) ----------
54
+ def _build_targets(self):
55
+ cfg, pt = self.cfg, self.perturb
56
+ pos = np.array(self.demo.eef_pos)
57
+ mats = np.array(self.demo.eef_mat)
58
+
59
+ # 姿态:先注入约定错误,再叠加 Θ 的补偿(两者都在夹爪坐标系下)
60
+ rot_total = np.array(pt.rotation_error) + np.array(cfg.tcp_rotation_offset)
61
+ if np.any(rot_total != 0):
62
+ R_off = T.quat2mat(T.axisangle2quat(rot_total))
63
+ mats = np.array([m @ R_off for m in mats])
64
+
65
+ # ① 控制点平移:注入的标定错误 + Θ 的补偿(夹爪坐标系下,随姿态旋转)
66
+ off_total = np.array(pt.tcp_offset_error) + np.array(cfg.tcp_offset)
67
+ if np.any(off_total != 0):
68
+ pos = pos + np.einsum("tij,j->ti", mats, off_total)
69
+
70
+ # ① 基座外参偏移(世界系)
71
+ if np.any(np.array(cfg.base_offset) != 0):
72
+ pos = pos + np.array(cfg.base_offset)
73
+
74
+ # ④ 时间重采样:注入的频率错配与 Θ 的补偿相乘
75
+ time_scale = cfg.time_scale * pt.time_scale_error
76
+ if time_scale != 1.0:
77
+ T_src = len(pos)
78
+ T_dst = max(2, int(round(T_src / time_scale)))
79
+ idx = np.clip(np.round(np.linspace(0, T_src - 1, T_dst)).astype(int), 0, T_src - 1)
80
+ pos, mats = pos[idx], mats[idx]
81
+ self._resample_idx = idx
82
+ else:
83
+ self._resample_idx = np.arange(len(pos))
84
+
85
+ return pos, mats
86
+
87
+ def _build_gripper_seq(self):
88
+ cfg, pt = self.cfg, self.perturb
89
+ cmd = np.array(self.demo.gripper_cmd)[self._resample_idx]
90
+ # 先施加注入的夹爪映射错误
91
+ if pt.gripper_scale_error != 1.0 or pt.gripper_bias_error != 0.0:
92
+ cmd = np.clip(pt.gripper_scale_error * cmd + pt.gripper_bias_error, -1.0, 1.0)
93
+ # ③ 抓取时序提前/延后
94
+ if cfg.grasp_lead_steps != 0:
95
+ cmd = np.roll(cmd, -cfg.grasp_lead_steps)
96
+ if cfg.grasp_lead_steps > 0:
97
+ cmd[-cfg.grasp_lead_steps:] = cmd[-cfg.grasp_lead_steps - 1]
98
+ else:
99
+ cmd[: -cfg.grasp_lead_steps] = cmd[-cfg.grasp_lead_steps]
100
+ # ③ 夹爪指令线性重映射
101
+ cmd = np.clip(cfg.gripper_command_scale * cmd + cfg.gripper_command_bias, -1.0, 1.0)
102
+ return cmd
103
+
104
+ def _apply_post_grasp_offset(self):
105
+ """把只作用于抓取后阶段的末端偏移叠加到目标轨迹上(夹爪坐标系)。"""
106
+ off = np.asarray(self.cfg.post_grasp_offset, dtype=float)
107
+ if self.grasp_close_step < 0 or not np.any(off):
108
+ return
109
+ s = self.grasp_close_step
110
+ self.targets_pos[s:] = self.targets_pos[s:] + np.einsum(
111
+ "tij,j->ti", self.targets_mat[s:], off
112
+ )
113
+
114
+ def extra_settle_steps(self, t):
115
+ """在首次闭合夹爪那一步额外停留的控制步数(让夹爪完全合拢再移动)。"""
116
+ if t == self.grasp_close_step:
117
+ return int(self.cfg.settle_steps_at_grasp)
118
+ return 0
119
+
120
+ # ---------- 每步动作 ----------
121
+ def action(self, t, cur_pos=None, cur_mat=None, cur_q=None):
122
+ """
123
+ open_loop : 忽略当前状态,照搬源动作
124
+ pose_tracking : 用当前状态与目标位姿的差算 delta 动作(任务空间)
125
+ ik_joint : 用当前关节角与 IK 解的差算 delta 关节角(关节空间)
126
+ """
127
+ if self.mode == "open_loop":
128
+ a = np.array(self.demo.raw_actions[min(t, len(self.demo.raw_actions) - 1)], dtype=float)
129
+ a[-1] = self.gripper_seq[min(t, self.n_steps - 1)]
130
+ return a
131
+
132
+ if self.mode == "ik_joint":
133
+ ti = min(t, self.n_steps - 1)
134
+ d_q = (self.q_traj[ti] - cur_q) * self.cfg.pos_gain / JOINT_OUTPUT_MAX
135
+ return np.concatenate([np.clip(d_q, -1, 1), [self.gripper_seq[ti]]])
136
+
137
+ ti = min(t, self.n_steps - 1)
138
+ tgt_pos, tgt_mat = self.targets_pos[ti], self.targets_mat[ti]
139
+
140
+ d_pos = (tgt_pos - cur_pos) * self.cfg.pos_gain / POS_OUTPUT_MAX
141
+
142
+ R_err = tgt_mat @ cur_mat.T
143
+ d_ori = T.quat2axisangle(T.mat2quat(R_err)) * self.cfg.ori_gain / ORI_OUTPUT_MAX
144
+
145
+ action = np.concatenate(
146
+ [np.clip(d_pos, -1, 1), np.clip(d_ori, -1, 1), [self.gripper_seq[ti]]]
147
+ )
148
+ return action
1500case/source/agent_retarget/source.py ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 读取 MimicGen 源本体(UR5e)演示,并提取 Track A 需要的 GT。
3
+
4
+ 实现要点:把演示里的完整 MuJoCo 状态在源本体环境里**一次性重放**,同时拿到
5
+ · 源末端控制点(grip_site)的位姿轨迹 —— 这是要被 retarget 的东西
6
+ · 物体位姿轨迹、抓取事件时序、任务成功判定 —— 这是与本体形态无关的 GT
7
+
8
+ 注意不要用 hdf5 里的 `robot0_eef_quat` 观测:它是 right_hand **body** 的姿态,
9
+ 而 OSC 控制器控制的是 grip_**site**,两者相差一个 90° 固定旋转。混用会引入
10
+ 一个恒定姿态偏置(这本身就是"帧约定不一致"类 retarget 失败的典型形态)。
11
+ """
12
+ import json
13
+ from dataclasses import dataclass
14
+ from typing import Dict, Optional
15
+
16
+ import h5py
17
+ import numpy as np
18
+
19
+ from . import envs as E
20
+
21
+
22
+ @dataclass
23
+ class SourceDemo:
24
+ """源本体演示里、retarget 所需要的全部输入。"""
25
+
26
+ demo_key: str
27
+ env_name: str
28
+ source_robot: str
29
+ eef_pos: np.ndarray # (T, 3) grip_site 位置(世界系)
30
+ eef_mat: np.ndarray # (T, 3, 3) grip_site 姿态(世界系)
31
+ gripper_cmd: np.ndarray # (T,) +1 闭合 / -1 张开
32
+ raw_actions: np.ndarray # (T, 7) 源演示原始动作(open_loop baseline 用)
33
+ object_init: Dict[str, np.ndarray]
34
+ n_steps: int
35
+ scene_xml: str = None
36
+
37
+
38
+ @dataclass
39
+ class GTTrace:
40
+ """源演示自身产生的 GT(形态无关的任务不变量)。"""
41
+
42
+ object_traj: Dict[str, np.ndarray] # {joint_name: (T, 7)}
43
+ primary_joint: str # 位移最大的物体自由关节(任务相关物体)
44
+ grasp_flags: np.ndarray # (T,) 是否处于稳定抓取
45
+ grasp_step: int
46
+ release_step: int
47
+ success: Optional[bool] # None: source success was not measured
48
+
49
+
50
+ def collision_geoms_of(env, prefix):
51
+ """按名字前缀取物体的碰撞几何体(排除 _visual)。"""
52
+ return [
53
+ env.sim.model.geom_id2name(i)
54
+ for i in range(env.sim.model.ngeom)
55
+ if (env.sim.model.geom_id2name(i) or "").startswith(prefix)
56
+ and not (env.sim.model.geom_id2name(i) or "").endswith("_visual")
57
+ ]
58
+
59
+
60
+ def _pick_primary_joint(traj, grasp):
61
+ """
62
+ 判定"被操作的物体"。
63
+
64
+ 不能简单用位移最大:robosuite 在 single_object_mode 下会把任务无关的物体
65
+ (如 Square_D0 里的 RoundNut)停放在 (10,10,10) 之外,它掉落产生的位移
66
+ 高达 10m,会盖过真正被操作物体的 0.35m。
67
+ 因此优先用"在源演示中被夹爪稳定抓取过"来判定,抓取时长最久者胜;
68
+ 若都没抓取记录,则退化为在工作空间内(|xy| < 3m)位移最大者。
69
+ """
70
+ grasped = {j: int(g.sum()) for j, g in grasp.items() if g.any()}
71
+ if grasped:
72
+ return max(grasped, key=grasped.get)
73
+ in_ws = {
74
+ j: float(np.linalg.norm(v[-1, :3] - v[0, :3]))
75
+ for j, v in traj.items()
76
+ if np.abs(v[0, :2]).max() < 3.0
77
+ }
78
+ pool = in_ws or {j: float(np.linalg.norm(v[-1, :3] - v[0, :3])) for j, v in traj.items()}
79
+ return max(pool, key=pool.get)
80
+
81
+
82
+ def load_demo(dataset_path, demo_key, source_env):
83
+ """一次重放,同时返回 SourceDemo 与 GTTrace。"""
84
+ with h5py.File(dataset_path, "r") as f:
85
+ d = f["data"][demo_key]
86
+ raw_actions = np.array(d["actions"])
87
+ states = np.array(d["states"])
88
+ model_xml = d.attrs["model_file"]
89
+ env_args = json.loads(f["data"].attrs["env_args"])
90
+
91
+ source_env.reset()
92
+ scene_xml = source_env.edit_model_xml(model_xml)
93
+ source_env.reset_from_xml_string(scene_xml)
94
+ source_env.sim.reset()
95
+ obj_joints = E.discover_object_joints(source_env)
96
+ obj_geoms = {
97
+ j: collision_geoms_of(source_env, j.split("_joint")[0]) for j in obj_joints
98
+ }
99
+
100
+ T_len = len(states)
101
+ eef_pos = np.zeros((T_len, 3))
102
+ eef_mat = np.zeros((T_len, 3, 3))
103
+ traj = {j: np.zeros((T_len, 7)) for j in obj_joints}
104
+ grasp = {j: np.zeros(T_len, dtype=bool) for j in obj_joints}
105
+
106
+ for t in range(T_len):
107
+ source_env.sim.set_state_from_flattened(states[t])
108
+ source_env.sim.forward()
109
+ source_env._get_observations(force_update=True)
110
+ p, m = E.eef_pose(source_env)
111
+ eef_pos[t], eef_mat[t] = p, m
112
+ for j in obj_joints:
113
+ traj[j][t] = source_env.sim.data.get_joint_qpos(j)
114
+ grasp[j][t] = bool(
115
+ source_env._check_grasp(
116
+ gripper=source_env.robots[0].gripper, object_geoms=obj_geoms[j]
117
+ )
118
+ )
119
+
120
+ # Public demonstrations are accepted without a source-task success check.
121
+ from scene_binding import nonrobot_joint_state
122
+ source_env.sim.set_state_from_flattened(states[0]);source_env.sim.forward()
123
+ object_init = nonrobot_joint_state(source_env)
124
+ primary_joint = _pick_primary_joint(traj, grasp)
125
+ gflags = grasp[primary_joint]
126
+ gidx = np.where(gflags)[0]
127
+ grasp_step = int(gidx[0]) if len(gidx) else -1
128
+ release_step = -1
129
+ if grasp_step >= 0:
130
+ after = np.where(~gflags[grasp_step:])[0]
131
+ release_step = int(grasp_step + after[0]) if len(after) else -1
132
+
133
+ source_env.sim.set_state_from_flattened(states[-1])
134
+ source_env.sim.forward()
135
+
136
+ demo = SourceDemo(
137
+ demo_key=demo_key,
138
+ env_name=env_args["env_name"],
139
+ source_robot=env_args["env_kwargs"]["robots"][0],
140
+ eef_pos=eef_pos,
141
+ eef_mat=eef_mat,
142
+ gripper_cmd=raw_actions[:, -1],
143
+ raw_actions=raw_actions,
144
+ object_init=object_init,
145
+ scene_xml=scene_xml,
146
+ n_steps=T_len,
147
+ )
148
+ gt = GTTrace(
149
+ object_traj=traj,
150
+ primary_joint=primary_joint,
151
+ grasp_flags=gflags,
152
+ grasp_step=grasp_step,
153
+ release_step=release_step,
154
+ success=None,
155
+ )
156
+ return demo, gt
1500case/source/agent_retarget/trackc/__init__.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ """Track C: 跨形态双臂 retarget (Cobot Magic → Astribot S1)"""
2
+
3
+ from .robots import cobot_magic_robot, astribot_s1_robot
4
+ from .eval_dualarm import DualArmEvaluator
5
+ from .config_dualarm import DualArmRetargetConfig
6
+ from .source_dualarm import DualArmDemo, load_atombench_episode, load_task_episodes
1500case/source/agent_retarget/trackc/config_dualarm.py ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 多运动链 retarget 配置空间 Θ。
3
+
4
+ 为什么要"按链"而不是"左右臂"
5
+ --------------------------
6
+ retarget 的失败往往是**不对称**的:两条链的目标轨迹落在目标本体工作空间的不同位置,
7
+ 一条够得到、另一条够不到。如果参数只有一份、被复制给所有链,agent 就只能输出
8
+ 对称修复,无法处理这种情况(实测左臂 91.5mm / 右臂 8.0mm 的差距就修不了)。
9
+
10
+ 因此配置分成两层:
11
+ · 按链参数(chains):几何标定、TCP、基座平移、该链的 IK 位姿权重
12
+ · 共享参数(shared):上游链权重、阻尼、迭代预算等 —— 上游只有一份实体,
13
+ 两条链不可能各自给它一个构型,因此这些量必须共享
14
+
15
+ 链用名字索引而不是 left/right 固定字段,这样单臂、双臂、以及将来更多链
16
+ (例如再加一个头部相机链)用同一套代码。
17
+ """
18
+ from dataclasses import dataclass, field
19
+
20
+ from ..config import RetargetConfig
21
+
22
+ #: 共享参数:作用于整个求解而非某一条链。上游链是物理上唯一的实体,
23
+ #: 阻尼/迭代预算/零空间策略也属于整个耦合求解,因此不按链拆分。
24
+ SHARED_IK_FIELDS = (
25
+ "upstream_weight",
26
+ "ik_damping",
27
+ "ik_nullspace_target",
28
+ "ik_nullspace_gain",
29
+ "ik_warm_start",
30
+ "ik_joint_limit_margin",
31
+ "ik_max_iters",
32
+ "ik_tol",
33
+ )
34
+
35
+
36
+ @dataclass
37
+ class MultiChainRetargetConfig:
38
+ """N 条运动链各一套 RetargetConfig + 一组共享参数。"""
39
+
40
+ chains: dict = field(default_factory=dict) # name -> RetargetConfig
41
+ shared: RetargetConfig = field(default_factory=RetargetConfig)
42
+ #: 各链之间的时序同步偏移(正 = 第一条链提前),单位是源时间步
43
+ sync_delay: int = 0
44
+ #: agent 填写的修复历史,仅用于日志
45
+ notes: list = field(default_factory=list)
46
+
47
+ # ------------------------------------------------------------ 链访问
48
+ @property
49
+ def chain_names(self):
50
+ return list(self.chains.keys())
51
+
52
+ def chain(self, name):
53
+ if name not in self.chains:
54
+ raise KeyError(f"没有名为 '{name}' 的运动链,可用:{self.chain_names}")
55
+ return self.chains[name]
56
+
57
+ def with_chain(self, name, new_cfg):
58
+ """返回替换了某条链参数的新配置(不修改原对象)。"""
59
+ chains = dict(self.chains)
60
+ chains[name] = new_cfg
61
+ return MultiChainRetargetConfig(
62
+ chains=chains, shared=self.shared,
63
+ sync_delay=self.sync_delay, notes=list(self.notes),
64
+ )
65
+
66
+ def with_shared(self, new_shared):
67
+ return MultiChainRetargetConfig(
68
+ chains=dict(self.chains), shared=new_shared,
69
+ sync_delay=self.sync_delay, notes=list(self.notes),
70
+ )
71
+
72
+ def effective(self, name):
73
+ """
74
+ 某条链实际生效的完整参数:该链自己的按链参数 + 共享参数覆盖。
75
+
76
+ 求解器与评测器都用这个视图,于是"哪些量是共享的"只在这里定义一次。
77
+ """
78
+ d = self.chain(name).to_dict()
79
+ sd = self.shared.to_dict()
80
+ for k in SHARED_IK_FIELDS:
81
+ d[k] = sd[k]
82
+ return RetargetConfig.from_dict(d)
83
+
84
+ # ------------------------------------------------------------ 序列化
85
+ def to_dict(self):
86
+ return {
87
+ "chains": {k: v.to_dict() for k, v in self.chains.items()},
88
+ "shared": self.shared.to_dict(),
89
+ "sync_delay": self.sync_delay,
90
+ }
91
+
92
+ @classmethod
93
+ def from_dict(cls, d):
94
+ return cls(
95
+ chains={k: RetargetConfig.from_dict(v)
96
+ for k, v in (d.get("chains") or {}).items()},
97
+ shared=RetargetConfig.from_dict(d.get("shared", {})),
98
+ sync_delay=d.get("sync_delay", 0),
99
+ )
100
+
101
+ @classmethod
102
+ def uniform(cls, chain_names, base=None):
103
+ """所有链取同一份初始参数。"""
104
+ base = base or RetargetConfig()
105
+ return cls(
106
+ chains={n: RetargetConfig.from_dict(base.to_dict()) for n in chain_names},
107
+ shared=RetargetConfig.from_dict(base.to_dict()),
108
+ )
109
+
110
+
111
+ # ------------------------------------------------------------------ 兼容别名
112
+ #: 双臂是 N=2 的特例。保留这个名字是为了不改动已有的调用点。
113
+ DualArmRetargetConfig = MultiChainRetargetConfig
114
+
115
+
116
+ def dual_arm_config(left=None, right=None, **kw):
117
+ """按左右臂构造一个两链配置。"""
118
+ left = left or RetargetConfig()
119
+ right = right or RetargetConfig()
120
+ shared = kw.pop("shared", None) or RetargetConfig.from_dict(left.to_dict())
121
+ return MultiChainRetargetConfig(
122
+ chains={"left": left, "right": right}, shared=shared, **kw
123
+ )
1500case/source/agent_retarget/trackc/eval_dualarm.py ADDED
@@ -0,0 +1,701 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ DualArmEvaluator: 在 MuJoCo 仿真中评测双臂 retarget 质量。
3
+
4
+ 核心流程:
5
+ 1. 加载 S1 的 MJCF 模型
6
+ 2. 对每条 CobotMagic 演示,用 IK 把源末端轨迹解成 S1 的关节轨迹
7
+ 3. 在 MuJoCo 中回放关节轨迹,记录末端跟踪误差
8
+ 4. 聚合诊断报告
9
+
10
+ 与 Track A 的 Evaluator 的差异:
11
+ - 纯 MuJoCo(无 robosuite),不依赖 task-specific 成功判定
12
+ - 双臂独立 IK + 合并报告
13
+ - "成功" 定义为末端跟踪误差低于阈值(retarget fidelity)
14
+ """
15
+ import hashlib
16
+ import json
17
+ import multiprocessing as mp
18
+ import os
19
+ from collections import Counter
20
+
21
+ import mujoco
22
+ import numpy as np
23
+
24
+ from ..config import RetargetConfig
25
+ from ..embodiment import Embodiment, chain_reach, normalize_report, trajectory_extent
26
+ from .config_dualarm import DualArmRetargetConfig, MultiChainRetargetConfig
27
+
28
+ #: 本评测器的运动链名字。算子的 scope 就取这些值(外加 "all")。
29
+ CHAIN_NAMES = ("left", "right")
30
+ from .ik_dualarm import DualArmIKSolver, _axisangle_from_mat
31
+ from .robots import DualArmRobot
32
+ from .source_dualarm import DualArmDemo
33
+
34
+ #: 任务成功阈值保持绝对量纲,这是有意的:能否抓住取决于物体尺寸和夹爪开口,
35
+ #: 与手臂多长无关 —— 一条 1.1m 的臂并不因为臂长就有资格用 110mm 的误差抓 30mm 的块。
36
+ POS_SUCCESS_THRESH_M = 0.05
37
+ ORI_SUCCESS_THRESH_DEG = 30.0
38
+
39
+ #: retarget 保真度回答的是另一个问题:"相对本体自身尺度偏了多少"。它只用于跨本体
40
+ #: 比较和喂给 agent 做判据,因此必须无量纲。参考臂展 0.7m 下 ≈70mm / 140mm。
41
+ FIDELITY_TIGHT_REL = 0.10
42
+ FIDELITY_LOOSE_REL = 0.20
43
+
44
+ #: 保真度必须同时约束姿态,否则 ik_rot_weight → 0 是一个免费的退化解:
45
+ #: 求解器彻底放弃姿态后位置能收敛到 0.4mm,位置类判据给满分,而实测夹爪朝向偏 147°。
46
+ #: 实测(dm6/dm7,修正后):cfg=0.15~0.25 时位置 1~3mm、姿态 4°,是真正的内部最优;
47
+ #: cfg→0 时位置继续变好而姿态崩溃。只看位置的判据无法区分这两者,任何搜索都会
48
+ #: 收敛到退化解。角度阈值取绝对量纲,与位置成功阈值同理:能否抓住取决于物体几何。
49
+ FIDELITY_TIGHT_ORI_DEG = 15.0
50
+ FIDELITY_LOOSE_ORI_DEG = 30.0
51
+
52
+ JOINT_OUTPUT_MAX = 0.3 # 关节位置控制单步上限 rad
53
+
54
+
55
+ #: 子进程里的评测器。用模块级变量而不是闭包,是因为 Pool 的任务函数必须可 pickle。
56
+ _POOL_CTX = {}
57
+
58
+
59
+ def _pool_init(source_robot, target_robot, demos, mode, alignment):
60
+ _POOL_CTX["ev"] = DualArmEvaluator(
61
+ source_robot, target_robot, demos, mode=mode,
62
+ cache_evals=False, n_workers=1, verbose=False, alignment=alignment,
63
+ )
64
+
65
+
66
+ def _pool_eval(payload):
67
+ idx, cfg = payload
68
+ ev = _POOL_CTX["ev"]
69
+ demo = ev.demos[idx]
70
+ rep = ev._eval_one(demo, cfg)
71
+ rep["demo"] = demo.demo_key
72
+ return idx, rep
73
+
74
+
75
+ class DualArmEvaluator:
76
+ """
77
+ 评测接口:ev(cfg) -> 聚合报告。
78
+
79
+ 与 SelfEvolvingAgent 兼容所需的接口:
80
+ - __call__(cfg) -> agg dict
81
+ - config_key(cfg, mode, perturb) -> str
82
+ - .mode, .perturb, .n_rollouts, .env_name, .source_robot, .target_robot, .demos
83
+ """
84
+
85
+ def __init__(self, source_robot, target_robot, demos,
86
+ mode="ik_joint", cache_evals=True, n_workers=1, verbose=True, alignment=None):
87
+ self.source_robot = source_robot.name
88
+ self.source_robot_obj = source_robot
89
+ self.target_robot_obj = target_robot
90
+ self.target_robot = target_robot.name
91
+ self.env_name = "mujoco_dualarm_retarget"
92
+ self.mode = mode
93
+ self.demos = demos
94
+ self.n_rollouts = 0
95
+ #: 逐 demo 评测互相独立,可以并行。默认 1(串行)—— 只有显式要求并行的
96
+ #: 调用方才会付出建进程池的代价,其余脚本行为完全不变。
97
+ self.n_workers = max(1, int(n_workers or 1))
98
+ self.verbose = verbose
99
+ self._pool = None
100
+
101
+ # 兼容 agent 代码中对 perturb 的访问
102
+ self.perturb = _DummyPerturb()
103
+
104
+ self._model = None
105
+ self._data = None
106
+ self._ik_solver = None
107
+ self._eval_cache = {} if cache_evals else None
108
+
109
+ self._load_model(target_robot)
110
+ self.embodiment = self._describe_embodiment(source_robot, target_robot, demos)
111
+ self.init_base_offset_left, self.init_base_offset_right = (
112
+ self._compute_init_base_offset(demos) if alignment is None else
113
+ (tuple(alignment["left"]), tuple(alignment["right"])))
114
+
115
+ def _say(self, msg):
116
+ """构造期日志。子进程里的评测器静音,否则每个 worker 都会重复刷一遍。"""
117
+ if self.verbose:
118
+ print(msg, flush=True)
119
+
120
+ def _upstream_qpos_adr(self):
121
+ """上游链在 qpos 里的下标;没有上游自由度时返回 None。"""
122
+ up = self._ik_solver.coupled.upstream
123
+ return up.qpos_adr if up.n else None
124
+
125
+ def _describe_embodiment(self, source_robot, target_robot, demos):
126
+ """
127
+ 量出本体对的无量纲描述符。全部来自运动学与演示数据,不查机型表。
128
+
129
+ 两端的尺度都用运动学链算的臂展,reach_ratio 才是真正的"臂展比"。拿不到源模型
130
+ 时才退化成演示轨迹跨度,并把 source_scale_is_reach 置 False 如实标注 —— 那种
131
+ 情况下比值混了本体尺度和任务尺度,下游不该当臂展比用。
132
+ 演示跨度另存为 task_extent_m:它描述任务而非本体,是另一个维度的信息。
133
+ """
134
+ reaches = [
135
+ chain_reach(self._model, self._data, arm.joint_names, arm.ee_site_name)
136
+ for arm in (target_robot.left_arm, target_robot.right_arm)
137
+ ]
138
+ reaches = [r for r in reaches if r]
139
+ target_scale = float(np.mean(reaches)) if reaches else None
140
+
141
+ task_extent = trajectory_extent(
142
+ [d.left_eef_pos for d in demos if d.left_eef_pos is not None]
143
+ + [d.right_eef_pos for d in demos if d.right_eef_pos is not None]
144
+ )
145
+ source_scale = self._source_reach(source_robot)
146
+ source_is_reach = source_scale is not None
147
+ if not source_is_reach:
148
+ source_scale = task_extent
149
+
150
+ emb = Embodiment(
151
+ scale_m=target_scale or Embodiment.scale_m,
152
+ source_scale_m=source_scale,
153
+ source_scale_is_reach=source_is_reach,
154
+ task_extent_m=task_extent,
155
+ dof_target=target_robot.left_arm.n_joints,
156
+ dof_source=source_robot.left_arm.n_joints,
157
+ n_chains=2,
158
+ upstream_dof=self._ik_solver.n_upstream,
159
+ source_name=source_robot.name,
160
+ target_name=target_robot.name,
161
+ )
162
+ src_kind = "源臂展" if source_is_reach else "源尺度(退化=任务跨度)"
163
+ self._say(f"[DualArmEvaluator] 本体描述符: 臂展={emb.scale_m:.3f}m "
164
+ f"{src_kind}={source_scale and round(source_scale, 3)} "
165
+ f"reach_ratio={emb.reach_ratio} dof_diff={emb.dof_diff} "
166
+ f"任务跨度/臂展={emb.task_extent_rel} "
167
+ f"上游自由度={emb.upstream_dof}")
168
+ return emb
169
+
170
+ @staticmethod
171
+ def _source_reach(source_robot):
172
+ """从源本体 MJCF 量臂展。源模型常常只给单臂、关节名也与双臂命名不同,
173
+ 因此按名字取不到时退回到模型里的全部铰接关节。"""
174
+ path = getattr(source_robot, "mjcf_path", None)
175
+ if not path or not os.path.exists(path):
176
+ return None
177
+ try:
178
+ model = mujoco.MjModel.from_xml_path(path)
179
+ except Exception:
180
+ return None
181
+ data = mujoco.MjData(model)
182
+
183
+ reaches = []
184
+ for arm in (source_robot.left_arm, source_robot.right_arm):
185
+ names = [n for n in arm.joint_names
186
+ if mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_JOINT, n) >= 0]
187
+ if len(names) < 2:
188
+ names = [mujoco.mj_id2name(model, mujoco.mjtObj.mjOBJ_JOINT, j)
189
+ for j in range(model.njnt)
190
+ if model.jnt_type[j] in (mujoco.mjtJoint.mjJNT_HINGE,
191
+ mujoco.mjtJoint.mjJNT_SLIDE)]
192
+ names = names[:arm.n_joints]
193
+ r = chain_reach(model, data, names, arm.ee_site_name)
194
+ if r:
195
+ reaches.append(r)
196
+ return float(np.mean(reaches)) if reaches else None
197
+
198
+ def _compute_init_base_offset(self, demos):
199
+ """自动计算左/右臂各自的初始 base_offset,将源轨迹中心对齐到目标 EE 默认位置。
200
+
201
+ 跨形态 retarget 的核心难点:两个机器人的工作空间在世界坐标系下完全不同,
202
+ 且左右臂的偏移量也不同(机器人结构不同导致)。
203
+ """
204
+ mujoco.mj_resetData(self._model, self._data)
205
+ mujoco.mj_forward(self._model, self._data)
206
+
207
+ left_sid = mujoco.mj_name2id(
208
+ self._model, mujoco.mjtObj.mjOBJ_SITE,
209
+ self.target_robot_obj.left_arm.ee_site_name)
210
+ right_sid = mujoco.mj_name2id(
211
+ self._model, mujoco.mjtObj.mjOBJ_SITE,
212
+ self.target_robot_obj.right_arm.ee_site_name)
213
+ tgt_left = self._data.site_xpos[left_sid].copy()
214
+ tgt_right = self._data.site_xpos[right_sid].copy()
215
+
216
+ src_left = np.mean([d.left_eef_pos.mean(axis=0) for d in demos
217
+ if d.left_eef_pos is not None], axis=0)
218
+ src_right = np.mean([d.right_eef_pos.mean(axis=0) for d in demos
219
+ if d.right_eef_pos is not None], axis=0)
220
+
221
+ left_offset = tuple(np.round(tgt_left - src_left, 4).tolist())
222
+ right_offset = tuple(np.round(tgt_right - src_right, 4).tolist())
223
+
224
+ self._say(f"[DualArmEvaluator] 自动 base_offset: "
225
+ f"左={list(left_offset)}, 右={list(right_offset)}")
226
+ return left_offset, right_offset
227
+
228
+ def make_init_cfg(self):
229
+ """
230
+ 初始 Θ:每条链一份默认参数 + 一份共享参数。
231
+
232
+ base_offset 从 0 起步 —— 两个本体之间的大尺度工作空间错位由
233
+ _apply_offsets 里的分链初始偏移承担,agent 的 base_offset 是在此之上的增量。
234
+ """
235
+ return MultiChainRetargetConfig.uniform(CHAIN_NAMES)
236
+
237
+ def _load_model(self, robot):
238
+ mjcf_path = robot.mjcf_path
239
+ if not os.path.exists(mjcf_path):
240
+ raise FileNotFoundError(f"MJCF 不存在: {mjcf_path}")
241
+ self._model = mujoco.MjModel.from_xml_path(mjcf_path)
242
+ self._data = mujoco.MjData(self._model)
243
+ self._ik_solver = DualArmIKSolver(
244
+ self._model, self._data, robot,
245
+ )
246
+
247
+ def __call__(self, cfg, mode=None):
248
+ """评测一个配置。cfg 可以是多链配置,也可以是单份 RetargetConfig(各链取同值)。"""
249
+ if isinstance(cfg, RetargetConfig):
250
+ cfg = MultiChainRetargetConfig.uniform(CHAIN_NAMES, cfg)
251
+
252
+ mode = mode or self.mode
253
+ key = self.config_key(cfg, mode, self.perturb)
254
+ if self._eval_cache is not None and key in self._eval_cache:
255
+ return self._eval_cache[key]
256
+
257
+ if self.n_workers > 1 and len(self.demos) > 1:
258
+ reports = self._eval_all_parallel(cfg)
259
+ else:
260
+ reports = []
261
+ for demo in self.demos:
262
+ rep = self._eval_one(demo, cfg)
263
+ rep["demo"] = demo.demo_key
264
+ reports.append(rep)
265
+ self.n_rollouts += len(reports)
266
+
267
+ agg = self._aggregate(reports)
268
+ agg["mode"] = mode
269
+ agg["env"] = self.env_name
270
+ agg["source_robot"] = self.source_robot
271
+ agg["target_robot"] = self.target_robot
272
+ agg["n_demos"] = len(reports)
273
+ # 本体描述符 + 长度量的无量纲版本:守卫、参数范围与经验签名都以它们为准
274
+ agg.update(self.embodiment.descriptor_fields())
275
+ normalize_report(agg, self.embodiment.scale_m)
276
+ agg["_per_demo"] = reports
277
+ if self._eval_cache is not None:
278
+ self._eval_cache[key] = agg
279
+ return agg
280
+
281
+ # ------------------------------------------------------------ 并行评测
282
+ def _get_pool(self):
283
+ """惰性建池。子进程各自持有一份 MuJoCo 模型 —— MjData 是可变状态,不能共享。"""
284
+ if self._pool is None:
285
+ ctx = mp.get_context("fork")
286
+ self._pool = ctx.Pool(
287
+ self.n_workers, initializer=_pool_init,
288
+ initargs=(self.source_robot_obj, self.target_robot_obj,
289
+ self.demos, self.mode, {"left": self.init_base_offset_left, "right": self.init_base_offset_right}),
290
+ )
291
+ return self._pool
292
+
293
+ def _eval_all_parallel(self, cfg):
294
+ """并行跑完所有 demo。按下标回排,保证与串行完全同序、可复现。"""
295
+ pool = self._get_pool()
296
+ payload = [(i, cfg) for i in range(len(self.demos))]
297
+ out = pool.map(_pool_eval, payload, chunksize=1)
298
+ out.sort(key=lambda t: t[0])
299
+ return [rep for _, rep in out]
300
+
301
+ def close(self):
302
+ if self._pool is not None:
303
+ self._pool.terminate()
304
+ self._pool.join()
305
+ self._pool = None
306
+
307
+ def _apply_offsets(self, eef_pos, eef_mat, arm_cfg, arm_init_offset):
308
+ """将偏置应用到目标末端轨迹上。
309
+
310
+ arm_init_offset: 自动计算的分臂初始偏移(常数,补偿两个机器人的基座位置差异)
311
+ arm_cfg.base_offset: agent 设置的额外增量
312
+ arm_cfg.tcp_offset: TCP 偏移(补偿末端工具坐标系差异)
313
+ arm_cfg.tcp_rotation_offset: TCP 旋转偏移
314
+ """
315
+ pos = eef_pos.copy()
316
+ mat = eef_mat.copy()
317
+
318
+ total_base_off = np.array(arm_init_offset) + np.array(arm_cfg.base_offset)
319
+ tcp_off = np.array(arm_cfg.tcp_offset)
320
+ tcp_rot = np.array(arm_cfg.tcp_rotation_offset)
321
+
322
+ if np.any(total_base_off != 0):
323
+ pos = pos + total_base_off
324
+
325
+ if np.any(tcp_off != 0):
326
+ for t in range(len(pos)):
327
+ pos[t] = pos[t] + mat[t] @ tcp_off
328
+
329
+ if np.any(tcp_rot != 0):
330
+ from .ik_dualarm import _euler_to_mat_rpy
331
+ R_tcp = _euler_to_mat_rpy(tcp_rot)
332
+ for t in range(len(mat)):
333
+ mat[t] = mat[t] @ R_tcp
334
+
335
+ return pos, mat
336
+
337
+ def _eval_one(self, demo, cfg):
338
+ """评测单条演示"""
339
+ if demo.left_eef_pos is None or demo.right_eef_pos is None:
340
+ return self._empty_report(demo, "no_eef_data")
341
+
342
+ # 重置 MuJoCo 状态
343
+ mujoco.mj_resetData(self._model, self._data)
344
+ mujoco.mj_forward(self._model, self._data)
345
+
346
+ # 各链实际生效的参数 = 该链自己的按链参数 + 共享参数覆盖
347
+ left_cfg = cfg.effective("left")
348
+ right_cfg = cfg.effective("right")
349
+
350
+ # 应用坐标变换(先叠加自动计算的分链初始偏移,再叠加 agent 的增量)
351
+ left_pos, left_mat = self._apply_offsets(
352
+ demo.left_eef_pos, demo.left_eef_mat, left_cfg,
353
+ self.init_base_offset_left)
354
+ right_pos, right_mat = self._apply_offsets(
355
+ demo.right_eef_pos, demo.right_eef_mat, right_cfg,
356
+ self.init_base_offset_right)
357
+
358
+ # 上游链被两条臂共享,必须耦合求解;各链的位姿权重仍然独立
359
+ left_q, right_q, left_telem, right_telem, up_q, up_telem = \
360
+ self._ik_solver.solve_dual(
361
+ left_pos, left_mat, right_pos, right_mat,
362
+ cfg.shared, left_cfg, right_cfg)
363
+
364
+ if not (np.isfinite(left_q).all() and np.isfinite(right_q).all() and np.isfinite(up_q).all()):
365
+ return self._empty_report(demo, "safety_nonfinite")
366
+
367
+ # 在 MuJoCo 中回放 IK 解出的关节轨迹(使用变换后的目标轨迹计算误差)
368
+ left_rec = self._replay_arm(
369
+ left_q, left_pos, left_mat,
370
+ self._ik_solver.left, left_cfg, up_q,
371
+ )
372
+ right_rec = self._replay_arm(
373
+ right_q, right_pos, right_mat,
374
+ self._ik_solver.right, right_cfg, up_q,
375
+ )
376
+
377
+ # 组装报告
378
+ left_ori_ok = left_rec["ori_err_mean_deg"] < ORI_SUCCESS_THRESH_DEG
379
+ right_ori_ok = right_rec["ori_err_mean_deg"] < ORI_SUCCESS_THRESH_DEG
380
+ # 成功必须位置与姿态同时达标。只看位置的话 ik_rot_weight → 0 是免费的退化解:
381
+ # 位置收敛到 0.4mm、姿态偏 147°,而 score() 里 success_rate 权重 1000 远大于
382
+ # 有界的姿态保真度项,于是任何搜索都会主动放弃姿态去换成功率。
383
+ left_success = (left_rec["pos_err_mean_mm"] < POS_SUCCESS_THRESH_M * 1000
384
+ and left_ori_ok)
385
+ right_success = (right_rec["pos_err_mean_mm"] < POS_SUCCESS_THRESH_M * 1000
386
+ and right_ori_ok)
387
+ from tabletop_scene import check_trajectory
388
+ constraints = check_trajectory(self, left_q, right_q, up_q)
389
+ safety_reject = left_rec["safety_reject"] or right_rec["safety_reject"] or constraints["deployment_constraint_reject"]
390
+ success = left_success and right_success and not safety_reject
391
+ worst_pos_rel = max(left_rec["pos_err_mean_mm"],
392
+ right_rec["pos_err_mean_mm"]) / (
393
+ self.embodiment.scale_m * 1000.0)
394
+ worst_ori_deg = max(left_rec["ori_err_mean_deg"],
395
+ right_rec["ori_err_mean_deg"])
396
+
397
+ if success:
398
+ phase = "success"
399
+ elif not left_success and not right_success:
400
+ phase = "both_arms_failed"
401
+ elif not left_success:
402
+ phase = "left_arm_failed"
403
+ else:
404
+ phase = "right_arm_failed"
405
+
406
+ world_bias = [
407
+ (l + r) / 2 for l, r in
408
+ zip(left_rec["pos_bias_world_mm"], right_rec["pos_bias_world_mm"])
409
+ ]
410
+
411
+ if constraints["deployment_constraint_reject"]:
412
+ phase = "table_collision" if constraints["table_collision_fraction"] else "joint_path_discontinuity_or_waist"
413
+ report = {
414
+ "success": success,
415
+ "safety_reject": safety_reject,
416
+ "gripper_event_timing_steps": None,
417
+ "gripper_timing_status": "not_simulated",
418
+ "gt_success": True,
419
+ "failure_phase": phase,
420
+ "success_ori_ok": left_ori_ok and right_ori_ok,
421
+ "fidelity_tight": (worst_pos_rel < FIDELITY_TIGHT_REL
422
+ and worst_ori_deg < FIDELITY_TIGHT_ORI_DEG),
423
+ "fidelity_loose": (worst_pos_rel < FIDELITY_LOOSE_REL
424
+ and worst_ori_deg < FIDELITY_LOOSE_ORI_DEG),
425
+ # 只看位置的旧判据留作诊断:与保真度的差值直接暴露"位置好但姿态崩"的退化解
426
+ "fidelity_tight_pos_only": worst_pos_rel < FIDELITY_TIGHT_REL,
427
+ "worst_pos_err_rel": round(worst_pos_rel, 6),
428
+ "worst_ori_err_deg": round(worst_ori_deg, 4),
429
+ # 左臂
430
+ "left_pos_err_mean_mm": left_rec["pos_err_mean_mm"],
431
+ "left_pos_err_max_mm": left_rec["pos_err_max_mm"],
432
+ "left_ori_err_mean_deg": left_rec["ori_err_mean_deg"],
433
+ "left_ori_err_max_deg": left_rec["ori_err_max_deg"],
434
+ "left_pos_bias_gripper_frame_mm": left_rec["pos_bias_gf_mm"],
435
+ "left_pos_bias_world_mm": left_rec["pos_bias_world_mm"],
436
+ # 右臂
437
+ "right_pos_err_mean_mm": right_rec["pos_err_mean_mm"],
438
+ "right_pos_err_max_mm": right_rec["pos_err_max_mm"],
439
+ "right_ori_err_mean_deg": right_rec["ori_err_mean_deg"],
440
+ "right_ori_err_max_deg": right_rec["ori_err_max_deg"],
441
+ "right_pos_bias_gripper_frame_mm": right_rec["pos_bias_gf_mm"],
442
+ "right_pos_bias_world_mm": right_rec["pos_bias_world_mm"],
443
+ # 综合
444
+ "pos_err_mean_mm": (left_rec["pos_err_mean_mm"] + right_rec["pos_err_mean_mm"]) / 2,
445
+ "pos_err_max_mm": max(left_rec["pos_err_max_mm"], right_rec["pos_err_max_mm"]),
446
+ "ori_err_mean_deg": (left_rec["ori_err_mean_deg"] + right_rec["ori_err_mean_deg"]) / 2,
447
+ "ori_err_max_deg": max(left_rec["ori_err_max_deg"], right_rec["ori_err_max_deg"]),
448
+ "pos_bias_gripper_frame_mm": [
449
+ (l + r) / 2 for l, r in
450
+ zip(left_rec["pos_bias_gf_mm"], right_rec["pos_bias_gf_mm"])
451
+ ],
452
+ "pos_bias_world_mm": world_bias,
453
+ # 关节
454
+ "joint_limit_saturated_ratio": (
455
+ left_rec["joint_limit_sat_ratio"] + right_rec["joint_limit_sat_ratio"]
456
+ ) / 2,
457
+ "joint_limit_saturated_joints": (
458
+ left_rec["sat_joints"] + right_rec["sat_joints"]
459
+ ),
460
+ "joint_vel_max": left_rec.get("joint_vel_max", []) + right_rec.get("joint_vel_max", []),
461
+ # IK 遥测
462
+ **{f"left_{k}": v for k, v in left_telem.items()},
463
+ **{f"right_{k}": v for k, v in right_telem.items()},
464
+ # 上游链(躯干 / 将来的移动底座)使用情况
465
+ **up_telem,
466
+ # 合并 IK 遥测
467
+ "ik_pos_residual_mean_mm": (
468
+ left_telem["ik_pos_residual_mean_mm"] + right_telem["ik_pos_residual_mean_mm"]
469
+ ) / 2,
470
+ "ik_pos_residual_max_mm": max(
471
+ left_telem["ik_pos_residual_max_mm"], right_telem["ik_pos_residual_max_mm"]
472
+ ),
473
+ "ik_rot_residual_mean_deg": (
474
+ left_telem["ik_rot_residual_mean_deg"] + right_telem["ik_rot_residual_mean_deg"]
475
+ ) / 2,
476
+ "ik_unconverged_ratio": (
477
+ left_telem["ik_unconverged_ratio"] + right_telem["ik_unconverged_ratio"]
478
+ ) / 2,
479
+ "ik_iters_mean": (
480
+ left_telem["ik_iters_mean"] + right_telem["ik_iters_mean"]
481
+ ) / 2,
482
+ "ik_joint_jump_max_rad": max(
483
+ left_telem["ik_joint_jump_max_rad"], right_telem["ik_joint_jump_max_rad"]
484
+ ),
485
+ "ik_n_large_joint_jumps": (
486
+ left_telem["ik_n_large_joint_jumps"] + right_telem["ik_n_large_joint_jumps"]
487
+ ),
488
+ "ik_min_singular_value": min(
489
+ left_telem["ik_min_singular_value"] or float("inf"),
490
+ right_telem["ik_min_singular_value"] or float("inf"),
491
+ ),
492
+ "ik_solution_limit_hit_ratio": (
493
+ left_telem["ik_solution_limit_hit_ratio"]
494
+ + right_telem["ik_solution_limit_hit_ratio"]
495
+ ) / 2,
496
+ "n_steps": demo.n_steps,
497
+ "ori_bias_gripper_frame_deg": [0.0, 0.0, 0.0],
498
+ }
499
+ report.update(constraints)
500
+ return report
501
+
502
+ def _replay_arm(self, q_traj, tgt_pos, tgt_mat, arm_ik, cfg, up_q=None):
503
+ """
504
+ 回放一条臂的 IK 关节轨迹并记录跟踪误差。
505
+
506
+ up_q 是同一帧的上游(躯干/底座)构型。必须一起写进 qpos 再算正运动学 ——
507
+ 上游被启用后手臂基座已经被搬动过,若按零位做 FK,测出来的会是另一台机器人的误差。
508
+ """
509
+ pos_errs, ori_errs = [], []
510
+ pos_errs_gf = []
511
+ pos_errs_world = []
512
+ T = len(q_traj)
513
+ up_adr = self._upstream_qpos_adr()
514
+
515
+ for t in range(T):
516
+ if up_adr is not None and up_q is not None and len(up_q) > t:
517
+ self._data.qpos[up_adr] = up_q[t]
518
+ pos, mat = arm_ik.forward_kinematics(q_traj[t])
519
+ err = pos - tgt_pos[t]
520
+ pos_errs.append(np.linalg.norm(err))
521
+ pos_errs_gf.append(mat.T @ err)
522
+ pos_errs_world.append(err)
523
+ R_err = tgt_mat[t] @ mat.T
524
+ ori_errs.append(np.linalg.norm(_axisangle_from_mat(R_err)))
525
+
526
+ pos_errs = np.array(pos_errs)
527
+ ori_errs = np.array(ori_errs)
528
+ pos_errs_gf = np.array(pos_errs_gf)
529
+ pos_errs_world = np.array(pos_errs_world)
530
+
531
+ # 关节限位
532
+ slack = np.minimum(
533
+ q_traj - arm_ik.jnt_range[:, 0],
534
+ arm_ik.jnt_range[:, 1] - q_traj,
535
+ )
536
+ sat = slack < 0.05
537
+ sat_ratio = float(sat.any(axis=1).mean()) if T > 0 else 0.0
538
+ sat_joints = np.where(sat.any(axis=0))[0].tolist()
539
+
540
+ # 关节速度
541
+ if T > 1:
542
+ dq = np.diff(q_traj, axis=0)
543
+ joint_vel_max = np.abs(dq).max(axis=0).round(3).tolist()
544
+ else:
545
+ joint_vel_max = [0.0] * arm_ik.n
546
+
547
+ return {
548
+ "pos_err_mean_mm": float(pos_errs.mean() * 1000),
549
+ "pos_err_max_mm": float(pos_errs.max() * 1000),
550
+ "ori_err_mean_deg": float(np.degrees(ori_errs).mean()),
551
+ "ori_err_max_deg": float(np.degrees(ori_errs).max()),
552
+ "pos_bias_gf_mm": (pos_errs_gf.mean(axis=0) * 1000).round(3).tolist(),
553
+ "pos_bias_gf_std_mm": (pos_errs_gf.std(axis=0) * 1000).round(3).tolist(),
554
+ "pos_bias_world_mm": (pos_errs_world.mean(axis=0) * 1000).round(3).tolist(),
555
+ "joint_limit_sat_ratio": sat_ratio,
556
+ "sat_joints": sat_joints,
557
+ "safety_reject": bool(np.any(slack < -1e-6)),
558
+ "joint_vel_max": joint_vel_max,
559
+ }
560
+
561
+ def _empty_report(self, demo, reason):
562
+ return {
563
+ "success": False,
564
+ "safety_reject": reason.startswith("safety_"),
565
+ "gt_success": True,
566
+ "failure_phase": reason,
567
+ "pos_err_mean_mm": 999.0,
568
+ "pos_err_max_mm": 999.0,
569
+ "ori_err_mean_deg": 999.0,
570
+ "ori_err_max_deg": 999.0,
571
+ "pos_bias_gripper_frame_mm": [0.0, 0.0, 0.0],
572
+ "pos_bias_world_mm": [0.0, 0.0, 0.0],
573
+ "ori_bias_gripper_frame_deg": [0.0, 0.0, 0.0],
574
+ "fidelity_tight": False,
575
+ "fidelity_loose": False,
576
+ "fidelity_tight_pos_only": False,
577
+ "worst_ori_err_deg": 999.0,
578
+ "success_ori_ok": False,
579
+ "joint_limit_saturated_ratio": 0.0,
580
+ "joint_limit_saturated_joints": [],
581
+ "joint_vel_max": [],
582
+ "n_steps": demo.n_steps,
583
+ }
584
+
585
+ @staticmethod
586
+ def _aggregate(reports):
587
+ """聚合多条 demo 的报告"""
588
+ def _mean(key):
589
+ vals = [r[key] for r in reports if r.get(key) is not None]
590
+ return float(np.mean(vals)) if vals else None
591
+
592
+ def _vec_mean(key):
593
+ vals = [r[key] for r in reports if r.get(key) is not None]
594
+ return np.array(vals).mean(axis=0).round(4).tolist() if vals else None
595
+
596
+ def _vec_std(key):
597
+ vals = [r[key] for r in reports if r.get(key) is not None]
598
+ return np.array(vals).std(axis=0).round(4).tolist() if vals else None
599
+
600
+ return {
601
+ "table_collision_fraction": _mean("table_collision_fraction"),
602
+ "table_penetration_max_mm": max((r.get("table_penetration_max_mm",0.) for r in reports),default=0.),
603
+ "joint_path_jump_max_rad": max((r.get("joint_path_jump_max_rad",0.) for r in reports),default=0.),
604
+ "waist_constraint_residual_rad": max((r.get("waist_constraint_residual_rad",0.) for r in reports),default=0.),
605
+ "deployment_constraint_reject_rate": _mean("deployment_constraint_reject"),
606
+ "scene_version": "v14_assumed_table",
607
+ "success_rate": float(np.mean([r["success"] for r in reports])),
608
+ "safety_reject_rate": float(np.mean([r.get("safety_reject", False) for r in reports])),
609
+ "gripper_event_timing_steps": None,
610
+ "gt_success_rate": float(np.mean([r["gt_success"] for r in reports])),
611
+ "grasp_rate": None,
612
+ "failure_phases": dict(Counter(r["failure_phase"] for r in reports)),
613
+ "worst_pos_err_rel": float(np.mean(
614
+ [r.get("worst_pos_err_rel") or 0.0 for r in reports])),
615
+ "worst_ori_err_deg": float(np.mean(
616
+ [r.get("worst_ori_err_deg") or 0.0 for r in reports])),
617
+ "fidelity_rate_tight": float(np.mean(
618
+ [r.get("fidelity_tight", False) for r in reports])),
619
+ "fidelity_rate_loose": float(np.mean(
620
+ [r.get("fidelity_loose", False) for r in reports])),
621
+ "fidelity_rate_tight_pos_only": float(np.mean(
622
+ [r.get("fidelity_tight_pos_only", False) for r in reports])),
623
+ "success_rate_ori_ok": float(np.mean(
624
+ [r.get("success_ori_ok", False) for r in reports])),
625
+ # 综合
626
+ "pos_err_mean_mm": _mean("pos_err_mean_mm"),
627
+ "pos_err_max_mm": _mean("pos_err_max_mm"),
628
+ "ori_err_mean_deg": _mean("ori_err_mean_deg"),
629
+ "ori_err_max_deg": _mean("ori_err_max_deg"),
630
+ "pos_bias_gripper_frame_mm": _vec_mean("pos_bias_gripper_frame_mm"),
631
+ "pos_bias_gripper_frame_std_across_demos_mm": _vec_std("pos_bias_gripper_frame_mm"),
632
+ "pos_bias_world_mm": _vec_mean("pos_bias_world_mm"),
633
+ "pos_bias_world_std_across_demos_mm": _vec_std("pos_bias_world_mm"),
634
+ "ori_bias_gripper_frame_deg": _vec_mean("ori_bias_gripper_frame_deg"),
635
+ "ori_bias_gripper_frame_std_deg": _vec_std("ori_bias_gripper_frame_deg"),
636
+ # 左臂
637
+ "left_pos_err_mean_mm": _mean("left_pos_err_mean_mm"),
638
+ "left_ori_err_mean_deg": _mean("left_ori_err_mean_deg"),
639
+ "left_pos_bias_world_mm": _vec_mean("left_pos_bias_world_mm"),
640
+ "left_pos_bias_world_std_across_demos_mm": _vec_std("left_pos_bias_world_mm"),
641
+ # 右臂
642
+ "right_pos_err_mean_mm": _mean("right_pos_err_mean_mm"),
643
+ "right_ori_err_mean_deg": _mean("right_ori_err_mean_deg"),
644
+ "right_pos_bias_world_mm": _vec_mean("right_pos_bias_world_mm"),
645
+ "right_pos_bias_world_std_across_demos_mm": _vec_std("right_pos_bias_world_mm"),
646
+ # 关节
647
+ "joint_limit_saturated_ratio": _mean("joint_limit_saturated_ratio"),
648
+ "joint_limit_saturated_joints": sorted(
649
+ {j for r in reports for j in r.get("joint_limit_saturated_joints", [])}
650
+ ),
651
+ # IK
652
+ "ik_pos_residual_mean_mm": _mean("ik_pos_residual_mean_mm"),
653
+ "ik_pos_residual_max_mm": _mean("ik_pos_residual_max_mm"),
654
+ "ik_rot_residual_mean_deg": _mean("ik_rot_residual_mean_deg"),
655
+ "ik_rot_residual_max_deg": _mean("ik_rot_residual_max_deg"),
656
+ "ik_unconverged_ratio": _mean("ik_unconverged_ratio"),
657
+ "ik_iters_mean": _mean("ik_iters_mean"),
658
+ "ik_joint_jump_max_rad": _mean("ik_joint_jump_max_rad"),
659
+ "ik_joint_jump_per_joint_rad": _vec_mean("ik_joint_jump_per_joint_rad"),
660
+ "ik_n_large_joint_jumps": _mean("ik_n_large_joint_jumps"),
661
+ "ik_min_singular_value": _mean("ik_min_singular_value"),
662
+ "ik_solution_min_slack_rad": _vec_mean("ik_solution_min_slack_rad"),
663
+ "ik_solution_limit_hit_ratio": _mean("ik_solution_limit_hit_ratio"),
664
+ "ik_joint_track_err_mean_rad": None,
665
+ "ik_joint_track_err_max_rad": None,
666
+ # 上游链(躯干 / 将来的移动底座)
667
+ "upstream_engaged": bool(any(
668
+ r.get("upstream_engaged") for r in reports)),
669
+ "upstream_range_used_ratio": _mean("upstream_range_used_ratio"),
670
+ "upstream_travel_rad": _mean("upstream_travel_rad"),
671
+ "upstream_step_max_rad": _mean("upstream_step_max_rad"),
672
+ }
673
+
674
+ @staticmethod
675
+ def config_key(cfg, mode=None, perturb=None):
676
+ if isinstance(cfg, DualArmRetargetConfig):
677
+ d = cfg.to_dict()
678
+ elif isinstance(cfg, RetargetConfig):
679
+ d = cfg.to_dict()
680
+ else:
681
+ d = cfg
682
+ d_clean = {k: v for k, v in d.items() if k != "notes"}
683
+ pt = perturb.name if perturb is not None else "F0_none"
684
+ return hashlib.md5(
685
+ json.dumps({"cfg": d_clean, "mode": mode or "ik_joint", "perturb": pt},
686
+ sort_keys=True, default=str).encode()
687
+ ).hexdigest()
688
+
689
+ def close(self):
690
+ if self._pool is not None:
691
+ self._pool.terminate()
692
+ self._pool.join()
693
+ self._pool = None
694
+ self._model = None
695
+ self._data = None
696
+
697
+
698
+ class _DummyPerturb:
699
+ """兼容 agent 代码中对 perturb 属性的访问"""
700
+ name = "F0_none"
701
+ is_identity = True
1500case/source/agent_retarget/trackc/ik_dualarm.py ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 双臂 IK 求解器:在原生 MuJoCo 模型上对左右臂各做逆运动学。
3
+
4
+ 与 Track A 的 IKSolver 共享算法核心(阻尼最小二乘 + 零空间投影),
5
+ 但直接操作 MuJoCo model/data 而非 robosuite env。
6
+ """
7
+ import mujoco
8
+ import numpy as np
9
+
10
+ from ..config import RetargetConfig
11
+ from ..embodiment import DEFAULT_REACH_M, chain_reach
12
+ #: 轴角换算与位姿信任域配平因子都与单臂求解器共用同一份实现,
13
+ #: 避免两处副本在数值细节上悄悄分叉。
14
+ from ..ik import ROT_BALANCE, _axisangle_from_mat # noqa: F401
15
+
16
+ #: 求解器里的长度常数一律以臂展为单位。写成绝对米数会让同一份配置在 0.5m 的臂上
17
+ #: 相对更粗、在 1.5m 的臂上相对更细,本体一换精度就漂移;按臂展表达后 IK 的收敛
18
+ #: 行为只取决于形状而不取决于大小。参考臂展下与原先的 1mm 容差 / 5cm 步长等价。
19
+ POS_TOL_REL = 1e-3 / DEFAULT_REACH_M
20
+ POS_STEP_REL = 0.05 / DEFAULT_REACH_M
21
+
22
+ #: 角度与关节增量本身就是无量纲的(弧度不随连杆缩放而变),无需归一化。
23
+ BASE_ROT_TOL = np.radians(1.0)
24
+ MAX_ROT_STEP = np.radians(30.0)
25
+ MAX_DQ_STEP = 0.2
26
+
27
+
28
+ def _euler_to_mat_rpy(rpy):
29
+ """(roll, pitch, yaw) → 3x3 旋转矩阵"""
30
+ r, p, y = rpy
31
+ cr, sr = np.cos(r), np.sin(r)
32
+ cp, sp = np.cos(p), np.sin(p)
33
+ cy, sy = np.cos(y), np.sin(y)
34
+ return np.array([
35
+ [cy*cp, cy*sp*sr - sy*cr, cy*sp*cr + sy*sr],
36
+ [sy*cp, sy*sp*sr + cy*cr, sy*sp*cr - cy*sr],
37
+ [-sp, cp*sr, cp*cr],
38
+ ])
39
+
40
+
41
+ def _clip_norm(v, max_norm):
42
+ n = np.linalg.norm(v)
43
+ return v * (max_norm / n) if n > max_norm else v
44
+
45
+
46
+ class SingleArmIK:
47
+ """对 MuJoCo 模型中的一条臂做 IK(不经过 robosuite)。"""
48
+
49
+ def __init__(self, model, data, joint_names, site_name):
50
+ self.model = model
51
+ self.data = data
52
+
53
+ self.site_id = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_SITE, site_name)
54
+ if self.site_id < 0:
55
+ raise ValueError(f"Site '{site_name}' not found in model")
56
+
57
+ self.jnt_ids = []
58
+ self.qpos_adr = []
59
+ self.dof_adr = []
60
+ for name in joint_names:
61
+ jid = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_JOINT, name)
62
+ if jid < 0:
63
+ raise ValueError(f"Joint '{name}' not found in model")
64
+ self.jnt_ids.append(jid)
65
+ self.qpos_adr.append(model.jnt_qposadr[jid])
66
+ self.dof_adr.append(model.jnt_dofadr[jid])
67
+
68
+ self.qpos_adr = np.array(self.qpos_adr, dtype=int)
69
+ self.dof_adr = np.array(self.dof_adr, dtype=int)
70
+ self.n = len(self.jnt_ids)
71
+ self.jnt_range = np.array([model.jnt_range[j] for j in self.jnt_ids], dtype=float)
72
+ self.q_init = np.zeros(self.n)
73
+ self.q_mid = self.jnt_range.mean(axis=1)
74
+ self.scale_m = chain_reach(model, data, joint_names, site_name)
75
+
76
+ self._jacp = np.zeros((3, model.nv))
77
+ self._jacr = np.zeros((3, model.nv))
78
+
79
+ def _fk(self, q):
80
+ self.data.qpos[self.qpos_adr] = q
81
+ mujoco.mj_kinematics(self.model, self.data)
82
+ mujoco.mj_comPos(self.model, self.data)
83
+ pos = np.array(self.data.site_xpos[self.site_id])
84
+ mat = np.array(self.data.site_xmat[self.site_id]).reshape(3, 3)
85
+ return pos, mat
86
+
87
+ def _jacobian(self):
88
+ mujoco.mj_jacSite(self.model, self.data, self._jacp, self._jacr, self.site_id)
89
+ return self._jacp[:, self.dof_adr], self._jacr[:, self.dof_adr]
90
+
91
+ def forward_kinematics(self, q):
92
+ return self._fk(q)
93
+
94
+ def solve_frame(self, tgt_pos, tgt_mat, q_seed, cfg):
95
+ w_p = float(cfg.ik_pos_weight)
96
+ w_r = float(cfg.ik_rot_weight) * ROT_BALANCE
97
+ lam = float(cfg.ik_damping) * self.scale_m / DEFAULT_REACH_M
98
+ k_ns = float(cfg.ik_nullspace_gain)
99
+ margin = float(cfg.ik_joint_limit_margin)
100
+ pos_tol = POS_TOL_REL * self.scale_m * float(cfg.ik_tol)
101
+ pos_step = POS_STEP_REL * self.scale_m
102
+ rot_tol = BASE_ROT_TOL * float(cfg.ik_tol)
103
+
104
+ q_ns = self._nullspace_reference(q_seed, cfg)
105
+ lo = self.jnt_range[:, 0] + margin
106
+ hi = self.jnt_range[:, 1] - margin
107
+ bad = lo >= hi
108
+ lo[bad], hi[bad] = self.jnt_range[bad, 0], self.jnt_range[bad, 1]
109
+
110
+ q = np.clip(np.array(q_seed, dtype=float), lo, hi)
111
+ n_iters, converged = 0, False
112
+ min_sv = np.inf
113
+ for n_iters in range(1, int(cfg.ik_max_iters) + 1):
114
+ cur_pos, cur_mat = self._fk(q)
115
+ e_pos = tgt_pos - cur_pos
116
+ e_rot = _axisangle_from_mat(tgt_mat @ cur_mat.T)
117
+ if (np.linalg.norm(e_pos) < pos_tol or w_p == 0.0) and \
118
+ (np.linalg.norm(e_rot) < rot_tol or w_r == 0.0):
119
+ converged = True
120
+ break
121
+
122
+ Jp, Jr = self._jacobian()
123
+ J = np.vstack([w_p * Jp, w_r * Jr])
124
+ e = np.concatenate([
125
+ w_p * _clip_norm(e_pos, pos_step),
126
+ w_r * _clip_norm(e_rot, MAX_ROT_STEP),
127
+ ])
128
+
129
+ sv = np.linalg.svd(J, compute_uv=False)
130
+ min_sv = min(min_sv, float(sv[-1]))
131
+
132
+ JJt = J @ J.T + (lam ** 2) * np.eye(6)
133
+ dq = J.T @ np.linalg.solve(JJt, e)
134
+
135
+ if k_ns > 0.0 and q_ns is not None:
136
+ J_pinv = J.T @ np.linalg.solve(JJt, np.eye(6))
137
+ N = np.eye(self.n) - J_pinv @ J
138
+ dq = dq + N @ (k_ns * (q_ns - q))
139
+
140
+ dq = np.clip(dq, -MAX_DQ_STEP, MAX_DQ_STEP)
141
+ q = np.clip(q + dq, lo, hi)
142
+
143
+ cur_pos, cur_mat = self._fk(q)
144
+ telem = {
145
+ "pos_residual_m": float(np.linalg.norm(tgt_pos - cur_pos)),
146
+ "rot_residual_rad": float(
147
+ np.linalg.norm(_axisangle_from_mat(tgt_mat @ cur_mat.T))
148
+ ),
149
+ "n_iters": n_iters,
150
+ "converged": converged,
151
+ "min_singular_value": float(min_sv) if np.isfinite(min_sv) else None,
152
+ }
153
+ return q, telem
154
+
155
+ def _nullspace_reference(self, q_seed, cfg):
156
+ mode = cfg.ik_nullspace_target
157
+ if mode == "none":
158
+ return None
159
+ if mode == "init":
160
+ return self.q_init
161
+ if mode == "mid":
162
+ return self.q_mid
163
+ if mode == "prev":
164
+ return np.array(q_seed, dtype=float)
165
+ return None
166
+
167
+ def solve_trajectory(self, targets_pos, targets_mat, cfg):
168
+ q_traj, telems = [], []
169
+ q_seed = self.q_init.copy()
170
+ for tgt_pos, tgt_mat in zip(targets_pos, targets_mat):
171
+ q, telem = self.solve_frame(tgt_pos, tgt_mat, q_seed, cfg)
172
+ q_traj.append(q)
173
+ telems.append(telem)
174
+ q_seed = q if cfg.ik_warm_start == "prev" else self.q_init.copy()
175
+ q_traj = np.array(q_traj)
176
+ return q_traj, self._aggregate(q_traj, telems)
177
+
178
+ def _aggregate(self, q_traj, telems):
179
+ pos_res = np.array([t["pos_residual_m"] for t in telems])
180
+ rot_res = np.array([t["rot_residual_rad"] for t in telems])
181
+ n_iters = np.array([t["n_iters"] for t in telems])
182
+ conv = np.array([t["converged"] for t in telems])
183
+ svs = [t["min_singular_value"] for t in telems
184
+ if t["min_singular_value"] is not None]
185
+
186
+ if len(q_traj) > 1:
187
+ dq = np.abs(np.diff(q_traj, axis=0))
188
+ jump_max = float(dq.max())
189
+ jump_per_joint = dq.max(axis=0).round(4).tolist()
190
+ n_jumps = int((dq.max(axis=1) > 0.5).sum())
191
+ else:
192
+ jump_max, jump_per_joint, n_jumps = 0.0, [0.0] * self.n, 0
193
+
194
+ slack = np.minimum(
195
+ q_traj - self.jnt_range[:, 0], self.jnt_range[:, 1] - q_traj
196
+ )
197
+ return {
198
+ "ik_pos_residual_mean_mm": float(pos_res.mean() * 1000),
199
+ "ik_pos_residual_max_mm": float(pos_res.max() * 1000),
200
+ "ik_rot_residual_mean_deg": float(np.degrees(rot_res).mean()),
201
+ "ik_rot_residual_max_deg": float(np.degrees(rot_res).max()),
202
+ "ik_unconverged_ratio": float(1.0 - conv.mean()),
203
+ "ik_iters_mean": float(n_iters.mean()),
204
+ "ik_joint_jump_max_rad": jump_max,
205
+ "ik_joint_jump_per_joint_rad": jump_per_joint,
206
+ "ik_n_large_joint_jumps": n_jumps,
207
+ "ik_min_singular_value": float(np.min(svs)) if svs else None,
208
+ "ik_solution_min_slack_rad": slack.min(axis=0).round(4).tolist(),
209
+ "ik_solution_limit_hit_ratio": float((slack < 0.05).any(axis=1).mean()),
210
+ }
211
+
212
+
213
+ def aggregate_ik_telemetry(q_traj, telems, jnt_range):
214
+ """把逐帧 IK 遥测聚合成诊断字段。与 SingleArmIK._aggregate 同构,供耦合求解器复用。"""
215
+ q_traj = np.asarray(q_traj, dtype=float)
216
+ n = q_traj.shape[1] if q_traj.ndim == 2 else 0
217
+ pos_res = np.array([t["pos_residual_m"] for t in telems])
218
+ rot_res = np.array([t["rot_residual_rad"] for t in telems])
219
+ n_iters = np.array([t["n_iters"] for t in telems])
220
+ conv = np.array([t["converged"] for t in telems])
221
+ svs = [t["min_singular_value"] for t in telems
222
+ if t.get("min_singular_value") is not None]
223
+
224
+ if len(q_traj) > 1:
225
+ dq = np.abs(np.diff(q_traj, axis=0))
226
+ jump_max = float(dq.max())
227
+ jump_per_joint = dq.max(axis=0).round(4).tolist()
228
+ n_jumps = int((dq.max(axis=1) > 0.5).sum())
229
+ else:
230
+ jump_max, jump_per_joint, n_jumps = 0.0, [0.0] * n, 0
231
+
232
+ slack = np.minimum(q_traj - jnt_range[:, 0], jnt_range[:, 1] - q_traj)
233
+ return {
234
+ "ik_pos_residual_mean_mm": float(pos_res.mean() * 1000),
235
+ "ik_pos_residual_max_mm": float(pos_res.max() * 1000),
236
+ "ik_rot_residual_mean_deg": float(np.degrees(rot_res).mean()),
237
+ "ik_rot_residual_max_deg": float(np.degrees(rot_res).max()),
238
+ "ik_unconverged_ratio": float(1.0 - conv.mean()),
239
+ "ik_iters_mean": float(n_iters.mean()),
240
+ "ik_joint_jump_max_rad": jump_max,
241
+ "ik_joint_jump_per_joint_rad": jump_per_joint,
242
+ "ik_n_large_joint_jumps": n_jumps,
243
+ "ik_min_singular_value": float(np.min(svs)) if svs else None,
244
+ "ik_solution_min_slack_rad": slack.min(axis=0).round(4).tolist(),
245
+ "ik_solution_limit_hit_ratio": float((slack < 0.05).any(axis=1).mean()),
246
+ }
247
+
248
+
249
+ class _Chain:
250
+ """一段关节序列在 MuJoCo 里的索引与限位。"""
251
+
252
+ def __init__(self, model, joint_names):
253
+ self.jnt_ids, self.qpos_adr, self.dof_adr = [], [], []
254
+ for name in joint_names:
255
+ jid = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_JOINT, name)
256
+ if jid < 0:
257
+ raise ValueError(f"Joint '{name}' not found in model")
258
+ self.jnt_ids.append(jid)
259
+ self.qpos_adr.append(model.jnt_qposadr[jid])
260
+ self.dof_adr.append(model.jnt_dofadr[jid])
261
+ self.qpos_adr = np.array(self.qpos_adr, dtype=int)
262
+ self.dof_adr = np.array(self.dof_adr, dtype=int)
263
+ self.n = len(self.jnt_ids)
264
+ self.jnt_range = (np.array([model.jnt_range[j] for j in self.jnt_ids], dtype=float)
265
+ if self.n else np.zeros((0, 2)))
266
+ self.q_mid = self.jnt_range.mean(axis=1) if self.n else np.zeros(0)
267
+
268
+
269
+ class CoupledChainIK:
270
+ """
271
+ 上游共享链 + N 条末端链的耦合 IK。
272
+
273
+ 为什么要"上游链"这个抽象
274
+ ------------------------
275
+ 手臂之外还有一些自由度位于手臂上游、能整体重新安置手臂基座:
276
+ 躯干、升降柱、以及**移动底座**。它们的共同性质是被所有手臂共享,
277
+ 因此不能各臂独立求解 —— 两条臂会要求互相冲突的上游构型。
278
+
279
+ 把它们统一成"上游链"之后:
280
+ · 现在填躯干关节
281
+ · 将来给 MJCF 加上平面关节(x/y/yaw)即得到移动底座,本类不必改动
282
+ 这是固定底座与移动底座之间唯一的结构差异,其余诊断与修复逻辑完全共用。
283
+
284
+ 求解:加权阻尼最小二乘,任务是各链位姿误差的堆叠
285
+ dq = W Jᵀ (J W Jᵀ + λ²I)⁻¹ e
286
+ 权重 W 对上游自由度取 upstream_weight、对末端链取 1。
287
+ upstream_weight=0 时上游被完全冻结,退化成"各链独立求解",与旧行为一致;
288
+ 调大则上游参与消解,代价是它移动得更多。这个权衡正是移动底座需要的旋钮
289
+ (底座慢、上游中、手臂快),因此现在就用它表达,而不是等到 C2 再造一个。
290
+ """
291
+
292
+ def __init__(self, model, data, upstream_joint_names, arm_chains):
293
+ """
294
+ arm_chains: [(joint_names, site_name), ...],顺序与 solve_trajectories 的输入一致。
295
+ """
296
+ self.model = model
297
+ self.data = data
298
+ self.upstream = _Chain(model, list(upstream_joint_names or []))
299
+ self.arms, self.site_ids, self.arm_scales = [], [], []
300
+ for joint_names, site_name in arm_chains:
301
+ sid = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_SITE, site_name)
302
+ if sid < 0:
303
+ raise ValueError(f"Site '{site_name}' not found in model")
304
+ self.arms.append(_Chain(model, joint_names))
305
+ self.site_ids.append(sid)
306
+ # 逐链自己的臂展:长短不一的链(例如一臂一夹爪杆)各按自己的尺度定容差。
307
+ self.arm_scales.append(chain_reach(model, data, joint_names, site_name))
308
+ valid_scales = [s for s in self.arm_scales if s]
309
+ self.scale_m = float(np.mean(valid_scales)) if valid_scales else DEFAULT_REACH_M
310
+ self.arm_scales = [s or self.scale_m for s in self.arm_scales]
311
+
312
+ self.n_up = self.upstream.n
313
+ self.n_arms = len(self.arms)
314
+ self.slices = []
315
+ off = self.n_up
316
+ for a in self.arms:
317
+ self.slices.append(slice(off, off + a.n))
318
+ off += a.n
319
+ self.n_total = off
320
+ self.n_task = 6 * self.n_arms
321
+
322
+ self._jacp = np.zeros((3, model.nv))
323
+ self._jacr = np.zeros((3, model.nv))
324
+
325
+ # ------------------------------------------------------------ 运动学
326
+ def _set_q(self, q):
327
+ if self.n_up:
328
+ self.data.qpos[self.upstream.qpos_adr] = q[:self.n_up]
329
+ for a, sl in zip(self.arms, self.slices):
330
+ self.data.qpos[a.qpos_adr] = q[sl]
331
+ mujoco.mj_kinematics(self.model, self.data)
332
+ mujoco.mj_comPos(self.model, self.data)
333
+
334
+ def _site_pose(self, i):
335
+ pos = np.array(self.data.site_xpos[self.site_ids[i]])
336
+ mat = np.array(self.data.site_xmat[self.site_ids[i]]).reshape(3, 3)
337
+ return pos, mat
338
+
339
+ def _site_jac(self, i):
340
+ mujoco.mj_jacSite(self.model, self.data, self._jacp, self._jacr, self.site_ids[i])
341
+ return self._jacp, self._jacr
342
+
343
+ def limits(self, cfg):
344
+ margin = float(cfg.ik_joint_limit_margin)
345
+ rng = [self.upstream.jnt_range] + [a.jnt_range for a in self.arms]
346
+ rng = np.vstack([r for r in rng if len(r)])
347
+ lo, hi = rng[:, 0] + margin, rng[:, 1] - margin
348
+ bad = lo >= hi
349
+ lo[bad], hi[bad] = rng[bad, 0], rng[bad, 1]
350
+ return lo, hi, rng
351
+
352
+ def q_default(self):
353
+ q = np.zeros(self.n_total)
354
+ if self.n_up == 4:
355
+ q[:4] = [0., -.28403, .28834, -.00123]
356
+ return q
357
+
358
+ # ------------------------------------------------------------ 求解
359
+ def solve_frame(self, targets, q_seed, cfg, chain_cfgs=None):
360
+ from constrained_waist import solve_frame
361
+ return solve_frame(self, targets, q_seed, cfg, chain_cfgs)
362
+
363
+ def _nullspace_reference(self, q_seed, cfg):
364
+ mode = cfg.ik_nullspace_target
365
+ if mode == "none":
366
+ return None
367
+ if mode == "init":
368
+ return self.q_default()
369
+ if mode == "mid":
370
+ parts = ([self.upstream.q_mid] if self.n_up else []) + \
371
+ [a.q_mid for a in self.arms]
372
+ return np.concatenate(parts)
373
+ if mode == "prev":
374
+ return np.array(q_seed, dtype=float)
375
+ return None
376
+
377
+ def solve_trajectories(self, targets_per_arm, cfg, chain_cfgs=None):
378
+ """
379
+ targets_per_arm: [(pos_seq, mat_seq), ...] 与 arm_chains 同序。
380
+
381
+ 返回 (各臂关节轨迹 list, 各臂遥测 list, 上游轨迹, 上游遥测)。
382
+ 上游轨迹单独返回:它是"手臂被搬到哪里"的直接证据,
383
+ 对移动底座而言就是底座轨迹本身。
384
+ """
385
+ n_steps = min(len(p) for p, _ in targets_per_arm)
386
+ q_seed = self.q_default()
387
+ q_all = []
388
+ telem_frames = [[] for _ in self.arms]
389
+ self._last_trajectory_solver_diagnostics = []
390
+ try:
391
+ for t in range(n_steps):
392
+ # The existing 0.3-rad path constraint belongs in the feasible set.
393
+ # This is distinct from the seed: reseeding cannot bypass it.
394
+ self._continuity_reference = q_all[-1] if q_all else None
395
+ targets = [(p[t], m[t]) for p, m in targets_per_arm]
396
+ q, telems = self.solve_frame(targets, q_seed, cfg, chain_cfgs)
397
+ q_all.append(q)
398
+ self._last_trajectory_solver_diagnostics.append(dict(getattr(self, '_last_frame_diagnostics', {})))
399
+ for i, tl in enumerate(telems):
400
+ telem_frames[i].append(tl)
401
+ q_seed = q if cfg.ik_warm_start == "prev" else self.q_default()
402
+ finally:
403
+ self._continuity_reference = None
404
+
405
+ q_all = np.array(q_all)
406
+ arm_qs, arm_telems = [], []
407
+ for i, (a, sl) in enumerate(zip(self.arms, self.slices)):
408
+ arm_qs.append(q_all[:, sl])
409
+ arm_telems.append(aggregate_ik_telemetry(
410
+ q_all[:, sl], telem_frames[i], a.jnt_range))
411
+
412
+ up_q = q_all[:, :self.n_up] if self.n_up else np.zeros((len(q_all), 0))
413
+ return arm_qs, arm_telems, up_q, self._upstream_telemetry(up_q)
414
+
415
+ def _upstream_telemetry(self, up_q):
416
+ """
417
+ 上游链的使用情况。这些量对固定底座是"躯干用了多少",
418
+ 对移动底座就是"底座走了多远、多快",因此字段名不绑定具体部件。
419
+ """
420
+ if not self.n_up or len(up_q) == 0:
421
+ return {"upstream_dof": 0, "upstream_engaged": False}
422
+ rng = self.upstream.jnt_range
423
+ span = np.maximum(rng[:, 1] - rng[:, 0], 1e-9)
424
+ used = (up_q.max(axis=0) - up_q.min(axis=0)) / span
425
+ step = np.abs(np.diff(up_q, axis=0)) if len(up_q) > 1 else np.zeros((1, self.n_up))
426
+ return {
427
+ "upstream_dof": int(self.n_up),
428
+ "upstream_engaged": bool(np.abs(up_q).max() > 1e-6),
429
+ "upstream_range_used_ratio": float(used.max()),
430
+ "upstream_travel_rad": float(np.abs(np.diff(up_q, axis=0)).sum())
431
+ if len(up_q) > 1 else 0.0,
432
+ "upstream_step_max_rad": float(step.max()),
433
+ }
434
+
435
+
436
+ class DualArmIKSolver:
437
+ """
438
+ 双臂 IK。上游链(躯干 / 将来的移动底座)由两条臂共享,因此走耦合求解;
439
+ upstream_weight=0 时上游冻结,等价于两臂独立求解。
440
+ """
441
+
442
+ def __init__(self, model, data, target_robot):
443
+ self.coupled = CoupledChainIK(
444
+ model, data,
445
+ getattr(target_robot, "upstream_joint_names", None)
446
+ or getattr(target_robot, "torso_joint_names", None) or [],
447
+ [(target_robot.left_arm.joint_names, target_robot.left_arm.ee_site_name),
448
+ (target_robot.right_arm.joint_names, target_robot.right_arm.ee_site_name)],
449
+ )
450
+ # 保留单臂求解器:初始对齐等场景只需要一条链的正运动学
451
+ self.left = SingleArmIK(
452
+ model, data,
453
+ target_robot.left_arm.joint_names,
454
+ target_robot.left_arm.ee_site_name,
455
+ )
456
+ self.right = SingleArmIK(
457
+ model, data,
458
+ target_robot.right_arm.joint_names,
459
+ target_robot.right_arm.ee_site_name,
460
+ )
461
+
462
+ @property
463
+ def n_upstream(self):
464
+ return self.coupled.n_up
465
+
466
+ def solve_dual(self, left_pos, left_mat, right_pos, right_mat, cfg,
467
+ left_cfg=None, right_cfg=None):
468
+ """
469
+ 返回 (left_q, right_q, left_telem, right_telem, up_q, up_telem)。
470
+
471
+ cfg 提供共享参数;left_cfg/right_cfg 提供各链自己的位姿权重。
472
+ """
473
+ chain_cfgs = None
474
+ if left_cfg is not None and right_cfg is not None:
475
+ chain_cfgs = [left_cfg, right_cfg]
476
+ (lq, rq), (lt, rt), up_q, up_telem = self.coupled.solve_trajectories(
477
+ [(left_pos, left_mat), (right_pos, right_mat)], cfg, chain_cfgs,
478
+ )
479
+ return lq, rq, lt, rt, up_q, up_telem
1500case/source/agent_retarget/trackc/robots.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Track C 的机器人模型配置。
3
+
4
+ 源本体: Cobot Magic (Piper 6-DoF × 2)
5
+ 目标本体: Astribot S1 (7-DoF × 2 + 4-DoF torso)
6
+ """
7
+ import os
8
+ from dataclasses import dataclass, field
9
+ from typing import List, Tuple
10
+
11
+ MODELS_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
12
+ "models", "trackc")
13
+
14
+
15
+ @dataclass
16
+ class ArmSpec:
17
+ """单臂运动学规格"""
18
+ n_joints: int
19
+ joint_names: List[str]
20
+ ee_site_name: str
21
+ gripper_actuator_name: str = ""
22
+
23
+ @property
24
+ def n_arm_dof(self):
25
+ return self.n_joints
26
+
27
+
28
+ @dataclass
29
+ class DualArmRobot:
30
+ """双臂机器人配置"""
31
+ name: str
32
+ mjcf_path: str
33
+ left_arm: ArmSpec
34
+ right_arm: ArmSpec
35
+ #: 位于手臂上游、被两条臂共享的自由度。固定底座本体上是躯干/升降柱,
36
+ #: 移动底座本体上再把底盘的平面关节加进来 —— 求解器不区分二者。
37
+ upstream_joint_names: List[str] = field(default_factory=list)
38
+
39
+
40
+ PIPER_LEFT = ArmSpec(
41
+ n_joints=6,
42
+ joint_names=[f"left_joint{i}" for i in range(1, 7)],
43
+ ee_site_name="left_ee_site",
44
+ gripper_actuator_name="left_gripper",
45
+ )
46
+
47
+ PIPER_RIGHT = ArmSpec(
48
+ n_joints=6,
49
+ joint_names=[f"right_joint{i}" for i in range(1, 7)],
50
+ ee_site_name="right_ee_site",
51
+ gripper_actuator_name="right_gripper",
52
+ )
53
+
54
+ S1_LEFT = ArmSpec(
55
+ n_joints=7,
56
+ joint_names=[f"astribot_arm_left_joint_{i}" for i in range(1, 8)],
57
+ ee_site_name="arm_left_tool",
58
+ gripper_actuator_name="astribot_gripper_left_joint_L1",
59
+ )
60
+
61
+ S1_RIGHT = ArmSpec(
62
+ n_joints=7,
63
+ joint_names=[f"astribot_arm_right_joint_{i}" for i in range(1, 8)],
64
+ ee_site_name="arm_right_tool",
65
+ gripper_actuator_name="astribot_gripper_right_joint_L1",
66
+ )
67
+
68
+ S1_TORSO = [f"astribot_torso_joint_{i}" for i in range(1, 5)]
69
+
70
+
71
+ def cobot_magic_robot():
72
+ return DualArmRobot(
73
+ name="CobotMagic",
74
+ mjcf_path=os.path.join(MODELS_DIR, "piper_isaac_sim", "piper_description",
75
+ "mujoco_model", "piper_description.xml"),
76
+ left_arm=PIPER_LEFT,
77
+ right_arm=PIPER_RIGHT,
78
+ )
79
+
80
+
81
+ def astribot_s1_robot():
82
+ return DualArmRobot(
83
+ name="AstribotS1",
84
+ mjcf_path=os.path.join(MODELS_DIR, "astribot_s1_ik", "astribot_s1_ik.xml"),
85
+ left_arm=S1_LEFT,
86
+ right_arm=S1_RIGHT,
87
+ upstream_joint_names=S1_TORSO,
88
+ )
1500case/source/agent_retarget/trackc/source_dualarm.py ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 从 LeRobot 格式的 AtomBench/CobotMagic 数据集加载双臂演示。
3
+
4
+ AtomBench CobotMagic 数据格式 (LeRobot v2.1):
5
+ action: (14,) = 右臂6关节 + 右夹爪 + 左臂6关节 + 左夹爪
6
+ observation.state: (26,) = 右臂6关节 + 右夹爪 + 右末端6D + 左臂6关节 + 左夹爪 + 左末端6D
7
+
8
+ 注意:原始数据中是 **右臂在前、左臂在后** 的顺序。
9
+ """
10
+ import json
11
+ import os
12
+ from dataclasses import dataclass
13
+ from typing import Dict, List, Optional
14
+
15
+ import numpy as np
16
+
17
+ # 任务短名 → 实际目录名前缀
18
+ TASK_DIR_MAP = {
19
+ "dm1": "dm1_Pick_the_basket_and_put_the_cube_into_the_basket",
20
+ "dm2": "dm2_Put_the_ball_in_the_basket",
21
+ "dm3": "dm3_Place_the_bottles_upright_on_the_tray",
22
+ "dm4": "dm4_Push_two_cubes_into_the_marked_area",
23
+ "dm5": "dm5_Pick_the_bowl_pour_the_coffee_beans_into_bowl",
24
+ "dm6": "dm6_Open_drawer_put_block_into_drawer_close_drawer",
25
+ "dm7": "dm7_Stack_two_blocks_in_target_position",
26
+ "dm8": "dm8_Open_lid_place_the_block_into_box_close_lid",
27
+ "di1": "di1_Pick_up_basket_place_blue_block_into_basket",
28
+ "di2": "di2_Pick_up_basket_put_triangular_block_intobasket",
29
+ "di3": "di3_Pick_up_basket_place_largest_block_into_basket",
30
+ "di4": "di4_Pick_object_to_left_of_cylinder_place_basket",
31
+ "di5": "di5_Pick_up_two_cubes_place_into_basket_leave_one",
32
+ "di6": "di6_Pick_up_two_cubes_place_into_two_baskets",
33
+ "di7": "di7_Place_objects_except_the_red_block_into_basket",
34
+ }
35
+
36
+
37
+ @dataclass
38
+ class DualArmDemo:
39
+ """双臂演示数据"""
40
+ demo_key: str
41
+ task_name: str
42
+
43
+ left_joint_traj: np.ndarray # (T, 6) 左臂关节角
44
+ right_joint_traj: np.ndarray # (T, 6) 右臂关节角
45
+ left_gripper_cmd: np.ndarray # (T,) 左夹爪 0~1
46
+ right_gripper_cmd: np.ndarray # (T,) 右夹爪 0~1
47
+
48
+ left_eef_pos: Optional[np.ndarray] = None # (T, 3) 左末端位置
49
+ left_eef_mat: Optional[np.ndarray] = None # (T, 3,3) 左末端姿态
50
+ right_eef_pos: Optional[np.ndarray] = None # (T, 3) 右末端位置
51
+ right_eef_mat: Optional[np.ndarray] = None # (T, 3,3) 右末端姿态
52
+
53
+ n_steps: int = 0
54
+
55
+
56
+ def _euler_to_mat(euler):
57
+ """(roll, pitch, yaw) → 3x3 旋转矩阵"""
58
+ r, p, y = euler
59
+ cr, sr = np.cos(r), np.sin(r)
60
+ cp, sp = np.cos(p), np.sin(p)
61
+ cy, sy = np.cos(y), np.sin(y)
62
+ return np.array([
63
+ [cy*cp, cy*sp*sr - sy*cr, cy*sp*cr + sy*sr],
64
+ [sy*cp, sy*sp*sr + cy*cr, sy*sp*cr - cy*sr],
65
+ [-sp, cp*sr, cp*cr],
66
+ ])
67
+
68
+
69
+ def _resolve_task_dir(dataset_dir, task_name):
70
+ """把短任务名 (dm1) 解析为实际的数据目录路径"""
71
+ if task_name in TASK_DIR_MAP:
72
+ task_dir = os.path.join(dataset_dir, TASK_DIR_MAP[task_name])
73
+ else:
74
+ task_dir = os.path.join(dataset_dir, task_name)
75
+ if not os.path.isdir(task_dir):
76
+ candidates = [d for d in os.listdir(dataset_dir)
77
+ if d.startswith(task_name + "_")]
78
+ if candidates:
79
+ task_dir = os.path.join(dataset_dir, candidates[0])
80
+ return task_dir
81
+
82
+
83
+ def load_atombench_episode(dataset_dir, episode_idx, task_name="unknown"):
84
+ """
85
+ 从 AtomBench/CobotMagic 本地目录加载一个 episode。
86
+
87
+ 数据结构:
88
+ {dataset_dir}/{task_full_name}/data/chunk-000/episode_XXXXXX.parquet
89
+ """
90
+ try:
91
+ import pyarrow.parquet as pq
92
+ except ImportError:
93
+ raise ImportError("需要 pyarrow: pip install pyarrow")
94
+
95
+ task_dir = _resolve_task_dir(dataset_dir, task_name)
96
+ parquet_path = os.path.join(
97
+ task_dir, "data", "chunk-000",
98
+ f"episode_{episode_idx:06d}.parquet"
99
+ )
100
+ if not os.path.exists(parquet_path):
101
+ raise FileNotFoundError(f"Episode 文件不存在: {parquet_path}")
102
+
103
+ table = pq.read_table(parquet_path)
104
+ df = table.to_pandas()
105
+
106
+ if "observation.state" in df.columns:
107
+ states = np.stack(df["observation.state"].values)
108
+ else:
109
+ state_keys = sorted([c for c in df.columns if c.startswith("observation.state.")])
110
+ states = df[state_keys].values.astype(np.float32)
111
+
112
+ if "action" in df.columns:
113
+ actions = np.stack(df["action"].values)
114
+ else:
115
+ action_keys = sorted([c for c in df.columns if c.startswith("action.")])
116
+ actions = df[action_keys].values.astype(np.float32)
117
+
118
+ T = len(states)
119
+
120
+ # action: (14,) = [right_j1..j6, right_gripper, left_j1..j6, left_gripper]
121
+ right_joint_traj = actions[:, 0:6]
122
+ right_gripper = actions[:, 6]
123
+ left_joint_traj = actions[:, 7:13]
124
+ left_gripper = actions[:, 13]
125
+
126
+ # state: (26,) = [right_j1..j6, right_gripper, right_eef_6D,
127
+ # left_j1..j6, left_gripper, left_eef_6D]
128
+ right_eef_pos, right_eef_mat = None, None
129
+ left_eef_pos, left_eef_mat = None, None
130
+ if states.shape[1] >= 26:
131
+ # 右臂 EEF:state[7:13] = [x,y,z,rx,ry,rz]
132
+ right_eef_6d = states[:, 7:13]
133
+ right_eef_pos = right_eef_6d[:, :3]
134
+ right_eef_mat = np.array([_euler_to_mat(e) for e in right_eef_6d[:, 3:6]])
135
+ # 左臂 EEF:state[20:26] = [x,y,z,rx,ry,rz]
136
+ left_eef_6d = states[:, 20:26]
137
+ left_eef_pos = left_eef_6d[:, :3]
138
+ left_eef_mat = np.array([_euler_to_mat(e) for e in left_eef_6d[:, 3:6]])
139
+
140
+ return DualArmDemo(
141
+ demo_key=f"episode_{episode_idx:06d}",
142
+ task_name=task_name,
143
+ left_joint_traj=left_joint_traj,
144
+ right_joint_traj=right_joint_traj,
145
+ left_gripper_cmd=left_gripper,
146
+ right_gripper_cmd=right_gripper,
147
+ left_eef_pos=left_eef_pos,
148
+ left_eef_mat=left_eef_mat,
149
+ right_eef_pos=right_eef_pos,
150
+ right_eef_mat=right_eef_mat,
151
+ n_steps=T,
152
+ )
153
+
154
+
155
+ def load_task_episodes(dataset_dir, task_name, episode_ids):
156
+ """批量加载指定任务的多个 episodes"""
157
+ demos = []
158
+ for eid in episode_ids:
159
+ try:
160
+ demo = load_atombench_episode(dataset_dir, eid, task_name)
161
+ demos.append(demo)
162
+ except Exception as e:
163
+ print(f"Warning: 加载 episode {eid} 失败: {e}")
164
+ return demos
165
+
166
+
167
+ def get_dataset_info(dataset_dir, task_name=None):
168
+ """读取数据集 meta 信息"""
169
+ if task_name:
170
+ task_dir = _resolve_task_dir(dataset_dir, task_name)
171
+ info_path = os.path.join(task_dir, "meta", "info.json")
172
+ else:
173
+ info_path = os.path.join(dataset_dir, "meta", "info.json")
174
+ if os.path.exists(info_path):
175
+ with open(info_path) as f:
176
+ return json.load(f)
177
+ return None
1500case/source/constrained_waist.py ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """S1 reduced IK with primary-task descent and an exact secondary nullspace.
2
+
3
+ The physical waist constraint and acceptance thresholds are unchanged. A supplied
4
+ continuity reference restricts the next configuration during solving, not by
5
+ post-processing an unconstrained trajectory.
6
+ """
7
+ import numpy as np
8
+
9
+ VERSION='reduced_ik_primary_descent_table_metric_v4'
10
+ JOINT_STEP_LIMIT=.3
11
+
12
+ def project_q(q,lo,hi):
13
+ q=np.asarray(q,dtype=float).copy()
14
+ lower=max(lo[0],-.28403-hi[1]);upper=min(hi[0],-.28403-lo[1])
15
+ if lower>upper:raise ValueError('No feasible coupled waist')
16
+ q=np.clip(q,lo,hi);q[0]=np.clip(q[0],lower,upper);q[1]=-.28403-q[0];q[2]=.28834;q[3]=-.00123
17
+ return q
18
+
19
+ def solve_frame(self,targets,q_seed,cfg,chain_cfgs=None):
20
+ from table_clearance_ik import get_constraint,MARGIN_M
21
+ from agent_retarget.trackc.ik_dualarm import ROT_BALANCE,DEFAULT_REACH_M,POS_TOL_REL,POS_STEP_REL,BASE_ROT_TOL,MAX_ROT_STEP,MAX_DQ_STEP,_axisangle_from_mat,_clip_norm
22
+ assert self.n_up==4
23
+ cfgs=list(chain_cfgs) if chain_cfgs else [cfg]*self.n_arms
24
+ wps=[float(c.ik_pos_weight) for c in cfgs];wrs=[float(c.ik_rot_weight)*ROT_BALANCE for c in cfgs]
25
+ base_lam=float(cfg.ik_damping)*self.scale_m/DEFAULT_REACH_M;lam=base_lam;k=float(cfg.ik_nullspace_gain)
26
+ lo,hi,physical=self.limits(cfg)
27
+ assert physical[2,0]<=.28834<=physical[2,1] and physical[3,0]<=-.00123<=physical[3,1]
28
+ ref=getattr(self,'_continuity_reference',None)
29
+ if ref is not None:
30
+ radius=JOINT_STEP_LIMIT-1e-9
31
+ lo=np.maximum(lo,np.asarray(ref)-radius);hi=np.minimum(hi,np.asarray(ref)+radius)
32
+ if np.any(lo>hi):raise ValueError('Empty physical/temporal constraint intersection')
33
+ q=project_q(q_seed,lo,hi);ns=self._nullspace_reference(q_seed,cfg)
34
+ n=self.n_total;B=np.zeros((n,n-3));B[0,0]=1;B[1,0]=-1;B[4:,1:]=np.eye(n-4)
35
+ weights=np.ones(n-3);weights[0]=max(0.,float(cfg.upstream_weight))
36
+ active=np.flatnonzero(weights>0);root_weights=np.sqrt(weights[active])
37
+ minimum=np.inf;converged=False;iterations=0;accepted=0;rejected=0;fallbacks=0;stalls=0;reason='iteration_limit'
38
+ clearance=get_constraint(self);restorations=0;projected=0;path_backoff=False;feasible_increases=0;small_feasible_steps=0
39
+
40
+ def observe(x,jacobian=False):
41
+ self._set_q(x);rows=[];errors=[];residuals=[];objective=0.;ok=True
42
+ for i,(tp,tm) in enumerate(targets):
43
+ p,m=self._site_pose(i);ep=tp-p;er=_axisangle_from_mat(tm@m.T);wp,wr=wps[i],wrs[i]
44
+ pe=float(np.linalg.norm(ep));re=float(np.linalg.norm(er));residuals.append((pe,re))
45
+ objective+=(wp*pe)**2+(wr*re)**2
46
+ ok=ok and ((pe<POS_TOL_REL*self.arm_scales[i]*cfg.ik_tol or wp==0) and (re<BASE_ROT_TOL*cfg.ik_tol or wr==0))
47
+ if jacobian:
48
+ jp,jr=self._site_jac(i);J=np.zeros((6,n));J[:3,:4]=wp*jp[:,self.upstream.dof_adr];J[3:,:4]=wr*jr[:,self.upstream.dof_adr]
49
+ J[:3,self.slices[i]]=wp*jp[:,self.arms[i].dof_adr];J[3:,self.slices[i]]=wr*jr[:,self.arms[i].dof_adr]
50
+ rows.append((J@B)[:,active]*root_weights)
51
+ errors.append(np.r_[wp*_clip_norm(ep,POS_STEP_REL*self.arm_scales[i]),wr*_clip_norm(er,MAX_ROT_STEP)])
52
+ return float(objective),ok,residuals,rows,errors
53
+
54
+ initial_objective=observe(q)[0];trace=[initial_objective];initial_clearance=clearance.minimum()
55
+ for iterations in range(1,int(cfg.ik_max_iters)+1):
56
+ objective,ok,residuals,rows,errors=observe(q,True)
57
+ current_clearance=clearance.minimum();feasible=current_clearance>=MARGIN_M-1e-6
58
+ if ok and feasible:converged=True;reason='tolerance';break
59
+ J=np.vstack(rows);e=np.concatenate(errors)
60
+ U,sv,Vh=np.linalg.svd(J,full_matrices=True);minimum=min(minimum,float(sv[-1]))
61
+ coeff=sv/(sv*sv+lam*lam)
62
+ task=root_weights*(Vh[:len(sv)].T@(coeff*(U[:,:len(sv)].T@e)))
63
+ secondary=np.zeros_like(task)
64
+ if k>0 and ns is not None:
65
+ reference=project_q(ns,lo,hi);delta=np.r_[reference[0]-q[0],reference[4:]-q[4:]]
66
+ # Damped I-J#J leaks into the task. V's actual kernel does not.
67
+ rank=int(np.sum(sv>max(J.shape)*np.finfo(float).eps*sv[0])) if len(sv) else 0
68
+ kernel=Vh[rank:].T
69
+ secondary=root_weights*(kernel@(kernel.T@(k*delta[active]/root_weights)))
70
+ # A large second-order nullspace excursion otherwise causes six
71
+ # rejected FK trials before the primary-only fallback on most steps.
72
+ # Bound the secondary displacement by actual primary progress.
73
+ secondary*=min(1.,np.linalg.norm(task)/max(np.linalg.norm(secondary),1e-15))
74
+ directions=[task+secondary]
75
+ if np.linalg.norm(secondary)>1e-12:directions.append(task)
76
+ # Reuse the DLS SVD for an inverse Hessian in actual reduced-joint
77
+ # coordinates. Euclidean clipping can fight the pose objective and take
78
+ # hundreds of tiny steps along the same table boundary.
79
+ eig=np.full(len(active),lam*lam);eig[:len(sv)]+=sv*sv
80
+ inverse_metric=(Vh.T/eig)@Vh
81
+ inverse_metric=root_weights[:,None]*inverse_metric*root_weights[None,:]
82
+ found=False
83
+ for direction_index,direction in enumerate(directions):
84
+ self._set_q(q)
85
+ direction,count,linear_feasible=clearance.projected_step(direction,B,active,inverse_metric)
86
+ projected+=count
87
+ # Uniform scaling preserves direction; per-component clipping does not.
88
+ direction=direction*min(1.,MAX_DQ_STEP/max(np.max(np.abs(direction)),1e-15))
89
+ du=np.zeros(n-3);du[active]=direction
90
+ for alpha in [1.,.5,.25,.125,.0625,.03125]:
91
+ candidate=project_q(q+B@(alpha*du),lo,hi)
92
+ trial=observe(candidate)[0]
93
+ trial_clearance=clearance.minimum()
94
+ restored=(not feasible and trial_clearance>current_clearance+1e-7)
95
+ improved=trial<objective-max(1e-14,objective*1e-12)
96
+ if np.isfinite(trial) and ((feasible and trial_clearance>=MARGIN_M-1e-6 and improved) or restored):
97
+ # Once a hard surface prevents exact tracking, micrometre
98
+ # objective gains should not consume the remaining 150-200
99
+ # iterations. This uses objective convergence, not the task
100
+ # success threshold, and only applies with active clearance.
101
+ tiny=(feasible and count>0 and objective-trial<=max(1e-12,objective*1e-4))
102
+ small_feasible_steps=small_feasible_steps+1 if tiny else 0
103
+ restorations+=int(restored);feasible_increases+=int(feasible and trial>objective+1e-12)
104
+ q=candidate;accepted+=1;trace.append(trial);found=True;fallbacks+=int(direction_index>0)
105
+ lam=max(base_lam,lam*.5);stalls=0;break
106
+ rejected+=1
107
+ if found:break
108
+ if not found:
109
+ stalls+=1;lam=max(lam*4.,1e-5)
110
+ if stalls>=3:reason='stationary_or_constraint_limited';break
111
+ elif small_feasible_steps>=3:
112
+ reason='constrained_objective_stationary';break
113
+ path_feasible=True
114
+ if ref is not None and clearance.capsules and not clearance.path_safe(np.asarray(ref),q):
115
+ candidate=q.copy();path_backoff=True
116
+ path_feasible=False
117
+ for alpha in [.5,.25,.125,.0625,0.]:
118
+ trial=np.asarray(ref)+(candidate-np.asarray(ref))*alpha
119
+ if clearance.path_safe(np.asarray(ref),trial):q=trial;path_feasible=True;break
120
+ final_objective,converged,final,_,_=observe(q)
121
+ final_clearance=clearance.minimum();converged=converged and final_clearance>=MARGIN_M-1e-6 and path_feasible
122
+ if converged:reason='tolerance'
123
+ diagnostics={'solver_version':VERSION,'primary_objective_initial':initial_objective,'primary_objective_final':final_objective,
124
+ 'accepted_steps':accepted,'rejected_trials':rejected,'nullspace_fallbacks':fallbacks,'stop_reason':reason,
125
+ 'accepted_objective_increases':sum(int(b>a+1e-12) for a,b in zip(trace,trace[1:])),
126
+ 'accepted_feasible_objective_increases':feasible_increases,'constraint_restoration_steps':restorations,
127
+ 'table_clearance_projection_count':projected,'initial_capsule_table_clearance_m':initial_clearance,
128
+ 'final_capsule_table_clearance_m':final_clearance,'table_clearance_margin_m':MARGIN_M,
129
+ 'frame_path_feasibility_backoff':path_backoff,
130
+ 'frame_path_capsule_constraint_feasible':path_feasible,
131
+ 'small_feasible_objective_steps':small_feasible_steps,
132
+ 'continuity_constraint_active':ref is not None}
133
+ self._last_frame_diagnostics=diagnostics
134
+ telemetry=[{'pos_residual_m':pe,'rot_residual_rad':re,'n_iters':iterations,'converged':converged,
135
+ 'min_singular_value':float(minimum) if np.isfinite(minimum) else None,**diagnostics} for pe,re in final]
136
+ return q,telemetry
1500case/source/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/assets/astribot_s1_asset_for_gripper.xml ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <mujocoinclude>
2
+ <default class="main">
3
+ <site size="0.005 0 0" rgba="0.4 0.9 0.4 1" />
4
+
5
+ <!--ur5e-->
6
+ <joint limited="true" axis="0 0 1" />
7
+ <general ctrllimited="true" forcelimited="true" ctrlrange="-6.2831 6.2831" dyntype="none" biastype="affine"/>
8
+
9
+ <default class="visual">
10
+ <geom type="mesh" contype="0" conaffinity="0" group="2"/>
11
+ </default>
12
+ <default class="collision">
13
+ <geom type="capsule" group="3"/>
14
+ <default class="eef_collision">
15
+ <geom type="cylinder" />
16
+ </default>
17
+ </default>
18
+
19
+ <default class="Widget">
20
+ <geom contype="0" conaffinity="0" group="2" rgba="1 1 1 1"/>
21
+ </default>
22
+
23
+ <default class="size3">
24
+ <joint armature="0.1" damping="10"/>
25
+ <general forcerange="-265 265"/>
26
+ </default>
27
+ <default class="size2">
28
+ <joint armature="0.1" damping="10"/>
29
+ <general forcerange="-142 142"/>
30
+ </default>
31
+ <default class="size1">
32
+ <joint armature="0.1" damping="10"/>
33
+ <general forcerange="-20 20"/>
34
+ </default>
35
+
36
+ <default class="free">
37
+ <joint type="free" limited="false" armature="0" damping="0" />
38
+ </default>
39
+
40
+ <default class="torso_size1">
41
+ <joint limited="true" axis="0 0 1" armature="0.1" damping="10"/>
42
+ <general ctrllimited="true" forcelimited="true" forcerange="-465 465" ctrlrange="-3.14 3.15" dyntype="none" biastype="affine"/>
43
+ </default>
44
+
45
+ <default class="chassis_size1">
46
+ <joint limited="false" axis="0 0 1" armature="0.0" damping="10"/>
47
+ <general ctrllimited="false" forcelimited="false" forcerange="-5000 5000" ctrlrange="-5000 5000" dyntype="none" biastype="affine"/>
48
+ </default>
49
+
50
+ <default class="gripper_size1">
51
+ <joint limited="true" axis="0 0 1" armature="0.02" damping="0.3"/>
52
+ <general ctrllimited="true" forcelimited="true" ctrlrange="0 1.14 " biastype="affine" forcerange="-10 10" gainprm="100" biasprm="0 -100 -4"/>
53
+ </default>
54
+
55
+ </default>
56
+
57
+ <asset>
58
+ <!-- Textures for multi-material links -->
59
+ <texture name="T_torso_base_link" type="2d" file="../../../urdf/astribot_s1_urdf/meshes/textures/astribot_torso_base_link.png"/>
60
+ <texture name="T_torso_link_2" type="2d" file="../../../urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_2.png"/>
61
+ <texture name="T_torso_link_4" type="2d" file="../../../urdf/astribot_s1_urdf/meshes/textures/astribot_torso_link_4.png"/>
62
+ <texture name="T_head_link_2" type="2d" file="../../../urdf/astribot_s1_urdf/meshes/textures/astribot_head_link_2.png"/>
63
+
64
+ <!-- Materials for textured links -->
65
+ <material name="M_torso_base_link" texture="T_torso_base_link" specular="0.4" shininess="0.3"/>
66
+ <material name="M_torso_link_2" texture="T_torso_link_2" specular="0.4" shininess="0.3"/>
67
+ <material name="M_torso_link_4" texture="T_torso_link_4" specular="0.5" shininess="0.3"/>
68
+ <material name="M_head_link_2" texture="T_head_link_2" specular="0.3" shininess="0.2"/>
69
+
70
+ <!-- Materials for solid-color links -->
71
+ <material name="M_white_shell" rgba="0.973 0.976 0.984 1" specular="0.5" shininess="0.3"/>
72
+ <material name="M_black_neck" rgba="0.098 0.098 0.11 1" specular="0.1" shininess="0.05"/>
73
+ <material name="M_dark_mechanism" rgba="0.216 0.216 0.235 1" specular="0.3" shininess="0.2"/>
74
+ <material name="M_rubber_wheel" rgba="0.149 0.149 0.157 1" specular="0.05" shininess="0.02"/>
75
+
76
+ <!-- Textured meshes (OBJ with UV) -->
77
+ <mesh name="astribot_torso_base_link" file="../../../urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj"/>
78
+ <mesh name="astribot_torso_link_2" file="../../../urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj"/>
79
+ <mesh name="astribot_torso_link_4" file="../../../urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj"/>
80
+ <mesh name="astribot_head_link_2" file="../../../urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj"/>
81
+
82
+ <!-- STL meshes (single-color links) -->
83
+ <mesh name="wheel_RF_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RF_Link.STL"/>
84
+ <mesh name="wheel_LF_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LF_Link.STL"/>
85
+ <mesh name="wheel_RR_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_torso/wheel_RR_Link.STL"/>
86
+ <mesh name="wheel_LR_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_torso/wheel_LR_Link.STL"/>
87
+ <mesh name="astribot_torso_link_1" file="../../../urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_1.STL"/>
88
+ <mesh name="astribot_torso_link_3" file="../../../urdf/astribot_s1_urdf/meshes/s1_torso/astribot_torso_link_3.STL"/>
89
+
90
+ <mesh name="astribot_head_base_link" file="../../../urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_base_link.STL"/>
91
+ <mesh name="astribot_head_link_1" file="../../../urdf/astribot_s1_urdf/meshes/s1_head/astribot_head_link_1.STL"/>
92
+
93
+ <mesh name="astribot_arm_left_base_link" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL"/>
94
+ <mesh name="astribot_arm_right_base_link" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL"/>
95
+ <mesh name="astribot_arm_link_1" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL"/>
96
+ <mesh name="astribot_arm_left_link_2" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL"/>
97
+ <mesh name="astribot_arm_link_3" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL"/>
98
+ <mesh name="astribot_arm_link_4" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL"/>
99
+ <mesh name="astribot_arm_link_5" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL"/>
100
+ <mesh name="astribot_arm_link_6" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL"/>
101
+ <mesh name="astribot_arm_link_7" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL"/>
102
+ <mesh name="astribot_arm_right_link_2" file="../../../urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL"/>
103
+
104
+ <mesh name="gripper_base_link" file="../../../urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL"/>
105
+ <mesh name="gripper_L1_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL"/>
106
+ <mesh name="gripper_L11_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL"/>
107
+ <mesh name="gripper_L2_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL"/>
108
+ <mesh name="gripper_R1_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL"/>
109
+ <mesh name="gripper_R11_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL"/>
110
+ <mesh name="gripper_R2_Link" file="../../../urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL"/>
111
+ </asset>
112
+ </mujocoinclude>
1500case/source/models/trackc/astribot_descriptions/mjcf/astribot_s1_mjcf/model_with_effector/astribot_s1_model_with_gripper.xml ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <mujoco model="astribot_torso">
2
+
3
+ <inertial pos="-0.0076187 -0.0020711 0.013725" quat="0.019455 0.708067 -0.0183173 0.70564" mass="6.7123" diaginertia="0.148701 0.08243 0.079229"/>
4
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_torso_base_link" mesh="astribot_torso_base_link"/>
5
+ <site name="astribot_chassis_imu_site" pos="0 0 0" />
6
+ <!-- <site name="chassis" pos="0.0 0 -0.097" /> -->
7
+
8
+ <body name="wheel_RF_Link" pos="0.216347 -0.216347 -0.015" quat="0.270599 0.65328 -0.2706 0.653282" gravcomp="0">
9
+ <inertial pos="2.7624e-07 -1.7583e-07 0.014539" quat="0.270598 0.653281 -0.270598 0.653281" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876"/>
10
+ <!-- <joint name="astribot_chassis_joint_right_front" pos="0 0 0" axis="0 0 1" range="-1000 1000"/> -->
11
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_RF_Link"/>
12
+ <!-- <geom type="sphere" euler="0 0 0" size="0.0825 0.0825 0.0825" rgba="1 0 1 0.1" mass="0.56418" solref=".01 .002" solimp="0.99 0.99 0.01" friction="10 1 1"/> -->
13
+ </body>
14
+
15
+ <body name="wheel_LF_Link" pos="0.216347 0.216347 -0.015" quat="0.270599 -0.65328 -0.2706 -0.653282" gravcomp="0">
16
+ <inertial pos="2.7617e-07 -1.7589e-07 0.014539" quat="0.270598 0.653281 -0.270598 0.653281" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876"/>
17
+ <!-- <joint name="astribot_chassis_joint_left_front" pos="0 0 0" axis="0 0 1" range="-1000 1000"/> -->
18
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_LF_Link"/>
19
+ <!-- <geom type="sphere" euler="0 0 0" size="0.0825 0.0825 0.0825" rgba="1 0 1 0.1" mass="0.56418" solref=".01 .002" solimp="0.99 0.99 0.01" friction="10 1 1"/> -->
20
+ </body>
21
+
22
+ <body name="wheel_RR_Link" pos="-0.216347 -0.211347 -0.015" quat="0.65328 0.270597 -0.653283 0.270598" gravcomp="0">
23
+ <inertial pos="-2.7619e-07 1.7583e-07 0.014539" quat="0.270598 0.653281 -0.270598 0.653281" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876"/>
24
+ <!-- <joint name="astribot_chassis_joint_right_rear" pos="0 0 0" axis="0 0 1" range="-1000 1000"/> -->
25
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_RR_Link"/>
26
+ <!-- <geom type="sphere" euler="0 0 0" size="0.0825 0.0825 0.0825" rgba="1 0 1 0.1" mass="0.56418" solref=".01 .002" solimp="0.99 0.99 0.01" friction="10 1 1"/> -->
27
+ </body>
28
+
29
+ <body name="wheel_LR_Link" pos="-0.216347 0.211347 -0.015" quat="0.65328 -0.270597 -0.653283 -0.270598" gravcomp="0">
30
+ <inertial pos="0.0019998 -0.0070713 0.014539" quat="0.653281 0.270598 -0.653281 0.270598" mass="0.56418" diaginertia="0.0015639 0.000831884 0.000831876"/>
31
+ <!-- <joint name="astribot_chassis_joint_left_rear" pos="0 0 0" axis="0 0 1" range="-1000 1000"/> -->
32
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_rubber_wheel" mesh="wheel_LR_Link"/>
33
+ <!-- <geom type="sphere" euler="0 0 0" size="0.0825 0.0825 0.0825" rgba="1 0 1 0.1" mass="0.56418" solref=".01 .002" solimp="0.99 0.99 0.01" friction="10 1 1"/> -->
34
+ </body>
35
+
36
+ <body name="astribot_torso_link_1" pos="0 0 0.12" quat="0.499998 -0.5 0.5 0.500002" gravcomp="0">
37
+ <inertial pos="-0.078229 0.033333 0" quat="0.70346 0.70346 0.0717209 0.0717209" mass="9.2571" diaginertia="0.397539 0.374664 0.137718"/>
38
+ <joint name="astribot_torso_joint_1" pos="0 0 0" axis="0 0 1" range="0.0 1.5"/>
39
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_torso_link_1"/>
40
+ <body name="astribot_torso_link_2" pos="-0.38 0 0" gravcomp="0">
41
+ <inertial pos="-0.23187 0.033333 0" quat="0.0851505 0.715372 -0.0840248 0.688427" mass="5.6183" diaginertia="0.0175257 0.0129591 0.00795872"/>
42
+ <joint name="astribot_torso_joint_2" pos="0 0 0" axis="0 0 1" range="-2.35 0.0"/>
43
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_torso_link_2" mesh="astribot_torso_link_2"/>
44
+ <body name="astribot_torso_link_3" pos="-0.39 0 0" gravcomp="0">
45
+ <inertial pos="0.133333 -0.086872 0" quat="0.00834705 0.708024 0.00970003 0.706073" mass="0.49013" diaginertia="0.000380401 0.000365211 0.000222118"/>
46
+ <joint name="astribot_torso_joint_3" pos="0 0 0" axis="0 0 1" range="0.0 2.4"/>
47
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_torso_link_3"/>
48
+ <body name="astribot_torso_link_4" pos="0 0 0" quat="0.499998 0.5 -0.500002 -0.5" gravcomp="0">
49
+ <inertial pos="0.00476227 -4.56967e-05 0.242913" quat="0.999954 7.7949e-05 0.00906445 -0.00297427" mass="11.7741" diaginertia="0.0165787 0.0149043 0.0110611"/>
50
+ <joint name="astribot_torso_joint_4" pos="0 0 0" axis="0 0 1" range="-1.58 1.58"/>
51
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_torso_link_4" mesh="astribot_torso_link_4"/>
52
+ <geom pos="0 0 0.46765" type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_black_neck" mesh="astribot_head_base_link"/>
53
+ <geom pos="0 0.06449 0.36823" quat="0.579228 -0.40558 -0.40558 -0.579228" type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_left_base_link"/>
54
+ <geom pos="0 -0.06449 0.36823" quat="0.579228 0.40558 -0.40558 0.579228" type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_right_base_link"/>
55
+ <body name="astribot_head_link_1" pos="0 0 0.46765" gravcomp="0">
56
+
57
+ <inertial pos="0.0744479 0.0340434 -0.148896" quat="0.710346 -0.0335656 0.0294335 0.702436" mass="0.18685" diaginertia="4.79716e-05 4.56699e-05 3.77084e-05"/>
58
+ <joint name="astribot_head_joint_1" pos="0 0 0" axis="0 0 1" range="-1.6 1.6"/>
59
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_dark_mechanism" mesh="astribot_head_link_1"/>
60
+ <body name="astribot_head_link_2" pos="0 0 0" quat="0.707105 -0.707108 0 0" gravcomp="0">
61
+
62
+ <camera name="head_rgbd" pos="0.0603 -0.2139 -0.0277" quat="0.7025 -0.0295 -0.7100 -0.0135" fovy="51.4175"/>
63
+ <body name="astribot_head_camera_base_link" pos="0.09 0.0 0.08" quat="0.0000 0.0000 -1.0 0.0" gravcomp="0">
64
+ </body>
65
+
66
+ <inertial pos="0.00705824 -0.144726 -0.00061724" quat="0.696314 0.714797 -0.0643815 -0.00814535" mass="0.970124" diaginertia="0.00559994 0.00544762 0.00147305"/>
67
+ <joint name="astribot_head_joint_2" pos="0 0 0" axis="0 0 1" range="-1.0 1.0"/>
68
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_head_link_2" mesh="astribot_head_link_2"/>
69
+ </body>
70
+ </body>
71
+
72
+ <!-- <site name="torso" pos="0 0 0.34475" size="0.01 0.01 0.01" rgba="1 0 0 1" type="sphere"></site> -->
73
+ <body name="astribot_arm_left_link_1" pos="-2.29129e-09 0.150002 0.399354" quat="0.579228 -0.40558 -0.40558 -0.579228" gravcomp="0">
74
+ <!-- <site name="arm_left_base" pos="0 -0.0 0"/> -->
75
+ <inertial pos="-0.0545455 -0.0306519 -0.0291245" quat="0.799744 0.00150164 -0.00673322 0.600302" mass="0.659304" diaginertia="0.000653094 0.000647485 0.000501341"/>
76
+ <joint name="astribot_arm_left_joint_1" pos="0 0 0" axis="0 0 1" range="-3.087 1.517"/>
77
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_1"/>
78
+ <body name="astribot_arm_left_link_2" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
79
+ <inertial pos="-0.0727273 0.00957826 0.0542806" quat="0.979046 0.195867 -0.0151095 -0.0536387" mass="1.60392" diaginertia="0.00361844 0.00305818 0.00149762"/>
80
+ <joint name="astribot_arm_left_joint_2" pos="0 0 0" axis="0 0 1" range="-1.517 0.55"/>
81
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_left_link_2"/>
82
+ <body name="astribot_arm_left_link_3" pos="0 0.05 0" quat="0.499998 0.5 -0.500002 -0.5" gravcomp="0">
83
+ <inertial pos="-0.0054798 0.00064517 0.0858537" quat="0.742648 -0.0317889 -0.0338067 0.668072" mass="2.21205" diaginertia="0.0178489 0.0176537 0.00205017"/>
84
+ <joint name="astribot_arm_left_joint_3" pos="0 0 0" axis="0 0 1" range="-3.08 1.517"/>
85
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_3"/>
86
+ <body name="astribot_arm_left_link_4" pos="0.03 0 0.309" quat="0.707105 -0.707108 0 0" gravcomp="0">
87
+ <inertial pos="0.0157758 -0.111111 0.0151356" quat="0.516854 0.517425 -0.45414 0.508813" mass="0.329291" diaginertia="0.000501311 0.000477171 0.000367278"/>
88
+ <joint name="astribot_arm_left_joint_4" pos="0 0 0" axis="0 0 1" range="0.0 2.55"/>
89
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_4"/>
90
+ <body name="astribot_arm_left_link_5" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
91
+ <inertial pos="-0.00984351 0.00748991 0.136847" quat="0.999961 -0.00684676 0.000823261 0.00549176" mass="1.11677" diaginertia="0.00454095 0.00438988 0.000793736"/>
92
+ <joint name="astribot_arm_left_joint_5" pos="0 0 0" axis="0 0 1" range="-2.37 2.37"/>
93
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_5"/>
94
+ <body name="astribot_arm_left_link_6" pos="0 0 0.277" quat="0.707105 -0.707108 0 0" gravcomp="0">
95
+ <inertial pos="0.010363 -0.00408524 -0.0404713" quat="0.99999 0.00126801 -0.0015825 0.00407582" mass="0.202188" diaginertia="0.000164741 0.00015608 8.55488e-05"/>
96
+ <joint name="astribot_arm_left_joint_6" pos="0 0 0" axis="0 0 1" range="-0.78 0.78"/>
97
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_6"/>
98
+ <body name="astribot_arm_left_link_7" pos="0 0 0" quat="0.707105 0 0.707108 0" gravcomp="0">
99
+ <inertial pos="0.00185812 -0.0895091 0.00257872" quat="0.711438 0.701239 0.0218365 -0.0405392" mass="1.45143" diaginertia="0.00202892 0.00199405 0.000442623"/>
100
+ <joint name="astribot_arm_left_joint_7" pos="0 0 0" axis="0 0 1" range="-1.55 1.55"/>
101
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_7"/>
102
+ <site name="arm_left_tool" pos="0 -0.15 0"/>
103
+
104
+ <body name="arm_left_tool_cam" pos="0 -0.15 0">
105
+ <camera name="left_wrist_rgbd"
106
+ pos="0.011420996159648984 0.058882000224149605 0.044260118849329295"
107
+ quat="0.703108425353722 -0.7109134990656752 -0.009037420129074155 -0.012604129490710232"
108
+ fovy="57"/>
109
+ </body>
110
+
111
+ <site name="force_torque_sensor_left"/>
112
+ <!-- <geom class="Widget" rgba="0 1 0 0.1" pos="0 0.0 0" euler="1.5708 0 0" type="cylinder" size="0.025 0.025" />-->
113
+ <body name="astribot_arm_left_tool_link" pos="0 -0.048 0" euler="1.5707963 0 0" gravcomp="0">
114
+ <include file="../astribot_gripper/astribot_gripper_left/astribot_gripper_left_model.xml"></include>
115
+ </body>
116
+ </body>
117
+ </body>
118
+ </body>
119
+ </body>
120
+ </body>
121
+ </body>
122
+ </body>
123
+
124
+ <body name="astribot_arm_right_link_1" pos="-2.29129e-09 -0.150002 0.399354" quat="0.579228 0.40558 -0.40558 0.579228" gravcomp="0">
125
+ <inertial pos="-0.0545455 -0.0306519 -0.0291245" quat="0.799744 0.00150164 -0.00673322 0.600302" mass="0.659304" diaginertia="0.000653094 0.000647485 0.000501341"/>
126
+ <joint name="astribot_arm_right_joint_1" pos="0 0 0" axis="0 0 1" range="-1.517 3.087"/>
127
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_1"/>
128
+
129
+ <body name="astribot_arm_right_link_2" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
130
+
131
+ <inertial pos="-0.0727273 0.00957826 -0.0542806" quat="0.977722 -0.198255 0.000268699 -0.0689497" mass="1.60392" diaginertia="0.003953 0.0034509 0.001474"/>
132
+ <joint name="astribot_arm_right_joint_2" pos="0 0 0" axis="0 0 1" range="-1.517 0.55"/>
133
+
134
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_right_link_2"/>
135
+ <body name="astribot_arm_right_link_3" pos="0 0.05 0" quat="0.499998 0.5 -0.500002 -0.5" gravcomp="0">
136
+ <inertial pos="-0.0054798 0.00064517 0.0858537" quat="0.742648 -0.0317889 -0.0338067 0.668072" mass="2.21205" diaginertia="0.0178489 0.0176537 0.00205017"/>
137
+ <joint name="astribot_arm_right_joint_3" pos="0 0 0" axis="0 0 1" range="-1.517 3.08"/>
138
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_3"/>
139
+ <body name="astribot_arm_right_link_4" pos="0.03 0 0.309" quat="0.707105 -0.707108 0 0" gravcomp="0">
140
+ <inertial pos="0.0157758 -0.111111 0.0151356" quat="0.516854 0.517425 -0.45414 0.508813" mass="0.329291" diaginertia="0.000501311 0.000477171 0.000367278"/>
141
+ <joint name="astribot_arm_right_joint_4" pos="0 0 0" axis="0 0 1" range="0.0 2.55"/>
142
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_4"/>
143
+ <body name="astribot_arm_right_link_5" pos="0 0 0" quat="0.707105 0.707108 0 0" gravcomp="0">
144
+ <inertial pos="-0.00984351 0.00748991 0.136847" quat="0.999961 -0.00684676 0.000823261 0.00549176" mass="1.11677" diaginertia="0.00454095 0.00438988 0.000793736"/>
145
+ <joint name="astribot_arm_right_joint_5" pos="0 0 0" axis="0 0 1" range="-2.37 2.37"/>
146
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_5"/>
147
+ <body name="astribot_arm_right_link_6" pos="0 0 0.277" quat="0.707105 -0.707108 0 0" gravcomp="0">
148
+ <inertial pos="0.010363 -0.00408524 -0.0404713" quat="0.99999 0.00126801 -0.0015825 0.00407582" mass="0.202188" diaginertia="0.000164741 0.00015608 8.55488e-05"/>
149
+ <joint name="astribot_arm_right_joint_6" pos="0 0 0" axis="0 0 1" range="-0.78 0.78"/>
150
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_6"/>
151
+ <body name="astribot_arm_right_link_7" pos="0 0 0" quat="0.707105 0 0.707108 0" gravcomp="0">
152
+ <inertial pos="0.00185812 -0.0895091 0.00257872" quat="0.711438 0.701239 0.0218365 -0.0405392" mass="1.45143" diaginertia="0.00202892 0.00199405 0.000442623"/>
153
+ <joint name="astribot_arm_right_joint_7" pos="0 0 0" axis="0 0 1" range="-1.55 1.55"/>
154
+ <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" material="M_white_shell" mesh="astribot_arm_link_7"/>
155
+ <site name="arm_right_tool" pos="0 -0.15 0"/>
156
+
157
+ <body name="arm_right_tool_cam" pos="0 -0.15 0"> <!-- 相对于父 body 的位置 -->
158
+ <camera name="right_wrist_rgbd"
159
+ pos="0.00772 0.05592 0.04319"
160
+ quat="-0.7130607009975457 0.7006910271198059 0.013493708973317153 0.019860539389038687"
161
+ fovy="57"/>
162
+ </body>
163
+
164
+ <site name="force_torque_sensor_right"/>
165
+ <body name="astribot_arm_right_tool_link" pos="0 -0.048 0" euler="1.5707963 0 0" gravcomp="0">
166
+ <include file="../astribot_gripper/astribot_gripper_right/astribot_gripper_right_model.xml"></include>
167
+ </body>
168
+ </body>
169
+ </body>
170
+ </body>
171
+ </body>
172
+ </body>
173
+ </body>
174
+ </body>
175
+ </body>
176
+ </body>
177
+ </body>
178
+ </body>
179
+
180
+
181
+ </mujoco>
182
+
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_head_link_2.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a6dc2fa33de59fd0502c6482eaabc48d846c1ecc863d74f1ec33f83fcd96360
3
+ size 38496139
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_base_link.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd7b42ad341963e0aaa7e898411078173ba2613a5eff60140232c7d04d0b36da
3
+ size 40001354
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_2.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3f639a37cc63757da571bbeeedd130c98afd798af6ba33f1a7960884549b1e3
3
+ size 33347575
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/obj/astribot_torso_link_4.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:955db3acb335e179d35a0ad76f537109f6d2ab0b74fd6d9d5d0db7ed7ef14a32
3
+ size 28906301
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_base_link.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5ce4a1ca6343fa73aac37e9ab1581224eae72b13e906592e253f5b9ff71b7e7
3
+ size 393484
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_left_link_2.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29a31a52440708e5257005fcaa766d782b6e9895a7d641cf96818db5939b72b5
3
+ size 1168184
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_1.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6c9d2fb9539f3865c15f86dae8bfd88e23daab3a8136775a7f5e840519a9ccf
3
+ size 160984
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_3.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8d48fa6ed9eae1d1b85be42937c9f162fb9039a630943f8fae9b511c1fb711a
3
+ size 1431884
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_4.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf0ae423d242e076a628c4181afcd0f42c677d94f5b31582e79997b5620ac043
3
+ size 325584
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_5.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8301d519a7cac044de0e9b1dda82147382aed2d0b64b5c2d7035461464a21ae
3
+ size 1988484
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_6.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2a3a57e115c59006eb37ac8dbc28736e2366a048ea2e1545731910ad4c897f7
3
+ size 626484
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_link_7.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:650d570d2e0d2978fc8b870adf2495e8cd24944b6e3a2da3c0fad0a48db2fd8f
3
+ size 216184
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_base_link.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2d63475f85bf98fc0e7569ee5aeb554ff9dc0d6abe10e85b5e58d17c822946e
3
+ size 394684
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_arm/astribot_arm_right_link_2.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9074ba1114c0d0fb9f950c678689f5e2536beadf84c8b24a872165c84066583d
3
+ size 1170384
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L11_Link.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c2ac3e5c2039b5e3e9127f1e612520b4e76863619e6d4853d5f640e988df401
3
+ size 455284
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L1_Link.STL ADDED
Binary file (60.6 kB). View file
 
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_L2_Link.STL ADDED
Binary file (82.1 kB). View file
 
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R11_Link.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10ce463e0fb7bfb632b310f9f47ce746be98383ed2538f118c4fb4ce69971c55
3
+ size 455284
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R1_Link.STL ADDED
Binary file (60.6 kB). View file
 
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_R2_Link.STL ADDED
Binary file (82.1 kB). View file
 
1500case/source/models/trackc/astribot_descriptions/urdf/astribot_s1_urdf/meshes/s1_gripper/astribot_gripper_base_link.STL ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:887e309b8db7285917c26d272a84a3c56b30638e1f4e71e2b23930a9d3244db1
3
+ size 1086384