diffneusim 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (682) hide show
  1. diffneusim/__init__.py +1 -0
  2. diffneusim/_cache.py +42 -0
  3. diffneusim/_paths.py +5 -0
  4. diffneusim/bindings/rew14_ext.cu +115 -0
  5. diffneusim/bindings/soft14_capi.cpp +443 -0
  6. diffneusim/bindings/soft14_engine_ext.cu +596 -0
  7. diffneusim/bindings/soft_capi.cpp +782 -0
  8. diffneusim/bindings/soft_engine_ext.cu +495 -0
  9. diffneusim/core/cpu_engine/build.sh +40 -0
  10. diffneusim/core/cpu_engine/fiber/cuda_runtime.h +445 -0
  11. diffneusim/core/cpu_engine/x14_cpu.cpp +283 -0
  12. diffneusim/core/diff/dual.h +126 -0
  13. diffneusim/core/include/diffneusim/macros.h +35 -0
  14. diffneusim/core/kin/kinematic_tree.h +273 -0
  15. diffneusim/core/math/so3.h +182 -0
  16. diffneusim/core/soft/adj/out_adj.h +102 -0
  17. diffneusim/core/soft/adj/rnea_adj.h +425 -0
  18. diffneusim/core/soft/adj/rows_adj.h +439 -0
  19. diffneusim/core/soft/adj/rows_functor.h +89 -0
  20. diffneusim/core/soft/adj/rows_lanes.h +443 -0
  21. diffneusim/core/soft/adj/shell_adj.h +243 -0
  22. diffneusim/core/soft/adj/tree_adj.h +356 -0
  23. diffneusim/core/soft/collide.h +183 -0
  24. diffneusim/core/soft/gpu/adj14.cuh +233 -0
  25. diffneusim/core/soft/gpu/adj14_mus.cuh +98 -0
  26. diffneusim/core/soft/gpu/adj_shell.cuh +50 -0
  27. diffneusim/core/soft/gpu/adj_tab.cuh +49 -0
  28. diffneusim/core/soft/gpu/body14.cuh +47 -0
  29. diffneusim/core/soft/gpu/chol_rn.cuh +458 -0
  30. diffneusim/core/soft/gpu/chol_small.cuh +123 -0
  31. diffneusim/core/soft/gpu/chol_split.cuh +193 -0
  32. diffneusim/core/soft/gpu/engine_launch.cuh +263 -0
  33. diffneusim/core/soft/gpu/fk_rn.cuh +109 -0
  34. diffneusim/core/soft/gpu/generated/body_019e20820f86_mmfloor.cuh +28 -0
  35. diffneusim/core/soft/gpu/generated/body_62f77a4bb16b_mmfloor.cuh +52 -0
  36. diffneusim/core/soft/gpu/generated/body_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +28 -0
  37. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +28 -0
  38. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +28 -0
  39. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +28 -0
  40. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +28 -0
  41. diffneusim/core/soft/gpu/generated/body_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +52 -0
  42. diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor.cuh +25 -0
  43. diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +25 -0
  44. diffneusim/core/soft/gpu/generated/g1_soft_5db44fd45286.cuh +74 -0
  45. diffneusim/core/soft/gpu/generated/split_62f77a4bb16b_mmfloor.cuh +18 -0
  46. diffneusim/core/soft/gpu/generated/split_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +18 -0
  47. diffneusim/core/soft/gpu/generated/x14_soft_019e20820f86_mmfloor.cuh +123 -0
  48. diffneusim/core/soft/gpu/generated/x14_soft_62f77a4bb16b_mmfloor.cuh +129 -0
  49. diffneusim/core/soft/gpu/generated/x14_soft_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +123 -0
  50. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +123 -0
  51. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +123 -0
  52. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +123 -0
  53. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +123 -0
  54. diffneusim/core/soft/gpu/generated/x14_soft_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +129 -0
  55. diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor.cuh +123 -0
  56. diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +123 -0
  57. diffneusim/core/soft/gpu/k_mus.cuh +1038 -0
  58. diffneusim/core/soft/gpu/k_mus_host.cuh +377 -0
  59. diffneusim/core/soft/gpu/k_pre.cuh +52 -0
  60. diffneusim/core/soft/gpu/kernel_p.cuh +490 -0
  61. diffneusim/core/soft/gpu/kp14.cuh +465 -0
  62. diffneusim/core/soft/gpu/l2v2.cuh +367 -0
  63. diffneusim/core/soft/gpu/l2x14.cuh +319 -0
  64. diffneusim/core/soft/gpu/l3.cuh +1483 -0
  65. diffneusim/core/soft/gpu/model_view.cuh +48 -0
  66. diffneusim/core/soft/gpu/mus_case_fits.h +15 -0
  67. diffneusim/core/soft/gpu/mus_classes.h +182 -0
  68. diffneusim/core/soft/gpu/mus_row_cf.h +44 -0
  69. diffneusim/core/soft/gpu/rew14.cuh +177 -0
  70. diffneusim/core/soft/gpu/rows_ctab.cuh +44 -0
  71. diffneusim/core/soft/gpu/tree_m.cuh +247 -0
  72. diffneusim/core/soft/gpu/x14_engine_kernels.cuh +260 -0
  73. diffneusim/core/soft/gpu/x14_rowcf.h +14 -0
  74. diffneusim/core/soft/hand.h +124 -0
  75. diffneusim/core/soft/impedance.h +115 -0
  76. diffneusim/core/soft/jvp.h +202 -0
  77. diffneusim/core/soft/kin.h +250 -0
  78. diffneusim/core/soft/muscle.h +1208 -0
  79. diffneusim/core/soft/newton.h +371 -0
  80. diffneusim/core/soft/rows.h +176 -0
  81. diffneusim/core/soft/step.h +188 -0
  82. diffneusim/core/soft/tape.h +313 -0
  83. diffneusim/core/soft/x14/collide14.h +69 -0
  84. diffneusim/core/soft/x14/jvp14.h +182 -0
  85. diffneusim/core/soft/x14/law14.h +453 -0
  86. diffneusim/core/soft/x14adj/collide14_adj.h +134 -0
  87. diffneusim/core/soft/x14adj/passive14_adj.h +162 -0
  88. diffneusim/core/soft/x14adj/reward14.h +484 -0
  89. diffneusim/core/soft/x14adj/rows14_adj.h +400 -0
  90. diffneusim/core/soft/x14adj/scan14.h +349 -0
  91. diffneusim/core/soft/x14adj/shell14_adj.h +122 -0
  92. diffneusim/core/soft/x14adj/sweep14.h +255 -0
  93. diffneusim/core/soft/x14adj/tree14_adj.h +500 -0
  94. diffneusim/core/soft/x14adj/x14adj_common.h +96 -0
  95. diffneusim/data/mirror/H1622v2k_geyer_hfdeq.npz +0 -0
  96. diffneusim/data/mirror/H1622v2k_hfd.npz +0 -0
  97. diffneusim/data/mirror/H1622v2k_millard_hfdeq.npz +0 -0
  98. diffneusim/data/mirror/fullbody_contact.npz +0 -0
  99. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard.npz +0 -0
  100. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str.npz +0 -0
  101. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str_rigid.npz +0 -0
  102. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.npz +0 -0
  103. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.npz +0 -0
  104. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq.npz +0 -0
  105. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin.npz +0 -0
  106. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_calf2_pe.npz +0 -0
  107. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
  108. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfix.npz +0 -0
  109. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.npz +0 -0
  110. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01.npz +0 -0
  111. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01legs.npz +0 -0
  112. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01lumbar.npz +0 -0
  113. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfix.npz +0 -0
  114. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfixlegs01.npz +0 -0
  115. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
  116. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
  117. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
  118. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
  119. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair.npz +0 -0
  120. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
  121. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_hinge.npz +0 -0
  122. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
  123. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
  124. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
  125. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
  126. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_lspine_girdle_osimeq.npz +0 -0
  127. diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_millard.npz +0 -0
  128. diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_osimeq.npz +0 -0
  129. diffneusim/data/mirror/myoleg26_3d_compound_g14eq.npz +0 -0
  130. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq.npz +0 -0
  131. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose.npz +0 -0
  132. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin.npz +0 -0
  133. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30.npz +0 -0
  134. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30.npz +0 -0
  135. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_luispe.npz +0 -0
  136. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_trunk0701.npz +0 -0
  137. diffneusim/data/muscle_fit/wang_mass_volume_14t.json +91 -0
  138. diffneusim/data/muscle_fit/wang_mass_volume_14t_axfix.json +91 -0
  139. diffneusim/data/muscle_fit/wang_mass_volume_14t_axfixlegs01.json +91 -0
  140. diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01.json +91 -0
  141. diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01legs.json +91 -0
  142. diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01lumbar.json +91 -0
  143. diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfix.json +91 -0
  144. diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfixlegs01.json +91 -0
  145. diffneusim/data/muscle_fit/wang_mass_volume_14t_n1.json +91 -0
  146. diffneusim/data/muscle_fit/wang_mass_volume_14t_n1a.json +91 -0
  147. diffneusim/data/muscle_fit/wang_mass_volume_14t_n2.json +91 -0
  148. diffneusim/data/muscle_fit/wang_mass_volume_14t_rom23.json +91 -0
  149. diffneusim/data/reference/musclemimic/myofullbody_mimic_sites.json +261 -0
  150. diffneusim/data/reference/pose3/pose3_scone.json +305 -0
  151. diffneusim/data/reference/pose3/pose3_scone.txt +3 -0
  152. diffneusim/data/reference/pose3/pose3_scone_gait.npz +0 -0
  153. diffneusim/data/reference/pose3/pose3_scone_mirror.npz +0 -0
  154. diffneusim/data/reference/pose3/pose3_scone_stand.npz +0 -0
  155. diffneusim/data/reference/x016run/MD5SUMS +241 -0
  156. diffneusim/data/reference/x016run/x016run_states.txt +240 -0
  157. diffneusim/data/reference/x016run/x016run_v3p00_s0_l0.npz +0 -0
  158. diffneusim/data/reference/x016run/x016run_v3p00_s0_l1.npz +0 -0
  159. diffneusim/data/reference/x016run/x016run_v3p00_s0_l2.npz +0 -0
  160. diffneusim/data/reference/x016run/x016run_v3p00_s0_l3.npz +0 -0
  161. diffneusim/data/reference/x016run/x016run_v3p00_s0_r0.npz +0 -0
  162. diffneusim/data/reference/x016run/x016run_v3p00_s0_r1.npz +0 -0
  163. diffneusim/data/reference/x016run/x016run_v3p00_s0_r2.npz +0 -0
  164. diffneusim/data/reference/x016run/x016run_v3p00_s0_r3.npz +0 -0
  165. diffneusim/data/reference/x016run/x016run_v3p00_s1_l0.npz +0 -0
  166. diffneusim/data/reference/x016run/x016run_v3p00_s1_l1.npz +0 -0
  167. diffneusim/data/reference/x016run/x016run_v3p00_s1_l2.npz +0 -0
  168. diffneusim/data/reference/x016run/x016run_v3p00_s1_l3.npz +0 -0
  169. diffneusim/data/reference/x016run/x016run_v3p00_s1_r0.npz +0 -0
  170. diffneusim/data/reference/x016run/x016run_v3p00_s1_r1.npz +0 -0
  171. diffneusim/data/reference/x016run/x016run_v3p00_s1_r2.npz +0 -0
  172. diffneusim/data/reference/x016run/x016run_v3p00_s1_r3.npz +0 -0
  173. diffneusim/data/reference/x016run/x016run_v3p00_s2_l0.npz +0 -0
  174. diffneusim/data/reference/x016run/x016run_v3p00_s2_l1.npz +0 -0
  175. diffneusim/data/reference/x016run/x016run_v3p00_s2_l2.npz +0 -0
  176. diffneusim/data/reference/x016run/x016run_v3p00_s2_l3.npz +0 -0
  177. diffneusim/data/reference/x016run/x016run_v3p00_s2_r0.npz +0 -0
  178. diffneusim/data/reference/x016run/x016run_v3p00_s2_r1.npz +0 -0
  179. diffneusim/data/reference/x016run/x016run_v3p00_s2_r2.npz +0 -0
  180. diffneusim/data/reference/x016run/x016run_v3p00_s2_r3.npz +0 -0
  181. diffneusim/data/reference/x016run/x016run_v3p00_s3_l0.npz +0 -0
  182. diffneusim/data/reference/x016run/x016run_v3p00_s3_l1.npz +0 -0
  183. diffneusim/data/reference/x016run/x016run_v3p00_s3_l2.npz +0 -0
  184. diffneusim/data/reference/x016run/x016run_v3p00_s3_l3.npz +0 -0
  185. diffneusim/data/reference/x016run/x016run_v3p00_s3_r0.npz +0 -0
  186. diffneusim/data/reference/x016run/x016run_v3p00_s3_r1.npz +0 -0
  187. diffneusim/data/reference/x016run/x016run_v3p00_s3_r2.npz +0 -0
  188. diffneusim/data/reference/x016run/x016run_v3p00_s3_r3.npz +0 -0
  189. diffneusim/data/reference/x016run/x016run_v3p00_s4_l0.npz +0 -0
  190. diffneusim/data/reference/x016run/x016run_v3p00_s4_l1.npz +0 -0
  191. diffneusim/data/reference/x016run/x016run_v3p00_s4_l2.npz +0 -0
  192. diffneusim/data/reference/x016run/x016run_v3p00_s4_l3.npz +0 -0
  193. diffneusim/data/reference/x016run/x016run_v3p00_s4_r0.npz +0 -0
  194. diffneusim/data/reference/x016run/x016run_v3p00_s4_r1.npz +0 -0
  195. diffneusim/data/reference/x016run/x016run_v3p00_s4_r2.npz +0 -0
  196. diffneusim/data/reference/x016run/x016run_v3p00_s4_r3.npz +0 -0
  197. diffneusim/data/reference/x016run/x016run_v3p00_s5_l0.npz +0 -0
  198. diffneusim/data/reference/x016run/x016run_v3p00_s5_l1.npz +0 -0
  199. diffneusim/data/reference/x016run/x016run_v3p00_s5_l2.npz +0 -0
  200. diffneusim/data/reference/x016run/x016run_v3p00_s5_l3.npz +0 -0
  201. diffneusim/data/reference/x016run/x016run_v3p00_s5_r0.npz +0 -0
  202. diffneusim/data/reference/x016run/x016run_v3p00_s5_r1.npz +0 -0
  203. diffneusim/data/reference/x016run/x016run_v3p00_s5_r2.npz +0 -0
  204. diffneusim/data/reference/x016run/x016run_v3p00_s5_r3.npz +0 -0
  205. diffneusim/data/reference/x016run/x016run_v3p00_s6_l0.npz +0 -0
  206. diffneusim/data/reference/x016run/x016run_v3p00_s6_l1.npz +0 -0
  207. diffneusim/data/reference/x016run/x016run_v3p00_s6_l2.npz +0 -0
  208. diffneusim/data/reference/x016run/x016run_v3p00_s6_l3.npz +0 -0
  209. diffneusim/data/reference/x016run/x016run_v3p00_s6_r0.npz +0 -0
  210. diffneusim/data/reference/x016run/x016run_v3p00_s6_r1.npz +0 -0
  211. diffneusim/data/reference/x016run/x016run_v3p00_s6_r2.npz +0 -0
  212. diffneusim/data/reference/x016run/x016run_v3p00_s6_r3.npz +0 -0
  213. diffneusim/data/reference/x016run/x016run_v3p00_s7_l0.npz +0 -0
  214. diffneusim/data/reference/x016run/x016run_v3p00_s7_l1.npz +0 -0
  215. diffneusim/data/reference/x016run/x016run_v3p00_s7_l2.npz +0 -0
  216. diffneusim/data/reference/x016run/x016run_v3p00_s7_l3.npz +0 -0
  217. diffneusim/data/reference/x016run/x016run_v3p00_s7_r0.npz +0 -0
  218. diffneusim/data/reference/x016run/x016run_v3p00_s7_r1.npz +0 -0
  219. diffneusim/data/reference/x016run/x016run_v3p00_s7_r2.npz +0 -0
  220. diffneusim/data/reference/x016run/x016run_v3p00_s7_r3.npz +0 -0
  221. diffneusim/data/reference/x016run/x016run_v3p25_s0_l0.npz +0 -0
  222. diffneusim/data/reference/x016run/x016run_v3p25_s0_l1.npz +0 -0
  223. diffneusim/data/reference/x016run/x016run_v3p25_s0_l2.npz +0 -0
  224. diffneusim/data/reference/x016run/x016run_v3p25_s0_l3.npz +0 -0
  225. diffneusim/data/reference/x016run/x016run_v3p25_s0_r0.npz +0 -0
  226. diffneusim/data/reference/x016run/x016run_v3p25_s0_r1.npz +0 -0
  227. diffneusim/data/reference/x016run/x016run_v3p25_s0_r2.npz +0 -0
  228. diffneusim/data/reference/x016run/x016run_v3p25_s0_r3.npz +0 -0
  229. diffneusim/data/reference/x016run/x016run_v3p25_s1_l0.npz +0 -0
  230. diffneusim/data/reference/x016run/x016run_v3p25_s1_l1.npz +0 -0
  231. diffneusim/data/reference/x016run/x016run_v3p25_s1_l2.npz +0 -0
  232. diffneusim/data/reference/x016run/x016run_v3p25_s1_l3.npz +0 -0
  233. diffneusim/data/reference/x016run/x016run_v3p25_s1_r0.npz +0 -0
  234. diffneusim/data/reference/x016run/x016run_v3p25_s1_r1.npz +0 -0
  235. diffneusim/data/reference/x016run/x016run_v3p25_s1_r2.npz +0 -0
  236. diffneusim/data/reference/x016run/x016run_v3p25_s1_r3.npz +0 -0
  237. diffneusim/data/reference/x016run/x016run_v3p25_s2_l0.npz +0 -0
  238. diffneusim/data/reference/x016run/x016run_v3p25_s2_l1.npz +0 -0
  239. diffneusim/data/reference/x016run/x016run_v3p25_s2_l2.npz +0 -0
  240. diffneusim/data/reference/x016run/x016run_v3p25_s2_l3.npz +0 -0
  241. diffneusim/data/reference/x016run/x016run_v3p25_s2_r0.npz +0 -0
  242. diffneusim/data/reference/x016run/x016run_v3p25_s2_r1.npz +0 -0
  243. diffneusim/data/reference/x016run/x016run_v3p25_s2_r2.npz +0 -0
  244. diffneusim/data/reference/x016run/x016run_v3p25_s2_r3.npz +0 -0
  245. diffneusim/data/reference/x016run/x016run_v3p25_s3_l0.npz +0 -0
  246. diffneusim/data/reference/x016run/x016run_v3p25_s3_l1.npz +0 -0
  247. diffneusim/data/reference/x016run/x016run_v3p25_s3_l2.npz +0 -0
  248. diffneusim/data/reference/x016run/x016run_v3p25_s3_l3.npz +0 -0
  249. diffneusim/data/reference/x016run/x016run_v3p25_s3_r0.npz +0 -0
  250. diffneusim/data/reference/x016run/x016run_v3p25_s3_r1.npz +0 -0
  251. diffneusim/data/reference/x016run/x016run_v3p25_s3_r2.npz +0 -0
  252. diffneusim/data/reference/x016run/x016run_v3p25_s3_r3.npz +0 -0
  253. diffneusim/data/reference/x016run/x016run_v3p25_s4_l0.npz +0 -0
  254. diffneusim/data/reference/x016run/x016run_v3p25_s4_l1.npz +0 -0
  255. diffneusim/data/reference/x016run/x016run_v3p25_s4_l2.npz +0 -0
  256. diffneusim/data/reference/x016run/x016run_v3p25_s4_l3.npz +0 -0
  257. diffneusim/data/reference/x016run/x016run_v3p25_s4_r0.npz +0 -0
  258. diffneusim/data/reference/x016run/x016run_v3p25_s4_r1.npz +0 -0
  259. diffneusim/data/reference/x016run/x016run_v3p25_s4_r2.npz +0 -0
  260. diffneusim/data/reference/x016run/x016run_v3p25_s4_r3.npz +0 -0
  261. diffneusim/data/reference/x016run/x016run_v3p25_s5_l0.npz +0 -0
  262. diffneusim/data/reference/x016run/x016run_v3p25_s5_l1.npz +0 -0
  263. diffneusim/data/reference/x016run/x016run_v3p25_s5_l2.npz +0 -0
  264. diffneusim/data/reference/x016run/x016run_v3p25_s5_l3.npz +0 -0
  265. diffneusim/data/reference/x016run/x016run_v3p25_s5_r0.npz +0 -0
  266. diffneusim/data/reference/x016run/x016run_v3p25_s5_r1.npz +0 -0
  267. diffneusim/data/reference/x016run/x016run_v3p25_s5_r2.npz +0 -0
  268. diffneusim/data/reference/x016run/x016run_v3p25_s5_r3.npz +0 -0
  269. diffneusim/data/reference/x016run/x016run_v3p25_s6_l0.npz +0 -0
  270. diffneusim/data/reference/x016run/x016run_v3p25_s6_l1.npz +0 -0
  271. diffneusim/data/reference/x016run/x016run_v3p25_s6_l2.npz +0 -0
  272. diffneusim/data/reference/x016run/x016run_v3p25_s6_l3.npz +0 -0
  273. diffneusim/data/reference/x016run/x016run_v3p25_s6_r0.npz +0 -0
  274. diffneusim/data/reference/x016run/x016run_v3p25_s6_r1.npz +0 -0
  275. diffneusim/data/reference/x016run/x016run_v3p25_s6_r2.npz +0 -0
  276. diffneusim/data/reference/x016run/x016run_v3p25_s6_r3.npz +0 -0
  277. diffneusim/data/reference/x016run/x016run_v3p25_s7_l0.npz +0 -0
  278. diffneusim/data/reference/x016run/x016run_v3p25_s7_l1.npz +0 -0
  279. diffneusim/data/reference/x016run/x016run_v3p25_s7_l2.npz +0 -0
  280. diffneusim/data/reference/x016run/x016run_v3p25_s7_l3.npz +0 -0
  281. diffneusim/data/reference/x016run/x016run_v3p25_s7_r0.npz +0 -0
  282. diffneusim/data/reference/x016run/x016run_v3p25_s7_r1.npz +0 -0
  283. diffneusim/data/reference/x016run/x016run_v3p25_s7_r2.npz +0 -0
  284. diffneusim/data/reference/x016run/x016run_v3p25_s7_r3.npz +0 -0
  285. diffneusim/data/reference/x016run/x016run_v3p50_s0_l0.npz +0 -0
  286. diffneusim/data/reference/x016run/x016run_v3p50_s0_l1.npz +0 -0
  287. diffneusim/data/reference/x016run/x016run_v3p50_s0_l2.npz +0 -0
  288. diffneusim/data/reference/x016run/x016run_v3p50_s0_l3.npz +0 -0
  289. diffneusim/data/reference/x016run/x016run_v3p50_s0_r0.npz +0 -0
  290. diffneusim/data/reference/x016run/x016run_v3p50_s0_r1.npz +0 -0
  291. diffneusim/data/reference/x016run/x016run_v3p50_s0_r2.npz +0 -0
  292. diffneusim/data/reference/x016run/x016run_v3p50_s0_r3.npz +0 -0
  293. diffneusim/data/reference/x016run/x016run_v3p50_s1_l0.npz +0 -0
  294. diffneusim/data/reference/x016run/x016run_v3p50_s1_l1.npz +0 -0
  295. diffneusim/data/reference/x016run/x016run_v3p50_s1_l2.npz +0 -0
  296. diffneusim/data/reference/x016run/x016run_v3p50_s1_l3.npz +0 -0
  297. diffneusim/data/reference/x016run/x016run_v3p50_s1_r0.npz +0 -0
  298. diffneusim/data/reference/x016run/x016run_v3p50_s1_r1.npz +0 -0
  299. diffneusim/data/reference/x016run/x016run_v3p50_s1_r2.npz +0 -0
  300. diffneusim/data/reference/x016run/x016run_v3p50_s1_r3.npz +0 -0
  301. diffneusim/data/reference/x016run/x016run_v3p50_s2_l0.npz +0 -0
  302. diffneusim/data/reference/x016run/x016run_v3p50_s2_l1.npz +0 -0
  303. diffneusim/data/reference/x016run/x016run_v3p50_s2_l2.npz +0 -0
  304. diffneusim/data/reference/x016run/x016run_v3p50_s2_l3.npz +0 -0
  305. diffneusim/data/reference/x016run/x016run_v3p50_s2_r0.npz +0 -0
  306. diffneusim/data/reference/x016run/x016run_v3p50_s2_r1.npz +0 -0
  307. diffneusim/data/reference/x016run/x016run_v3p50_s2_r2.npz +0 -0
  308. diffneusim/data/reference/x016run/x016run_v3p50_s2_r3.npz +0 -0
  309. diffneusim/data/reference/x016run/x016run_v3p50_s3_l0.npz +0 -0
  310. diffneusim/data/reference/x016run/x016run_v3p50_s3_l1.npz +0 -0
  311. diffneusim/data/reference/x016run/x016run_v3p50_s3_l2.npz +0 -0
  312. diffneusim/data/reference/x016run/x016run_v3p50_s3_l3.npz +0 -0
  313. diffneusim/data/reference/x016run/x016run_v3p50_s3_r0.npz +0 -0
  314. diffneusim/data/reference/x016run/x016run_v3p50_s3_r1.npz +0 -0
  315. diffneusim/data/reference/x016run/x016run_v3p50_s3_r2.npz +0 -0
  316. diffneusim/data/reference/x016run/x016run_v3p50_s3_r3.npz +0 -0
  317. diffneusim/data/reference/x016run/x016run_v3p50_s5_l0.npz +0 -0
  318. diffneusim/data/reference/x016run/x016run_v3p50_s5_l1.npz +0 -0
  319. diffneusim/data/reference/x016run/x016run_v3p50_s5_l2.npz +0 -0
  320. diffneusim/data/reference/x016run/x016run_v3p50_s5_l3.npz +0 -0
  321. diffneusim/data/reference/x016run/x016run_v3p50_s5_r0.npz +0 -0
  322. diffneusim/data/reference/x016run/x016run_v3p50_s5_r1.npz +0 -0
  323. diffneusim/data/reference/x016run/x016run_v3p50_s5_r2.npz +0 -0
  324. diffneusim/data/reference/x016run/x016run_v3p50_s5_r3.npz +0 -0
  325. diffneusim/data/reference/x016run/x016run_v3p50_s6_l0.npz +0 -0
  326. diffneusim/data/reference/x016run/x016run_v3p50_s6_l1.npz +0 -0
  327. diffneusim/data/reference/x016run/x016run_v3p50_s6_l2.npz +0 -0
  328. diffneusim/data/reference/x016run/x016run_v3p50_s6_l3.npz +0 -0
  329. diffneusim/data/reference/x016run/x016run_v3p50_s6_r0.npz +0 -0
  330. diffneusim/data/reference/x016run/x016run_v3p50_s6_r1.npz +0 -0
  331. diffneusim/data/reference/x016run/x016run_v3p50_s6_r2.npz +0 -0
  332. diffneusim/data/reference/x016run/x016run_v3p50_s6_r3.npz +0 -0
  333. diffneusim/data/reference/x016run/x016run_v3p50_s7_l0.npz +0 -0
  334. diffneusim/data/reference/x016run/x016run_v3p50_s7_l1.npz +0 -0
  335. diffneusim/data/reference/x016run/x016run_v3p50_s7_l2.npz +0 -0
  336. diffneusim/data/reference/x016run/x016run_v3p50_s7_l3.npz +0 -0
  337. diffneusim/data/reference/x016run/x016run_v3p50_s7_r0.npz +0 -0
  338. diffneusim/data/reference/x016run/x016run_v3p50_s7_r1.npz +0 -0
  339. diffneusim/data/reference/x016run/x016run_v3p50_s7_r2.npz +0 -0
  340. diffneusim/data/reference/x016run/x016run_v3p50_s7_r3.npz +0 -0
  341. diffneusim/data/reference/x016run/x016run_v3p75_s0_l0.npz +0 -0
  342. diffneusim/data/reference/x016run/x016run_v3p75_s0_l1.npz +0 -0
  343. diffneusim/data/reference/x016run/x016run_v3p75_s0_l2.npz +0 -0
  344. diffneusim/data/reference/x016run/x016run_v3p75_s0_l3.npz +0 -0
  345. diffneusim/data/reference/x016run/x016run_v3p75_s0_r0.npz +0 -0
  346. diffneusim/data/reference/x016run/x016run_v3p75_s0_r1.npz +0 -0
  347. diffneusim/data/reference/x016run/x016run_v3p75_s0_r2.npz +0 -0
  348. diffneusim/data/reference/x016run/x016run_v3p75_s0_r3.npz +0 -0
  349. diffneusim/data/reference/x016run/x016run_v3p75_s1_l0.npz +0 -0
  350. diffneusim/data/reference/x016run/x016run_v3p75_s1_l1.npz +0 -0
  351. diffneusim/data/reference/x016run/x016run_v3p75_s1_l2.npz +0 -0
  352. diffneusim/data/reference/x016run/x016run_v3p75_s1_l3.npz +0 -0
  353. diffneusim/data/reference/x016run/x016run_v3p75_s1_r0.npz +0 -0
  354. diffneusim/data/reference/x016run/x016run_v3p75_s1_r1.npz +0 -0
  355. diffneusim/data/reference/x016run/x016run_v3p75_s1_r2.npz +0 -0
  356. diffneusim/data/reference/x016run/x016run_v3p75_s1_r3.npz +0 -0
  357. diffneusim/data/reference/x016run/x016run_v3p75_s2_l0.npz +0 -0
  358. diffneusim/data/reference/x016run/x016run_v3p75_s2_l1.npz +0 -0
  359. diffneusim/data/reference/x016run/x016run_v3p75_s2_l2.npz +0 -0
  360. diffneusim/data/reference/x016run/x016run_v3p75_s2_l3.npz +0 -0
  361. diffneusim/data/reference/x016run/x016run_v3p75_s2_r0.npz +0 -0
  362. diffneusim/data/reference/x016run/x016run_v3p75_s2_r1.npz +0 -0
  363. diffneusim/data/reference/x016run/x016run_v3p75_s2_r2.npz +0 -0
  364. diffneusim/data/reference/x016run/x016run_v3p75_s2_r3.npz +0 -0
  365. diffneusim/data/reference/x016run/x016run_v3p75_s3_l0.npz +0 -0
  366. diffneusim/data/reference/x016run/x016run_v3p75_s3_l1.npz +0 -0
  367. diffneusim/data/reference/x016run/x016run_v3p75_s3_l2.npz +0 -0
  368. diffneusim/data/reference/x016run/x016run_v3p75_s3_l3.npz +0 -0
  369. diffneusim/data/reference/x016run/x016run_v3p75_s3_r0.npz +0 -0
  370. diffneusim/data/reference/x016run/x016run_v3p75_s3_r1.npz +0 -0
  371. diffneusim/data/reference/x016run/x016run_v3p75_s3_r2.npz +0 -0
  372. diffneusim/data/reference/x016run/x016run_v3p75_s3_r3.npz +0 -0
  373. diffneusim/data/reference/x016run/x016run_v3p75_s5_l0.npz +0 -0
  374. diffneusim/data/reference/x016run/x016run_v3p75_s5_l1.npz +0 -0
  375. diffneusim/data/reference/x016run/x016run_v3p75_s5_l2.npz +0 -0
  376. diffneusim/data/reference/x016run/x016run_v3p75_s5_l3.npz +0 -0
  377. diffneusim/data/reference/x016run/x016run_v3p75_s5_r0.npz +0 -0
  378. diffneusim/data/reference/x016run/x016run_v3p75_s5_r1.npz +0 -0
  379. diffneusim/data/reference/x016run/x016run_v3p75_s5_r2.npz +0 -0
  380. diffneusim/data/reference/x016run/x016run_v3p75_s5_r3.npz +0 -0
  381. diffneusim/data/reference/x016run/x016run_v3p75_s6_l0.npz +0 -0
  382. diffneusim/data/reference/x016run/x016run_v3p75_s6_l1.npz +0 -0
  383. diffneusim/data/reference/x016run/x016run_v3p75_s6_l2.npz +0 -0
  384. diffneusim/data/reference/x016run/x016run_v3p75_s6_l3.npz +0 -0
  385. diffneusim/data/reference/x016run/x016run_v3p75_s6_r0.npz +0 -0
  386. diffneusim/data/reference/x016run/x016run_v3p75_s6_r1.npz +0 -0
  387. diffneusim/data/reference/x016run/x016run_v3p75_s6_r2.npz +0 -0
  388. diffneusim/data/reference/x016run/x016run_v3p75_s6_r3.npz +0 -0
  389. diffneusim/data/reference/x016run/x016run_v3p75_s7_l0.npz +0 -0
  390. diffneusim/data/reference/x016run/x016run_v3p75_s7_l1.npz +0 -0
  391. diffneusim/data/reference/x016run/x016run_v3p75_s7_l2.npz +0 -0
  392. diffneusim/data/reference/x016run/x016run_v3p75_s7_l3.npz +0 -0
  393. diffneusim/data/reference/x016run/x016run_v3p75_s7_r0.npz +0 -0
  394. diffneusim/data/reference/x016run/x016run_v3p75_s7_r1.npz +0 -0
  395. diffneusim/data/reference/x016run/x016run_v3p75_s7_r2.npz +0 -0
  396. diffneusim/data/reference/x016run/x016run_v3p75_s7_r3.npz +0 -0
  397. diffneusim/data/state_prior/lumbar_poly_fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
  398. diffneusim/engine/__init__.py +0 -0
  399. diffneusim/engine/build_tag.py +52 -0
  400. diffneusim/engine/case_tables.py +46 -0
  401. diffneusim/engine/d16_body.py +80 -0
  402. diffneusim/engine/engine14.py +367 -0
  403. diffneusim/engine/gen_split.py +159 -0
  404. diffneusim/engine/hand_format.py +69 -0
  405. diffneusim/engine/live14.py +149 -0
  406. diffneusim/engine/phase_b_tree.py +137 -0
  407. diffneusim/engine/soft14.py +130 -0
  408. diffneusim/engine/soft_capi.py +373 -0
  409. diffneusim/engine/soft_engine.py +165 -0
  410. diffneusim/engine/step14.py +132 -0
  411. diffneusim/engine/tape_format.py +89 -0
  412. diffneusim/engine/x14cpu.py +163 -0
  413. diffneusim/env/__init__.py +0 -0
  414. diffneusim/env/absent.py +20 -0
  415. diffneusim/env/cpu14.py +105 -0
  416. diffneusim/env/e0loop14.py +224 -0
  417. diffneusim/env/env14.py +568 -0
  418. diffneusim/env/kin_contact14.py +193 -0
  419. diffneusim/env/mimic_sites_x14.json +366 -0
  420. diffneusim/env/old_count.py +78 -0
  421. diffneusim/env/rew14.py +114 -0
  422. diffneusim/env/rew14_hook.py +105 -0
  423. diffneusim/g1/__init__.py +1 -0
  424. diffneusim/g1/arm_a2.py +165 -0
  425. diffneusim/g1/arm_a3.py +576 -0
  426. diffneusim/g1/read_a3.py +79 -0
  427. diffneusim/g1/rg1_read.py +89 -0
  428. diffneusim/model/__init__.py +66 -0
  429. diffneusim/model/case.py +17 -0
  430. diffneusim/model/dnmodel.py +79 -0
  431. diffneusim/model/fuse_fixed.py +281 -0
  432. diffneusim/model/monitor.py +834 -0
  433. diffneusim/models/BODIES.toml +48 -0
  434. diffneusim/models/MANIFEST.toml +979 -0
  435. diffneusim/models/cases/G290/case.bin +0 -0
  436. diffneusim/models/cases/G290/case.json +1 -0
  437. diffneusim/models/cases/G356-SRC/case.bin +0 -0
  438. diffneusim/models/cases/G356-SRC/case.json +1 -0
  439. diffneusim/models/cases/G416/case.bin +0 -0
  440. diffneusim/models/cases/G416/case.json +1 -0
  441. diffneusim/models/cases/M290C-SRC/case.bin +0 -0
  442. diffneusim/models/cases/M290C-SRC/case.json +1 -0
  443. diffneusim/models/cases/M290R-SRC/case.bin +0 -0
  444. diffneusim/models/cases/M290R-SRC/case.json +1 -0
  445. diffneusim/models/cases/M356C-SRC/case.bin +0 -0
  446. diffneusim/models/cases/M356C-SRC/case.json +1 -0
  447. diffneusim/models/cases/M356R-SRC/case.bin +0 -0
  448. diffneusim/models/cases/M356R-SRC/case.json +1 -0
  449. diffneusim/models/cases/M416C-SRC/case.bin +0 -0
  450. diffneusim/models/cases/M416C-SRC/case.json +1 -0
  451. diffneusim/models/derived/d16_expanded_62f77a4bb16b1e67_mmfloor.xml +673 -0
  452. diffneusim/models/derived/d16_expanded_a1e8b196b2cd7b3c_mmfloor.xml +673 -0
  453. diffneusim/models/derived/d16_soft_law_019e20820f8633b9_mmfloor.json +7844 -0
  454. diffneusim/models/derived/d16_soft_law_62f77a4bb16b1e67_mmfloor.json +16855 -0
  455. diffneusim/models/derived/d16_soft_law_77dbb7213f26e821_mmfloor_rampsb3l_n6t12.json +7883 -0
  456. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rampsb3l_n6t12.json +7883 -0
  457. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsd05_n6t12.json +7868 -0
  458. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsdef_n6t12.json +7868 -0
  459. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsmjd_n6t12.json +7868 -0
  460. diffneusim/models/derived/d16_soft_law_a1e8b196b2cd7b3c_mmfloor_rampsb3l_n6t12.json +16894 -0
  461. diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor.json +12655 -0
  462. diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor_rampsb3l_n6t12.json +12700 -0
  463. diffneusim/models/derived/unitree_g1_soft_law.json +15580 -0
  464. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +28913 -0
  465. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
  466. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +29202 -0
  467. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
  468. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.dnmodel +1 -0
  469. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
  470. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
  471. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +46970 -0
  472. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
  473. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
  474. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
  475. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +38570 -0
  476. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
  477. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +38923 -0
  478. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
  479. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
  480. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
  481. diffneusim/models/fullbody_meshes/1mc.stl +0 -0
  482. diffneusim/models/fullbody_meshes/2distph.stl +0 -0
  483. diffneusim/models/fullbody_meshes/2mc.stl +0 -0
  484. diffneusim/models/fullbody_meshes/2midph.stl +0 -0
  485. diffneusim/models/fullbody_meshes/2proxph.stl +0 -0
  486. diffneusim/models/fullbody_meshes/3distph.stl +0 -0
  487. diffneusim/models/fullbody_meshes/3mc.stl +0 -0
  488. diffneusim/models/fullbody_meshes/3midph.stl +0 -0
  489. diffneusim/models/fullbody_meshes/3proxph.stl +0 -0
  490. diffneusim/models/fullbody_meshes/4distph.stl +0 -0
  491. diffneusim/models/fullbody_meshes/4mc.stl +0 -0
  492. diffneusim/models/fullbody_meshes/4midph.stl +0 -0
  493. diffneusim/models/fullbody_meshes/4proxph.stl +0 -0
  494. diffneusim/models/fullbody_meshes/5distph.stl +0 -0
  495. diffneusim/models/fullbody_meshes/5mc.stl +0 -0
  496. diffneusim/models/fullbody_meshes/5midph.stl +0 -0
  497. diffneusim/models/fullbody_meshes/5proxph.stl +0 -0
  498. diffneusim/models/fullbody_meshes/NOTICE +2 -0
  499. diffneusim/models/fullbody_meshes/capitate.stl +0 -0
  500. diffneusim/models/fullbody_meshes/clavicle.stl +0 -0
  501. diffneusim/models/fullbody_meshes/hamate.stl +0 -0
  502. diffneusim/models/fullbody_meshes/hat_cervical.stl +0 -0
  503. diffneusim/models/fullbody_meshes/hat_jaw.stl +0 -0
  504. diffneusim/models/fullbody_meshes/hat_skull.stl +0 -0
  505. diffneusim/models/fullbody_meshes/humerus.stl +0 -0
  506. diffneusim/models/fullbody_meshes/l_bofoot.stl +0 -0
  507. diffneusim/models/fullbody_meshes/l_femur.stl +0 -0
  508. diffneusim/models/fullbody_meshes/l_fibula.stl +0 -0
  509. diffneusim/models/fullbody_meshes/l_foot.stl +0 -0
  510. diffneusim/models/fullbody_meshes/l_patella.stl +0 -0
  511. diffneusim/models/fullbody_meshes/l_pelvis.stl +0 -0
  512. diffneusim/models/fullbody_meshes/l_talus.stl +0 -0
  513. diffneusim/models/fullbody_meshes/l_tibia.stl +0 -0
  514. diffneusim/models/fullbody_meshes/lumbar1.stl +0 -0
  515. diffneusim/models/fullbody_meshes/lumbar2.stl +0 -0
  516. diffneusim/models/fullbody_meshes/lumbar3.stl +0 -0
  517. diffneusim/models/fullbody_meshes/lumbar4.stl +0 -0
  518. diffneusim/models/fullbody_meshes/lumbar5.stl +0 -0
  519. diffneusim/models/fullbody_meshes/lunate.stl +0 -0
  520. diffneusim/models/fullbody_meshes/pisiform.stl +0 -0
  521. diffneusim/models/fullbody_meshes/r_bofoot.stl +0 -0
  522. diffneusim/models/fullbody_meshes/r_femur.stl +0 -0
  523. diffneusim/models/fullbody_meshes/r_fibula.stl +0 -0
  524. diffneusim/models/fullbody_meshes/r_foot.stl +0 -0
  525. diffneusim/models/fullbody_meshes/r_patella.stl +0 -0
  526. diffneusim/models/fullbody_meshes/r_pelvis.stl +0 -0
  527. diffneusim/models/fullbody_meshes/r_talus.stl +0 -0
  528. diffneusim/models/fullbody_meshes/r_tibia.stl +0 -0
  529. diffneusim/models/fullbody_meshes/radius.stl +0 -0
  530. diffneusim/models/fullbody_meshes/sacrum.stl +0 -0
  531. diffneusim/models/fullbody_meshes/scaphoid.stl +0 -0
  532. diffneusim/models/fullbody_meshes/scapula.stl +0 -0
  533. diffneusim/models/fullbody_meshes/thoracic10_s.stl +0 -0
  534. diffneusim/models/fullbody_meshes/thoracic11_s.stl +0 -0
  535. diffneusim/models/fullbody_meshes/thoracic12_s.stl +0 -0
  536. diffneusim/models/fullbody_meshes/thoracic1_s.stl +0 -0
  537. diffneusim/models/fullbody_meshes/thoracic2_s.stl +0 -0
  538. diffneusim/models/fullbody_meshes/thoracic3_s.stl +0 -0
  539. diffneusim/models/fullbody_meshes/thoracic4_s.stl +0 -0
  540. diffneusim/models/fullbody_meshes/thoracic5_s.stl +0 -0
  541. diffneusim/models/fullbody_meshes/thoracic6_s.stl +0 -0
  542. diffneusim/models/fullbody_meshes/thoracic7_s.stl +0 -0
  543. diffneusim/models/fullbody_meshes/thoracic8_s.stl +0 -0
  544. diffneusim/models/fullbody_meshes/thoracic9_s.stl +0 -0
  545. diffneusim/models/fullbody_meshes/thorax.stl +0 -0
  546. diffneusim/models/fullbody_meshes/thumbdist.stl +0 -0
  547. diffneusim/models/fullbody_meshes/thumbprox.stl +0 -0
  548. diffneusim/models/fullbody_meshes/trapezium.stl +0 -0
  549. diffneusim/models/fullbody_meshes/trapezoid.stl +0 -0
  550. diffneusim/models/fullbody_meshes/triquetrum.stl +0 -0
  551. diffneusim/models/fullbody_meshes/ulna.stl +0 -0
  552. diffneusim/models/source/myo_fullbody/UPSTREAM.md +91 -0
  553. diffneusim/models/source/myoleg/UPSTREAM.md +52 -0
  554. diffneusim/models/source/unitree_g1/LICENSE.mjlab +202 -0
  555. diffneusim/models/source/unitree_g1/UPSTREAM.md +38 -0
  556. diffneusim/models/source/unitree_g1/assets/head_link.STL +0 -0
  557. diffneusim/models/source/unitree_g1/assets/left_ankle_pitch_link.STL +0 -0
  558. diffneusim/models/source/unitree_g1/assets/left_ankle_roll_link.STL +0 -0
  559. diffneusim/models/source/unitree_g1/assets/left_elbow_link.STL +0 -0
  560. diffneusim/models/source/unitree_g1/assets/left_hip_pitch_link.STL +0 -0
  561. diffneusim/models/source/unitree_g1/assets/left_hip_roll_link.STL +0 -0
  562. diffneusim/models/source/unitree_g1/assets/left_hip_yaw_link.STL +0 -0
  563. diffneusim/models/source/unitree_g1/assets/left_knee_link.STL +0 -0
  564. diffneusim/models/source/unitree_g1/assets/left_rubber_hand.STL +0 -0
  565. diffneusim/models/source/unitree_g1/assets/left_shoulder_pitch_link.STL +0 -0
  566. diffneusim/models/source/unitree_g1/assets/left_shoulder_roll_link.STL +0 -0
  567. diffneusim/models/source/unitree_g1/assets/left_shoulder_yaw_link.STL +0 -0
  568. diffneusim/models/source/unitree_g1/assets/left_wrist_pitch_link.STL +0 -0
  569. diffneusim/models/source/unitree_g1/assets/left_wrist_roll_link.STL +0 -0
  570. diffneusim/models/source/unitree_g1/assets/left_wrist_yaw_link.STL +0 -0
  571. diffneusim/models/source/unitree_g1/assets/logo_link.STL +0 -0
  572. diffneusim/models/source/unitree_g1/assets/pelvis.STL +0 -0
  573. diffneusim/models/source/unitree_g1/assets/pelvis_contour_link.STL +0 -0
  574. diffneusim/models/source/unitree_g1/assets/right_ankle_pitch_link.STL +0 -0
  575. diffneusim/models/source/unitree_g1/assets/right_ankle_roll_link.STL +0 -0
  576. diffneusim/models/source/unitree_g1/assets/right_elbow_link.STL +0 -0
  577. diffneusim/models/source/unitree_g1/assets/right_hip_pitch_link.STL +0 -0
  578. diffneusim/models/source/unitree_g1/assets/right_hip_roll_link.STL +0 -0
  579. diffneusim/models/source/unitree_g1/assets/right_hip_yaw_link.STL +0 -0
  580. diffneusim/models/source/unitree_g1/assets/right_knee_link.STL +0 -0
  581. diffneusim/models/source/unitree_g1/assets/right_rubber_hand.STL +0 -0
  582. diffneusim/models/source/unitree_g1/assets/right_shoulder_pitch_link.STL +0 -0
  583. diffneusim/models/source/unitree_g1/assets/right_shoulder_roll_link.STL +0 -0
  584. diffneusim/models/source/unitree_g1/assets/right_shoulder_yaw_link.STL +0 -0
  585. diffneusim/models/source/unitree_g1/assets/right_wrist_pitch_link.STL +0 -0
  586. diffneusim/models/source/unitree_g1/assets/right_wrist_roll_link.STL +0 -0
  587. diffneusim/models/source/unitree_g1/assets/right_wrist_yaw_link.STL +0 -0
  588. diffneusim/models/source/unitree_g1/assets/torso_link_rev_1_0.STL +0 -0
  589. diffneusim/models/source/unitree_g1/assets/waist_roll_link_rev_1_0.STL +0 -0
  590. diffneusim/models/source/unitree_g1/assets/waist_yaw_link_rev_1_0.STL +0 -0
  591. diffneusim/models/source/unitree_g1/dump_mjlab_reference.py +30 -0
  592. diffneusim/models/source/unitree_g1/g1.xml +308 -0
  593. diffneusim/models/source/unitree_g1/g1_constants.py +298 -0
  594. diffneusim/models/source/unitree_g1/mjlab_compiled_reference.json +857 -0
  595. diffneusim/models/unitree_g1.dnmodel +4393 -0
  596. diffneusim/models/unitree_g1_selfcol.dnmodel +20824 -0
  597. diffneusim/rl/__init__.py +2 -0
  598. diffneusim/rl/dynsyn_layer.py +146 -0
  599. diffneusim/rl/footstep_plan.py +337 -0
  600. diffneusim/rl/g1_bm_env.py +572 -0
  601. diffneusim/rl/g1_bm_eval.py +168 -0
  602. diffneusim/rl/g1_bm_fused.py +275 -0
  603. diffneusim/rl/g1_bm_ppo.py +622 -0
  604. diffneusim/rl/g1_bm_sapo.py +551 -0
  605. diffneusim/rl/g1_ppo.py +395 -0
  606. diffneusim/rl/g1_sapo_soft.py +240 -0
  607. diffneusim/rl/g1_soft_env.py +452 -0
  608. diffneusim/rl/g1_soft_grad.py +145 -0
  609. diffneusim/rl/geyer_curves_torch.py +108 -0
  610. diffneusim/rl/gpu_fullbody_vec_env.py +1241 -0
  611. diffneusim/rl/imitation.py +2027 -0
  612. diffneusim/rl/imitation_reward_v2.py +248 -0
  613. diffneusim/rl/imitation_reward_v3.py +349 -0
  614. diffneusim/rl/latent_task.py +175 -0
  615. diffneusim/rl/llc_reward.py +316 -0
  616. diffneusim/rl/millard_curves_torch.py +154 -0
  617. diffneusim/rl/mirror_symmetry.py +212 -0
  618. diffneusim/rl/model_path.py +35 -0
  619. diffneusim/rl/mvae_recon.py +123 -0
  620. diffneusim/rl/nets_shac.py +599 -0
  621. diffneusim/rl/reset_pool.py +154 -0
  622. diffneusim/rl/sapo_capture.py +873 -0
  623. diffneusim/rl/sapo_vec.py +1051 -0
  624. diffneusim/rl/shac_vec.py +346 -0
  625. diffneusim/rl/state_prior.py +151 -0
  626. diffneusim/rl/step_library.py +105 -0
  627. diffneusim/rl/task_walk_env.py +1793 -0
  628. diffneusim/rl/task_walk_reward.py +3300 -0
  629. diffneusim/run.py +23 -0
  630. diffneusim/run_env.py +46 -0
  631. diffneusim/tasks/__init__.py +147 -0
  632. diffneusim/tasks/legacy_names.py +63 -0
  633. diffneusim/tasks/paths.py +79 -0
  634. diffneusim/tasks/settings.py +202 -0
  635. diffneusim/third_party/instantmimic_947430ee/LICENSE +202 -0
  636. diffneusim/third_party/instantmimic_947430ee/NOTICE +19 -0
  637. diffneusim/third_party/instantmimic_947430ee/README.md +31 -0
  638. diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/benchmark_protocol.py +106 -0
  639. diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/metrics.py +214 -0
  640. diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/reference.py +513 -0
  641. diffneusim/third_party/instantmimic_947430ee/instantmimic/motion/quaternion.py +193 -0
  642. diffneusim/train/__init__.py +0 -0
  643. diffneusim/train/eval_ckpt.py +239 -0
  644. diffneusim/train/eval_mimic.py +133 -0
  645. diffneusim/train/gait_report.py +203 -0
  646. diffneusim/train/gcot_chain.py +51 -0
  647. diffneusim/train/levers.py +135 -0
  648. diffneusim/train/masked_reset.py +314 -0
  649. diffneusim/train/rl_algorithm_suite.py +917 -0
  650. diffneusim/train/train14.py +240 -0
  651. diffneusim/train/train_tw14.py +674 -0
  652. diffneusim/viz/__init__.py +5 -0
  653. diffneusim/viz/__main__.py +41 -0
  654. diffneusim/viz/camera.py +115 -0
  655. diffneusim/viz/dnrec.py +118 -0
  656. diffneusim/viz/dnrec_io.py +686 -0
  657. diffneusim/viz/hud.py +565 -0
  658. diffneusim/viz/meshes.py +458 -0
  659. diffneusim/viz/play.py +237 -0
  660. diffneusim/viz/record.py +74 -0
  661. diffneusim/viz/render.py +1402 -0
  662. diffneusim/viz/renderer.py +268 -0
  663. diffneusim/viz/rl_env_render.py +635 -0
  664. diffneusim/viz/snapshot.py +54 -0
  665. diffneusim/viz/strobe.py +124 -0
  666. diffneusim/viz/to_mp4.py +58 -0
  667. diffneusim/viz/ui.py +481 -0
  668. diffneusim/viz/viewer.py +2086 -0
  669. diffneusim-1.0.0.dist-info/METADATA +226 -0
  670. diffneusim-1.0.0.dist-info/RECORD +682 -0
  671. diffneusim-1.0.0.dist-info/WHEEL +5 -0
  672. diffneusim-1.0.0.dist-info/licenses/LICENSE +201 -0
  673. diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-ARMS-hand-wrist-4.3.txt +20 -0
  674. diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-MoBL-ARMS.txt +25 -0
  675. diffneusim-1.0.0.dist-info/licenses/LICENSES/CC-BY-3.0-OpenSim-geometry.txt +25 -0
  676. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Christophy2012-lumbarspine.txt +10 -0
  677. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lai2017-model-high-flex.txt +10 -0
  678. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lee2015-hand_muscle.txt +11 -0
  679. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Rajagopal2016-full_body.txt +11 -0
  680. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Uhlrich2022-fbmodpassivecal.txt +10 -0
  681. diffneusim-1.0.0.dist-info/licenses/NOTICE +274 -0
  682. diffneusim-1.0.0.dist-info/top_level.txt +1 -0
diffneusim/viz/hud.py ADDED
@@ -0,0 +1,565 @@
1
+ """Screen-space text HUD for the renderer (caption + live readouts).
2
+
3
+ Rasterizes text to an RGBA texture with Pillow and blits it as a screen-aligned
4
+ quad over the 3D scene. Used to label each scene ("what am I looking at") and to
5
+ show live engine values (activation, contact force, ...). This is overlay chrome
6
+ only — it never touches the physics or the 3D geometry.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ import numpy as np
11
+ from PIL import Image, ImageDraw, ImageFont
12
+
13
+ HUD_VS = """
14
+ #version 330
15
+ in vec2 in_pos; // [0,1] quad
16
+ in vec2 in_uv;
17
+ uniform vec4 u_rect; // x,y,w,h in NDC-ish [0,1] screen frac
18
+ out vec2 v_uv;
19
+ void main() {
20
+ vec2 p = u_rect.xy + in_pos * u_rect.zw;
21
+ gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);
22
+ v_uv = in_uv;
23
+ }
24
+ """
25
+
26
+ HUD_FS = """
27
+ #version 330
28
+ uniform sampler2D u_tex;
29
+ in vec2 v_uv;
30
+ out vec4 f_color;
31
+ void main() {
32
+ f_color = texture(u_tex, v_uv);
33
+ }
34
+ """
35
+
36
+
37
+ def _load_font(size: int):
38
+ # Try a few common TTFs; fall back to PIL's bitmap default (small but works).
39
+ for name in ("DejaVuSans.ttf", "Arial.ttf", "Helvetica.ttf",
40
+ "/System/Library/Fonts/Supplemental/Arial.ttf",
41
+ "/System/Library/Fonts/Helvetica.ttc"):
42
+ try:
43
+ return ImageFont.truetype(name, size)
44
+ except Exception:
45
+ continue
46
+ return ImageFont.load_default()
47
+
48
+
49
+ class TextHUD:
50
+ """Renders a small panel of text lines into a texture and blits it."""
51
+
52
+ def __init__(self, ctx, font_size: int = 22):
53
+ self.ctx = ctx
54
+ self.font = _load_font(font_size)
55
+ self.font_size = font_size
56
+ self.prog = ctx.program(vertex_shader=HUD_VS, fragment_shader=HUD_FS)
57
+ # quad with uv (flip v so the PIL top-left image maps correctly)
58
+ quad = np.array([
59
+ # x, y, u, v
60
+ 0, 0, 0, 1,
61
+ 1, 0, 1, 1,
62
+ 1, 1, 1, 0,
63
+ 0, 0, 0, 1,
64
+ 1, 1, 1, 0,
65
+ 0, 1, 0, 0,
66
+ ], dtype="f4")
67
+ self.vbo = ctx.buffer(quad.tobytes())
68
+ self.vao = ctx.vertex_array(self.prog, [(self.vbo, "2f 2f", "in_pos", "in_uv")])
69
+ self._tex = None
70
+ self._tex_wh = (0, 0)
71
+ self._cache_key = None
72
+
73
+ def _rasterize(self, lines, pad=10):
74
+ # measure
75
+ ascent, descent = self.font.getmetrics()
76
+ line_h = ascent + descent + 4
77
+ widths = []
78
+ for ln in lines:
79
+ box = self.font.getbbox(ln)
80
+ widths.append(box[2] - box[0])
81
+ w = max(widths) + 2 * pad if widths else 2 * pad
82
+ h = line_h * len(lines) + 2 * pad
83
+ img = Image.new("RGBA", (w, h), (10, 12, 16, 165)) # translucent dark panel
84
+ draw = ImageDraw.Draw(img)
85
+ # subtle left accent bar
86
+ draw.rectangle([0, 0, 3, h], fill=(255, 180, 30, 220))
87
+ y = pad
88
+ for ln in lines:
89
+ draw.text((pad, y), ln, font=self.font, fill=(238, 240, 244, 255))
90
+ y += line_h
91
+ return img
92
+
93
+ def set_lines(self, lines):
94
+ key = tuple(lines)
95
+ if key == self._cache_key and self._tex is not None:
96
+ return
97
+ self.set_image(self._rasterize(list(lines)), key)
98
+
99
+ def set_image(self, img, key):
100
+ """Upload any RGBA PIL image as the panel (set_lines' text panel, or MapHUD's map)."""
101
+ if key == self._cache_key and self._tex is not None:
102
+ return
103
+ data = np.asarray(img, dtype=np.uint8)
104
+ h, w = data.shape[:2]
105
+ if self._tex is None or self._tex_wh != (w, h):
106
+ if self._tex is not None:
107
+ self._tex.release()
108
+ self._tex = self.ctx.texture((w, h), 4, data.tobytes())
109
+ self._tex.filter = (self.ctx.LINEAR, self.ctx.LINEAR)
110
+ self._tex_wh = (w, h)
111
+ else:
112
+ self._tex.write(data.tobytes())
113
+ self._cache_key = key
114
+
115
+ def draw(self, screen_w, screen_h, corner="tl", margin_px=16, margin_y_px=None):
116
+ """Blit the current text panel at a screen corner (margin_y_px: a separate vertical margin)."""
117
+ if self._tex is None:
118
+ return
119
+ tw, th = self._tex_wh
120
+ fw = tw / screen_w
121
+ fh = th / screen_h
122
+ mx = margin_px / screen_w
123
+ my = (margin_px if margin_y_px is None else margin_y_px) / screen_h
124
+ if corner == "tl":
125
+ x, y = mx, 1.0 - fh - my
126
+ elif corner == "bl":
127
+ x, y = mx, my
128
+ elif corner == "tr":
129
+ x, y = 1.0 - fw - mx, 1.0 - fh - my
130
+ elif corner == "br":
131
+ x, y = 1.0 - fw - mx, my
132
+ else:
133
+ x, y = mx, 1.0 - fh - my
134
+ self.ctx.enable(self.ctx.BLEND)
135
+ self.ctx.blend_func = self.ctx.SRC_ALPHA, self.ctx.ONE_MINUS_SRC_ALPHA
136
+ self.ctx.disable(self.ctx.DEPTH_TEST)
137
+ self._tex.use(0)
138
+ self.prog["u_tex"].value = 0
139
+ self.prog["u_rect"].value = (x, y, fw, fh)
140
+ self.vao.render()
141
+ self.ctx.enable(self.ctx.DEPTH_TEST)
142
+ self.ctx.disable(self.ctx.BLEND)
143
+
144
+
145
+ class AxisGizmo:
146
+ """Blender-style orientation widget: three axis handles (X red, Y green, Z blue)
147
+ rotated by the camera VIEW matrix and blitted in a screen corner, so you can always
148
+ read which way the world axes point (and thus which side of the model you are seeing).
149
+ Overlay chrome only — it never touches the physics or the 3D geometry.
150
+
151
+ Rasterized with Pillow into a small RGBA texture each frame (like TextHUD), then blitted
152
+ through the same screen-frac quad shader. CONVENTION (matches meshes.look_at): with
153
+ R = view[:3,:3], e = R @ axis gives eye space where e[0]=screen-right, e[1]=screen-up,
154
+ e[2]=toward-the-viewer (e[2] > 0 => the handle points at you, drawn on top)."""
155
+
156
+ _AXES = ( # (world unit axis, ball rgb, label)
157
+ (np.array([1.0, 0.0, 0.0]), (222, 62, 68), "X"),
158
+ (np.array([0.0, 1.0, 0.0]), (74, 194, 94), "Y"),
159
+ (np.array([0.0, 0.0, 1.0]), (60, 126, 232), "Z"),
160
+ )
161
+
162
+ def __init__(self, ctx, size_px: int = 108):
163
+ self.ctx = ctx
164
+ self.size = int(size_px)
165
+ self.font = _load_font(max(11, self.size // 7))
166
+ self.prog = ctx.program(vertex_shader=HUD_VS, fragment_shader=HUD_FS)
167
+ quad = np.array([ # v-flipped so a PIL top-left image maps upright on screen
168
+ 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0,
169
+ 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0,
170
+ ], dtype="f4")
171
+ self.vbo = ctx.buffer(quad.tobytes())
172
+ self.vao = ctx.vertex_array(self.prog, [(self.vbo, "2f 2f", "in_pos", "in_uv")])
173
+ self._tex = ctx.texture((self.size, self.size), 4)
174
+ self._tex.filter = (ctx.LINEAR, ctx.LINEAR)
175
+
176
+ def _rasterize(self, R):
177
+ s = self.size
178
+ c = np.array([s * 0.5, s * 0.5])
179
+ L = s * 0.5 - 15.0 # radius the +tip reaches (room for balls)
180
+ img = Image.new("RGBA", (s, s), (0, 0, 0, 0))
181
+ d = ImageDraw.Draw(img)
182
+ d.ellipse([1, 1, s - 2, s - 2], fill=(16, 18, 24, 96)) # faint disc so it reads over any scene
183
+ handles = [] # (depth_toward_viewer, is_pos, screen_xy, rgb, label)
184
+ for axis, rgb, lab in self._AXES:
185
+ e = R @ axis # (right, up, toward-viewer)
186
+ handles.append((float(e[2]), True, c + np.array([e[0], -e[1]]) * L, rgb, lab))
187
+ handles.append((-float(e[2]), False, c + np.array([-e[0], e[1]]) * L, rgb, lab))
188
+ for depth, is_pos, scr, rgb, lab in handles: # radii (center -> +tip) under the balls
189
+ if is_pos:
190
+ d.line([tuple(c), tuple(scr)], fill=rgb + (255,), width=3)
191
+ for depth, is_pos, scr, rgb, lab in sorted(handles, key=lambda h: h[0]): # far -> near
192
+ r = 9.0
193
+ box = [scr[0] - r, scr[1] - r, scr[0] + r, scr[1] + r]
194
+ if is_pos: # +axis: filled, labeled ball
195
+ d.ellipse(box, fill=rgb + (255,))
196
+ tb = self.font.getbbox(lab); tw = tb[2] - tb[0]; th = tb[3] - tb[1]
197
+ d.text((scr[0] - tw / 2 - tb[0], scr[1] - th / 2 - tb[1]), lab,
198
+ font=self.font, fill=(245, 247, 250, 255))
199
+ else: # -axis: hollow ball
200
+ d.ellipse(box, fill=(22, 24, 30, 210), outline=rgb + (255,), width=2)
201
+ return np.asarray(img, dtype=np.uint8)
202
+
203
+ def draw(self, screen_w, screen_h, view, margin_px=14):
204
+ R = np.asarray(view, dtype=np.float64)[:3, :3]
205
+ self._tex.write(self._rasterize(R).tobytes())
206
+ fw, fh = self.size / screen_w, self.size / screen_h
207
+ x = 1.0 - fw - margin_px / screen_w
208
+ y = 1.0 - fh - margin_px / screen_h
209
+ ctx = self.ctx
210
+ ctx.enable(ctx.BLEND)
211
+ ctx.blend_func = ctx.SRC_ALPHA, ctx.ONE_MINUS_SRC_ALPHA
212
+ ctx.disable(ctx.DEPTH_TEST)
213
+ self._tex.use(0)
214
+ self.prog["u_tex"].value = 0
215
+ self.prog["u_rect"].value = (x, y, fw, fh)
216
+ self.vao.render()
217
+ ctx.enable(ctx.DEPTH_TEST)
218
+ ctx.disable(ctx.BLEND)
219
+
220
+
221
+ class LabelAtlas:
222
+ """Caches small one-or-two-line text labels as textures and blits them at
223
+ arbitrary screen positions (used for joint-gallery labels anchored over each
224
+ pair, and for the contact side-legend rows). Overlay chrome only."""
225
+
226
+ def __init__(self, ctx, font_size: int = 17):
227
+ self.ctx = ctx
228
+ self.font = _load_font(font_size)
229
+ self.prog = ctx.program(vertex_shader=HUD_VS, fragment_shader=HUD_FS)
230
+ quad = np.array([
231
+ 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0,
232
+ 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0,
233
+ ], dtype="f4")
234
+ self.vbo = ctx.buffer(quad.tobytes())
235
+ self.vao = ctx.vertex_array(self.prog, [(self.vbo, "2f 2f", "in_pos", "in_uv")])
236
+ self._cache = {} # (lines, accent) -> (texture, w, h)
237
+
238
+ def _make(self, lines, accent):
239
+ ascent, descent = self.font.getmetrics()
240
+ line_h = ascent + descent + 3
241
+ pad = 7
242
+ widths = [self.font.getbbox(ln)[2] - self.font.getbbox(ln)[0] for ln in lines]
243
+ w = (max(widths) if widths else 0) + 2 * pad + 6
244
+ h = line_h * len(lines) + 2 * pad
245
+ img = Image.new("RGBA", (w, h), (10, 12, 16, 180))
246
+ draw = ImageDraw.Draw(img)
247
+ draw.rectangle([0, 0, 4, h], fill=tuple(int(255 * c) for c in accent) + (235,))
248
+ y = pad
249
+ for ln in lines:
250
+ draw.text((pad + 6, y), ln, font=self.font, fill=(238, 240, 244, 255))
251
+ y += line_h
252
+ data = np.asarray(img, dtype=np.uint8)
253
+ tex = self.ctx.texture((w, h), 4, data.tobytes())
254
+ tex.filter = (self.ctx.LINEAR, self.ctx.LINEAR)
255
+ return tex, w, h
256
+
257
+ def draw_at(self, lines, accent, screen_w, screen_h, cx_frac, top_frac,
258
+ anchor="center"):
259
+ """Blit a label whose horizontal anchor is at cx_frac and whose TOP is at
260
+ top_frac (both screen fractions, y measured from the bottom)."""
261
+ key = (tuple(lines), tuple(np.round(accent, 3)))
262
+ if key not in self._cache:
263
+ self._cache[key] = self._make(list(lines), accent)
264
+ tex, tw, th = self._cache[key]
265
+ fw, fh = tw / screen_w, th / screen_h
266
+ if anchor == "center":
267
+ x = cx_frac - fw * 0.5
268
+ elif anchor == "left":
269
+ x = cx_frac
270
+ else:
271
+ x = cx_frac - fw
272
+ x = float(np.clip(x, 0.0, 1.0 - fw))
273
+ y = float(np.clip(top_frac - fh, 0.0, 1.0 - fh))
274
+ self.ctx.enable(self.ctx.BLEND)
275
+ self.ctx.blend_func = self.ctx.SRC_ALPHA, self.ctx.ONE_MINUS_SRC_ALPHA
276
+ self.ctx.disable(self.ctx.DEPTH_TEST)
277
+ tex.use(0)
278
+ self.prog["u_tex"].value = 0
279
+ self.prog["u_rect"].value = (x, y, fw, fh)
280
+ self.vao.render()
281
+ self.ctx.enable(self.ctx.DEPTH_TEST)
282
+ self.ctx.disable(self.ctx.BLEND)
283
+
284
+
285
+ # Generic FALLBACK captions, keyed by scene name -- used only when a clip's header omits its own
286
+ # `header["caption"]` (a producer-stamped list[str], see dnrec_io.write_dnrec). New producers should
287
+ # stamp their own caption; this table exists so a clip that doesn't (or predates the field) still gets
288
+ # a sensible one instead of just its bare scene name.
289
+ SCENE_CAPTIONS = {
290
+ "free_body": [
291
+ "FREE BODY - torque-free rigid body",
292
+ "asymmetric inertia -> tumbling; gravity -> ballistic arc",
293
+ "purple trail = center-of-mass path",
294
+ ],
295
+ "pendulum": [
296
+ "DOUBLE PENDULUM - 2 revolute hinges (fixed base)",
297
+ "passive swing under gravity (no actuation)",
298
+ ],
299
+ "contact": [
300
+ "CONTACT - foot sphere drops onto ground plane",
301
+ "yellow arrow = contact normal force at the witness point",
302
+ "settles when normal force balances body weight",
303
+ ],
304
+ "multibody": [
305
+ "MULTI-BODY DROP - primitives fall + spin onto the ground",
306
+ "engine collider = sphere-plane only: sphere + capsule(2-sphere) LAND",
307
+ "box / ellipsoid have NO collider -> fall THROUGH the floor (honest)",
308
+ "yellow arrows = ground reaction; no body-body collision (engine scope)",
309
+ ],
310
+ "mtu": [
311
+ "MUSCLE-TENDON UNIT - biceps lifts the forearm vs GRAVITY",
312
+ "red belly = muscle (color = activation), white = tendon (capsules)",
313
+ "low a -> arm hangs limp; raise a -> fiber pulls, elbow flexes up",
314
+ ],
315
+ "joints": [
316
+ "JOINT GALLERY - every joint type the engine supports",
317
+ "each = fixed grey mount + a child driven through that joint (real engine)",
318
+ "labels below show joint type + DOF; see how each one moves",
319
+ ],
320
+ "myoleg_sweep": [
321
+ "myoLeg22_2D STRUCTURE (muscle-off) - kinematic ROM sweep (FK, no physics)",
322
+ "ported sagittal 11-DOF leg: pelvis(3) + hip/knee/ankle/mtp x L/R",
323
+ "pin-knee; moving via-points dropped; arms lumped into torso (HAT box)",
324
+ ],
325
+ "myoleg_settle": [
326
+ "myoLeg22_2D STRUCTURE (muscle-off) - drop + settle (dynamics)",
327
+ "placeholder joint+posture torque (NOT muscle, NOT trained)",
328
+ "yellow arrows = foot contact-penalty GRF (~k*penetration)",
329
+ ],
330
+ "myoleg_muscle": [
331
+ "myoLeg22_2D - 22 FITTED compliant muscles active (pelvis pinned)",
332
+ "full multi-site routing (l_mtu == MuJoCo) + engine joint limits/damping; red = activation",
333
+ "muscle-DRIVEN leg motion in our engine; NOT validated gait",
334
+ ],
335
+ "myoleg_walk": [
336
+ "myoLeg22_2D - GPU batched SHAC, normal-IMEX contact (analytic sim-gradient)",
337
+ "22 compliant muscles: white = series tendon, red belly = l_ce (color = policy activation)",
338
+ "yellow arrows = engine foot GRF (normal + friction: kinetic Coulomb or anchored stiction, mu=0.8); stored from eval",
339
+ ],
340
+ "fullbody_contact": [
341
+ "FULL-BODY MUSCULOSKELETAL MODEL - nq129 / 156 bodies, real STL bone meshes",
342
+ "anatomical skeleton (source STL meshes, per-body FK from the engine model)",
343
+ "foot contact colliders: right orange, left cyan; contact forces are yellow arrows",
344
+ "muscle paths (when enabled): pale tendon + red activation-colored fiber belly",
345
+ ],
346
+ "humanoid": [
347
+ "HUMANOID - GPU batched SHAC (analytic sim-gradient), per-env action-grad clip",
348
+ "21-DoF biped, anatomical multi-hinge bodies as compound scalar-hinge stacks; penalty foot contact (dnmodel k=20000)",
349
+ "rigid capsules from the source MJCF, drawn by OUR renderer (no MuJoCo)",
350
+ ],
351
+ }
352
+
353
+ # Human-readable DOF descriptions per engine joint type, used by the gallery
354
+ # labels (terse so adjacent labels do not overlap). Counts match
355
+ # core/kin/kinematic_tree.h (joint_nv): 6/3/1/1/0.
356
+ JOINT_DOF = {
357
+ "free": ("FREE", "6 DOF", "translate + rotate"),
358
+ "ball": ("BALL", "3 DOF", "rotate, any axis"),
359
+ "revolute": ("REVOLUTE", "1 DOF", "hinge (1 axis)"),
360
+ "slide": ("SLIDE", "1 DOF", "prismatic (1 axis)"),
361
+ "fixed": ("FIXED", "0 DOF", "rigid (no motion)"),
362
+ }
363
+
364
+
365
+ def live_lines(clip, frame: int) -> list[str]:
366
+ """Per-frame numeric readout lines appended under the caption. Gated on the CHANNEL SHAPE a clip
367
+ actually carries (muscle count, contact count, root horizontal travel) instead of the scene name,
368
+ so a new model gets the right readout for free instead of needing a new `scene == "..."` branch
369
+ added here every time it shows up."""
370
+ out = []
371
+ t = frame * clip.dt
372
+ out.append(f"t = {t:5.2f} s frame {frame}/{clip.n_frames - 1}")
373
+ # live forward speed: window-averaged world-x velocity of the root body. `root_index` (.dnrec
374
+ # header, see dnrec_io.write_dnrec) declares which body that is; omitted -> body 0. Instantaneous
375
+ # per-frame Δx is noisy, so average over ~0.25 s. Only shown if the root actually travels
376
+ # horizontally somewhere in the clip -- a purely vertical drop or a fixed-base swing never will,
377
+ # which replaces the old scene-name exclusion (`scene != "ball_drop"`) with a data-driven one.
378
+ root = int(clip.header.get("root_index", 0))
379
+ if clip.has_channel("pose") and frame > 0:
380
+ pose = clip.channel("pose") # (nbody, 7): world pos3 + quat4
381
+ xy_range = float(np.ptp(pose[:, root, 0])) + float(np.ptp(pose[:, root, 1]))
382
+ if xy_range > 1e-3:
383
+ w = max(1, int(round(0.25 / max(clip.dt, 1e-6))))
384
+ f0 = max(0, frame - w)
385
+ if frame > f0:
386
+ vx = (pose[frame, root, 0] - pose[f0, root, 0]) / ((frame - f0) * clip.dt)
387
+ out.append(f"forward speed = {vx:5.2f} m/s")
388
+ act = clip.channel("activation")
389
+ if act is not None and act.shape[1] == 1: # exactly one muscle -> report it directly
390
+ a = act[frame, 0]
391
+ out.append(f"activation a = {a[0]:.2f} F_mtu = {a[1]:7.1f} N")
392
+ out.append(f"l_ce (fiber) = {a[3]:.3f} m l_se (tendon) = {a[2] - a[3]:.3f} m")
393
+ con = clip.channel("contact")
394
+ if con is not None and con.shape[1] == 1: # exactly one contact point
395
+ c = con[frame, 0]
396
+ fmag = float(np.linalg.norm(c[3:6]))
397
+ out.append(f"contact |f| = {fmag:6.1f} N f_n = {c[6]:6.1f} N")
398
+ elif con is not None and con.shape[1] > 1: # multiple contact points -> a summary
399
+ fmag_all = np.linalg.norm(con[:, :, 3:6], axis=2) # (N)
400
+ n_active = int(np.sum(fmag_all[frame] > 1.0))
401
+ # collidable = contacts that ever register a nonzero reaction somewhere in the clip (a
402
+ # no-collider geom mixed into the same scene never will); "total" is just N.
403
+ n_collidable = int(np.sum(np.any(fmag_all > 1.0, axis=0)))
404
+ fmax = float(fmag_all[frame].max())
405
+ out.append(f"active contacts = {n_active}/{n_collidable} collidable "
406
+ f"({con.shape[1]} total) max |f| = {fmax:7.1f} N")
407
+ return out
408
+
409
+
410
+ # ---------------------------------------------------------------- steering task: live map + readout
411
+ # A clip whose header carries "task" (dnrec_io.set_task; tools/eval_ckpt.py stamps it from the env's heading command) gets a
412
+ # top-down map of the commanded task and the path so far (bottom-right) and task lines under the caption. The command is
413
+ # REBUILT from the record with the env's own rules (task_walk_env._tw_advance_heading): target mode points at the current
414
+ # waypoint and advances within the radius, schedule mode is the start heading plus the scheduled angle. All in the start
415
+ # pose's frame (x ahead, y to the left), as the env poses its waypoints.
416
+
417
+ def _wrap(a):
418
+ return (a + np.pi) % (2.0 * np.pi) - np.pi
419
+
420
+
421
+ def task_track(clip):
422
+ """Per-frame task state of a clip with header["task"] (cached on the clip), or None."""
423
+ task = clip.header.get("task")
424
+ if not task or not clip.has_channel("qpos"):
425
+ return None
426
+ cached = getattr(clip, "_task_track", None)
427
+ if cached is not None:
428
+ return cached
429
+ q = np.asarray(clip.channel("qpos"), dtype=np.float64)
430
+ q = q.reshape(q.shape[0], -1) # (nq): the channel view may carry a unit middle axis
431
+ w, x, y, z = q[:, 3], q[:, 4], q[:, 5], q[:, 6]
432
+ yaw_w = np.arctan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (y * y + z * z))
433
+ yaw0 = yaw_w[0]
434
+ c0, s0 = np.cos(yaw0), np.sin(yaw0)
435
+ d = q[:, 0:2] - q[0, 0:2]
436
+ p = np.stack([c0 * d[:, 0] + s0 * d[:, 1], -s0 * d[:, 0] + c0 * d[:, 1]], 1) # start frame
437
+ yaw = np.unwrap(yaw_w) - yaw0
438
+ F = len(q)
439
+ t = np.arange(F) * clip.dt
440
+ mode = task["mode"]
441
+ tgt = np.asarray(task.get("targets") or [], dtype=np.float64).reshape(-1, 2)
442
+ r = float(task.get("radius", 1.0))
443
+ idx = np.zeros(F, dtype=int)
444
+ cmd = np.zeros(F)
445
+ if mode == "target":
446
+ assert len(tgt) >= 1, task
447
+ i = 0
448
+ for f in range(F):
449
+ if np.linalg.norm(tgt[i] - p[f]) < r:
450
+ i = min(i + 1, len(tgt) - 1)
451
+ idx[f] = i
452
+ v = tgt[i] - p[f]
453
+ cmd[f] = np.arctan2(v[1], v[0])
454
+ elif mode == "schedule":
455
+ sc = np.asarray(task["schedule"], dtype=np.float64)
456
+ sc = sc.reshape(len(sc), -1) # [t, deg] or [t, deg, v]: a per-segment speed (the latent task)
457
+ k = np.clip(np.searchsorted(sc[:, 0], t, side="right") - 1, 0, None)
458
+ cmd = np.radians(sc[k, 1])
459
+ else: # held straight (or a random plan with no record): command 0
460
+ cmd = np.zeros(F)
461
+ fs = None
462
+ if task.get("footsteps"):
463
+ # TASKWALK_FOOTSTEPS: the plan's two targets in the start frame, and the plan's heading as the command (the plan, not the
464
+ # waypoint, is what the policy is asked to follow)
465
+ a = np.asarray(task["footsteps"], dtype=np.float64)[:F]
466
+ assert a.shape[1] == 7, a.shape
467
+ def _sf(xy):
468
+ dd = xy - q[0, 0:2]
469
+ return np.stack([c0 * dd[:, 0] + s0 * dd[:, 1], -s0 * dd[:, 0] + c0 * dd[:, 1]], 1)
470
+ fs = dict(p0=_sf(a[:, 0:2]), p1=_sf(a[:, 2:4]), prov=a[:, 5] > 0.5, left=a[:, 6] > 0.5)
471
+ cmd = np.full(F, np.nan)
472
+ cmd[: len(a)] = a[:, 4] - yaw0
473
+ speeds = task.get("speeds")
474
+ v_cmd = np.asarray(speeds, dtype=np.float64)[idx] if speeds else np.full(F, float(task.get("v_fixed") or np.nan))
475
+ if mode == "schedule" and sc.shape[1] == 3:
476
+ v_cmd = sc[k, 2]
477
+ win = max(1, int(round(0.25 / clip.dt)))
478
+ v = np.full(F, np.nan)
479
+ v[win:] = np.linalg.norm(p[win:] - p[:-win], axis=1) / (win * clip.dt)
480
+ out = dict(p=p, yaw=yaw, cmd=cmd, err=_wrap(cmd - yaw), idx=idx, targets=tgt, radius=r, v_cmd=v_cmd, v=v, mode=mode,
481
+ label=task.get("label", mode), fs=fs)
482
+ clip._task_track = out
483
+ return out
484
+
485
+
486
+ def task_lines(clip, frame):
487
+ tr = task_track(clip)
488
+ if tr is None:
489
+ return []
490
+ out = [f"TASK: {tr['label']}"]
491
+ if tr["mode"] == "target":
492
+ n = len(tr["targets"])
493
+ done = int(tr["idx"][frame]) + (1 if np.linalg.norm(tr["targets"][-1] - tr["p"][frame]) < tr["radius"] else 0)
494
+ out.append(f"waypoint {min(int(tr['idx'][frame]) + 1, n)}/{n} reached {min(done, n)}")
495
+ out.append(f"heading error {np.degrees(tr['err'][frame]):+6.1f} deg (command {np.degrees(_wrap(tr['cmd'][frame])):+6.1f}, body {np.degrees(_wrap(tr['yaw'][frame])):+6.1f})")
496
+ vc, va = tr["v_cmd"][frame], tr["v"][frame]
497
+ out.append(f"speed command {vc:4.2f} actual {va:4.2f} m/s" if np.isfinite(va) and np.isfinite(vc) else f"speed command {vc:4.2f} m/s")
498
+ return out
499
+
500
+
501
+ class MapHUD(TextHUD):
502
+ """The task's top-down map: waypoints (reached green, current orange), the path so far, the body's facing (blue) and the
503
+ commanded heading (orange) at the current frame. Fixed scale over the clip (the bounds of the whole path and the targets)."""
504
+
505
+ def __init__(self, ctx, size_px=300):
506
+ super().__init__(ctx, font_size=14)
507
+ self.size = int(size_px)
508
+
509
+ def set_frame(self, clip, frame):
510
+ tr = task_track(clip)
511
+ if tr is None:
512
+ return False
513
+ S, pad = self.size, 18
514
+ pts = np.vstack([tr["p"], tr["targets"]]) if len(tr["targets"]) else tr["p"]
515
+ lo, hi = pts.min(0) - 1.2, pts.max(0) + 1.2
516
+ span = float(max(hi - lo)); mid = (lo + hi) / 2.0
517
+ def px(xy): # start frame (x ahead, y left) -> image, x to the right, up = +x?
518
+ # draw with +x (ahead) to the RIGHT and +y (left) UP, as the path figures do
519
+ u = pad + (xy[..., 0] - (mid[0] - span / 2)) / span * (S - 2 * pad)
520
+ v = S - pad - (xy[..., 1] - (mid[1] - span / 2)) / span * (S - 2 * pad)
521
+ return np.stack([u, v], -1)
522
+ img = Image.new("RGBA", (S, S), (14, 16, 20, 190))
523
+ dr = ImageDraw.Draw(img)
524
+ dr.rectangle([0, 0, S - 1, S - 1], outline=(255, 180, 30, 200), width=2)
525
+ scale = (S - 2 * pad) / span
526
+ i_cur = int(tr["idx"][frame])
527
+ for j, (tx, ty) in enumerate(tr["targets"]):
528
+ c = px(np.array([tx, ty]))
529
+ rr = tr["radius"] * scale
530
+ col = (90, 200, 120, 255) if j < i_cur else ((255, 160, 40, 255) if j == i_cur else (200, 90, 80, 255))
531
+ dr.ellipse([c[0] - rr, c[1] - rr, c[0] + rr, c[1] + rr], outline=col, width=1)
532
+ dr.line([c[0] - 5, c[1] - 5, c[0] + 5, c[1] + 5], fill=col, width=2)
533
+ dr.line([c[0] - 5, c[1] + 5, c[0] + 5, c[1] - 5], fill=col, width=2)
534
+ fs = tr.get("fs")
535
+ if fs is not None and frame < len(fs["p0"]):
536
+ # the plan's targets: the last ~8 swing targets (grey), the swing target now (filled, the swing foot's side colour:
537
+ # left cyan, right magenta) and the next one (hollow); provisional plans are not drawn
538
+ seg = fs["p0"][max(0, frame - 400): frame + 1][~fs["prov"][max(0, frame - 400): frame + 1]]
539
+ past = seg[np.r_[True, np.abs(np.diff(seg, axis=0)).max(1) > 1e-6]][-8:] if len(seg) else seg
540
+ for q_ in px(past):
541
+ dr.ellipse([q_[0] - 2, q_[1] - 2, q_[0] + 2, q_[1] + 2], fill=(150, 150, 160, 200))
542
+ if not fs["prov"][frame]:
543
+ sw_left = not fs["left"][frame]
544
+ col0 = (60, 220, 230, 255) if sw_left else (235, 80, 220, 255)
545
+ col1 = (235, 80, 220, 255) if sw_left else (60, 220, 230, 255)
546
+ a0, a1 = px(fs["p0"][frame]), px(fs["p1"][frame])
547
+ dr.rectangle([a0[0] - 5, a0[1] - 5, a0[0] + 5, a0[1] + 5], fill=col0)
548
+ dr.rectangle([a1[0] - 5, a1[1] - 5, a1[0] + 5, a1[1] + 5], outline=col1, width=2)
549
+ path = px(tr["p"][: frame + 1])
550
+ if len(path) > 1:
551
+ dr.line([tuple(map(float, q)) for q in path[::2]], fill=(90, 160, 255, 255), width=2)
552
+ c = px(tr["p"][frame])
553
+ L = 0.13 * (S - 2 * pad) # a fixed on-screen length, whatever the map's scale
554
+ for ang, col in ((tr["cmd"][frame], (255, 160, 40, 255)), (tr["yaw"][frame], (90, 160, 255, 255))):
555
+ e = (c[0] + L * np.cos(ang), c[1] - L * np.sin(ang))
556
+ dr.line([float(c[0]), float(c[1]), float(e[0]), float(e[1])], fill=col, width=4)
557
+ dr.ellipse([e[0] - 3, e[1] - 3, e[0] + 3, e[1] + 3], fill=col)
558
+ dr.ellipse([c[0] - 5, c[1] - 5, c[0] + 5, c[1] + 5], fill=(240, 240, 245, 255))
559
+ dr.text((8, 4), "blue = facing, orange = command", font=self.font, fill=(225, 228, 232, 255))
560
+ if fs is not None:
561
+ dr.text((8, S - 56), "squares: footsteps (filled = next)", font=self.font, fill=(185, 188, 192, 255))
562
+ dr.text((8, S - 38), "x: green reached, orange current", font=self.font, fill=(185, 188, 192, 255))
563
+ dr.text((8, S - 20), f"{span:.0f} m across; start facing right", font=self.font, fill=(185, 188, 192, 255))
564
+ self.set_image(img, ("map", id(clip), frame))
565
+ return True