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.
- diffneusim/__init__.py +1 -0
- diffneusim/_cache.py +42 -0
- diffneusim/_paths.py +5 -0
- diffneusim/bindings/rew14_ext.cu +115 -0
- diffneusim/bindings/soft14_capi.cpp +443 -0
- diffneusim/bindings/soft14_engine_ext.cu +596 -0
- diffneusim/bindings/soft_capi.cpp +782 -0
- diffneusim/bindings/soft_engine_ext.cu +495 -0
- diffneusim/core/cpu_engine/build.sh +40 -0
- diffneusim/core/cpu_engine/fiber/cuda_runtime.h +445 -0
- diffneusim/core/cpu_engine/x14_cpu.cpp +283 -0
- diffneusim/core/diff/dual.h +126 -0
- diffneusim/core/include/diffneusim/macros.h +35 -0
- diffneusim/core/kin/kinematic_tree.h +273 -0
- diffneusim/core/math/so3.h +182 -0
- diffneusim/core/soft/adj/out_adj.h +102 -0
- diffneusim/core/soft/adj/rnea_adj.h +425 -0
- diffneusim/core/soft/adj/rows_adj.h +439 -0
- diffneusim/core/soft/adj/rows_functor.h +89 -0
- diffneusim/core/soft/adj/rows_lanes.h +443 -0
- diffneusim/core/soft/adj/shell_adj.h +243 -0
- diffneusim/core/soft/adj/tree_adj.h +356 -0
- diffneusim/core/soft/collide.h +183 -0
- diffneusim/core/soft/gpu/adj14.cuh +233 -0
- diffneusim/core/soft/gpu/adj14_mus.cuh +98 -0
- diffneusim/core/soft/gpu/adj_shell.cuh +50 -0
- diffneusim/core/soft/gpu/adj_tab.cuh +49 -0
- diffneusim/core/soft/gpu/body14.cuh +47 -0
- diffneusim/core/soft/gpu/chol_rn.cuh +458 -0
- diffneusim/core/soft/gpu/chol_small.cuh +123 -0
- diffneusim/core/soft/gpu/chol_split.cuh +193 -0
- diffneusim/core/soft/gpu/engine_launch.cuh +263 -0
- diffneusim/core/soft/gpu/fk_rn.cuh +109 -0
- diffneusim/core/soft/gpu/generated/body_019e20820f86_mmfloor.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_62f77a4bb16b_mmfloor.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor.cuh +25 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +25 -0
- diffneusim/core/soft/gpu/generated/g1_soft_5db44fd45286.cuh +74 -0
- diffneusim/core/soft/gpu/generated/split_62f77a4bb16b_mmfloor.cuh +18 -0
- diffneusim/core/soft/gpu/generated/split_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +18 -0
- diffneusim/core/soft/gpu/generated/x14_soft_019e20820f86_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_62f77a4bb16b_mmfloor.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/k_mus.cuh +1038 -0
- diffneusim/core/soft/gpu/k_mus_host.cuh +377 -0
- diffneusim/core/soft/gpu/k_pre.cuh +52 -0
- diffneusim/core/soft/gpu/kernel_p.cuh +490 -0
- diffneusim/core/soft/gpu/kp14.cuh +465 -0
- diffneusim/core/soft/gpu/l2v2.cuh +367 -0
- diffneusim/core/soft/gpu/l2x14.cuh +319 -0
- diffneusim/core/soft/gpu/l3.cuh +1483 -0
- diffneusim/core/soft/gpu/model_view.cuh +48 -0
- diffneusim/core/soft/gpu/mus_case_fits.h +15 -0
- diffneusim/core/soft/gpu/mus_classes.h +182 -0
- diffneusim/core/soft/gpu/mus_row_cf.h +44 -0
- diffneusim/core/soft/gpu/rew14.cuh +177 -0
- diffneusim/core/soft/gpu/rows_ctab.cuh +44 -0
- diffneusim/core/soft/gpu/tree_m.cuh +247 -0
- diffneusim/core/soft/gpu/x14_engine_kernels.cuh +260 -0
- diffneusim/core/soft/gpu/x14_rowcf.h +14 -0
- diffneusim/core/soft/hand.h +124 -0
- diffneusim/core/soft/impedance.h +115 -0
- diffneusim/core/soft/jvp.h +202 -0
- diffneusim/core/soft/kin.h +250 -0
- diffneusim/core/soft/muscle.h +1208 -0
- diffneusim/core/soft/newton.h +371 -0
- diffneusim/core/soft/rows.h +176 -0
- diffneusim/core/soft/step.h +188 -0
- diffneusim/core/soft/tape.h +313 -0
- diffneusim/core/soft/x14/collide14.h +69 -0
- diffneusim/core/soft/x14/jvp14.h +182 -0
- diffneusim/core/soft/x14/law14.h +453 -0
- diffneusim/core/soft/x14adj/collide14_adj.h +134 -0
- diffneusim/core/soft/x14adj/passive14_adj.h +162 -0
- diffneusim/core/soft/x14adj/reward14.h +484 -0
- diffneusim/core/soft/x14adj/rows14_adj.h +400 -0
- diffneusim/core/soft/x14adj/scan14.h +349 -0
- diffneusim/core/soft/x14adj/shell14_adj.h +122 -0
- diffneusim/core/soft/x14adj/sweep14.h +255 -0
- diffneusim/core/soft/x14adj/tree14_adj.h +500 -0
- diffneusim/core/soft/x14adj/x14adj_common.h +96 -0
- diffneusim/data/mirror/H1622v2k_geyer_hfdeq.npz +0 -0
- diffneusim/data/mirror/H1622v2k_hfd.npz +0 -0
- diffneusim/data/mirror/H1622v2k_millard_hfdeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_calf2_pe.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01legs.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01lumbar.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_hinge.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_compound_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_luispe.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_trunk0701.npz +0 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01legs.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01lumbar.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1a.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n2.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_rom23.json +91 -0
- diffneusim/data/reference/musclemimic/myofullbody_mimic_sites.json +261 -0
- diffneusim/data/reference/pose3/pose3_scone.json +305 -0
- diffneusim/data/reference/pose3/pose3_scone.txt +3 -0
- diffneusim/data/reference/pose3/pose3_scone_gait.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_mirror.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_stand.npz +0 -0
- diffneusim/data/reference/x016run/MD5SUMS +241 -0
- diffneusim/data/reference/x016run/x016run_states.txt +240 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r3.npz +0 -0
- diffneusim/data/state_prior/lumbar_poly_fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/engine/__init__.py +0 -0
- diffneusim/engine/build_tag.py +52 -0
- diffneusim/engine/case_tables.py +46 -0
- diffneusim/engine/d16_body.py +80 -0
- diffneusim/engine/engine14.py +367 -0
- diffneusim/engine/gen_split.py +159 -0
- diffneusim/engine/hand_format.py +69 -0
- diffneusim/engine/live14.py +149 -0
- diffneusim/engine/phase_b_tree.py +137 -0
- diffneusim/engine/soft14.py +130 -0
- diffneusim/engine/soft_capi.py +373 -0
- diffneusim/engine/soft_engine.py +165 -0
- diffneusim/engine/step14.py +132 -0
- diffneusim/engine/tape_format.py +89 -0
- diffneusim/engine/x14cpu.py +163 -0
- diffneusim/env/__init__.py +0 -0
- diffneusim/env/absent.py +20 -0
- diffneusim/env/cpu14.py +105 -0
- diffneusim/env/e0loop14.py +224 -0
- diffneusim/env/env14.py +568 -0
- diffneusim/env/kin_contact14.py +193 -0
- diffneusim/env/mimic_sites_x14.json +366 -0
- diffneusim/env/old_count.py +78 -0
- diffneusim/env/rew14.py +114 -0
- diffneusim/env/rew14_hook.py +105 -0
- diffneusim/g1/__init__.py +1 -0
- diffneusim/g1/arm_a2.py +165 -0
- diffneusim/g1/arm_a3.py +576 -0
- diffneusim/g1/read_a3.py +79 -0
- diffneusim/g1/rg1_read.py +89 -0
- diffneusim/model/__init__.py +66 -0
- diffneusim/model/case.py +17 -0
- diffneusim/model/dnmodel.py +79 -0
- diffneusim/model/fuse_fixed.py +281 -0
- diffneusim/model/monitor.py +834 -0
- diffneusim/models/BODIES.toml +48 -0
- diffneusim/models/MANIFEST.toml +979 -0
- diffneusim/models/cases/G290/case.bin +0 -0
- diffneusim/models/cases/G290/case.json +1 -0
- diffneusim/models/cases/G356-SRC/case.bin +0 -0
- diffneusim/models/cases/G356-SRC/case.json +1 -0
- diffneusim/models/cases/G416/case.bin +0 -0
- diffneusim/models/cases/G416/case.json +1 -0
- diffneusim/models/cases/M290C-SRC/case.bin +0 -0
- diffneusim/models/cases/M290C-SRC/case.json +1 -0
- diffneusim/models/cases/M290R-SRC/case.bin +0 -0
- diffneusim/models/cases/M290R-SRC/case.json +1 -0
- diffneusim/models/cases/M356C-SRC/case.bin +0 -0
- diffneusim/models/cases/M356C-SRC/case.json +1 -0
- diffneusim/models/cases/M356R-SRC/case.bin +0 -0
- diffneusim/models/cases/M356R-SRC/case.json +1 -0
- diffneusim/models/cases/M416C-SRC/case.bin +0 -0
- diffneusim/models/cases/M416C-SRC/case.json +1 -0
- diffneusim/models/derived/d16_expanded_62f77a4bb16b1e67_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_expanded_a1e8b196b2cd7b3c_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_soft_law_019e20820f8633b9_mmfloor.json +7844 -0
- diffneusim/models/derived/d16_soft_law_62f77a4bb16b1e67_mmfloor.json +16855 -0
- diffneusim/models/derived/d16_soft_law_77dbb7213f26e821_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsd05_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsdef_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsmjd_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_a1e8b196b2cd7b3c_mmfloor_rampsb3l_n6t12.json +16894 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor.json +12655 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor_rampsb3l_n6t12.json +12700 -0
- diffneusim/models/derived/unitree_g1_soft_law.json +15580 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +28913 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +29202 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +46970 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +38570 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +38923 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_meshes/1mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2distph.stl +0 -0
- diffneusim/models/fullbody_meshes/2mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2midph.stl +0 -0
- diffneusim/models/fullbody_meshes/2proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/3distph.stl +0 -0
- diffneusim/models/fullbody_meshes/3mc.stl +0 -0
- diffneusim/models/fullbody_meshes/3midph.stl +0 -0
- diffneusim/models/fullbody_meshes/3proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/4distph.stl +0 -0
- diffneusim/models/fullbody_meshes/4mc.stl +0 -0
- diffneusim/models/fullbody_meshes/4midph.stl +0 -0
- diffneusim/models/fullbody_meshes/4proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/5distph.stl +0 -0
- diffneusim/models/fullbody_meshes/5mc.stl +0 -0
- diffneusim/models/fullbody_meshes/5midph.stl +0 -0
- diffneusim/models/fullbody_meshes/5proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/NOTICE +2 -0
- diffneusim/models/fullbody_meshes/capitate.stl +0 -0
- diffneusim/models/fullbody_meshes/clavicle.stl +0 -0
- diffneusim/models/fullbody_meshes/hamate.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_cervical.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_jaw.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_skull.stl +0 -0
- diffneusim/models/fullbody_meshes/humerus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/l_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/l_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/l_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/l_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar1.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar2.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar3.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar4.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar5.stl +0 -0
- diffneusim/models/fullbody_meshes/lunate.stl +0 -0
- diffneusim/models/fullbody_meshes/pisiform.stl +0 -0
- diffneusim/models/fullbody_meshes/r_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/r_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/r_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/r_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/r_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/r_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/radius.stl +0 -0
- diffneusim/models/fullbody_meshes/sacrum.stl +0 -0
- diffneusim/models/fullbody_meshes/scaphoid.stl +0 -0
- diffneusim/models/fullbody_meshes/scapula.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic10_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic11_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic12_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic1_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic2_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic3_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic4_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic5_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic6_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic7_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic8_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic9_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thorax.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbdist.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbprox.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezium.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezoid.stl +0 -0
- diffneusim/models/fullbody_meshes/triquetrum.stl +0 -0
- diffneusim/models/fullbody_meshes/ulna.stl +0 -0
- diffneusim/models/source/myo_fullbody/UPSTREAM.md +91 -0
- diffneusim/models/source/myoleg/UPSTREAM.md +52 -0
- diffneusim/models/source/unitree_g1/LICENSE.mjlab +202 -0
- diffneusim/models/source/unitree_g1/UPSTREAM.md +38 -0
- diffneusim/models/source/unitree_g1/assets/head_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/logo_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis_contour_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/torso_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_roll_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_yaw_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/dump_mjlab_reference.py +30 -0
- diffneusim/models/source/unitree_g1/g1.xml +308 -0
- diffneusim/models/source/unitree_g1/g1_constants.py +298 -0
- diffneusim/models/source/unitree_g1/mjlab_compiled_reference.json +857 -0
- diffneusim/models/unitree_g1.dnmodel +4393 -0
- diffneusim/models/unitree_g1_selfcol.dnmodel +20824 -0
- diffneusim/rl/__init__.py +2 -0
- diffneusim/rl/dynsyn_layer.py +146 -0
- diffneusim/rl/footstep_plan.py +337 -0
- diffneusim/rl/g1_bm_env.py +572 -0
- diffneusim/rl/g1_bm_eval.py +168 -0
- diffneusim/rl/g1_bm_fused.py +275 -0
- diffneusim/rl/g1_bm_ppo.py +622 -0
- diffneusim/rl/g1_bm_sapo.py +551 -0
- diffneusim/rl/g1_ppo.py +395 -0
- diffneusim/rl/g1_sapo_soft.py +240 -0
- diffneusim/rl/g1_soft_env.py +452 -0
- diffneusim/rl/g1_soft_grad.py +145 -0
- diffneusim/rl/geyer_curves_torch.py +108 -0
- diffneusim/rl/gpu_fullbody_vec_env.py +1241 -0
- diffneusim/rl/imitation.py +2027 -0
- diffneusim/rl/imitation_reward_v2.py +248 -0
- diffneusim/rl/imitation_reward_v3.py +349 -0
- diffneusim/rl/latent_task.py +175 -0
- diffneusim/rl/llc_reward.py +316 -0
- diffneusim/rl/millard_curves_torch.py +154 -0
- diffneusim/rl/mirror_symmetry.py +212 -0
- diffneusim/rl/model_path.py +35 -0
- diffneusim/rl/mvae_recon.py +123 -0
- diffneusim/rl/nets_shac.py +599 -0
- diffneusim/rl/reset_pool.py +154 -0
- diffneusim/rl/sapo_capture.py +873 -0
- diffneusim/rl/sapo_vec.py +1051 -0
- diffneusim/rl/shac_vec.py +346 -0
- diffneusim/rl/state_prior.py +151 -0
- diffneusim/rl/step_library.py +105 -0
- diffneusim/rl/task_walk_env.py +1793 -0
- diffneusim/rl/task_walk_reward.py +3300 -0
- diffneusim/run.py +23 -0
- diffneusim/run_env.py +46 -0
- diffneusim/tasks/__init__.py +147 -0
- diffneusim/tasks/legacy_names.py +63 -0
- diffneusim/tasks/paths.py +79 -0
- diffneusim/tasks/settings.py +202 -0
- diffneusim/third_party/instantmimic_947430ee/LICENSE +202 -0
- diffneusim/third_party/instantmimic_947430ee/NOTICE +19 -0
- diffneusim/third_party/instantmimic_947430ee/README.md +31 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/benchmark_protocol.py +106 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/metrics.py +214 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/reference.py +513 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/motion/quaternion.py +193 -0
- diffneusim/train/__init__.py +0 -0
- diffneusim/train/eval_ckpt.py +239 -0
- diffneusim/train/eval_mimic.py +133 -0
- diffneusim/train/gait_report.py +203 -0
- diffneusim/train/gcot_chain.py +51 -0
- diffneusim/train/levers.py +135 -0
- diffneusim/train/masked_reset.py +314 -0
- diffneusim/train/rl_algorithm_suite.py +917 -0
- diffneusim/train/train14.py +240 -0
- diffneusim/train/train_tw14.py +674 -0
- diffneusim/viz/__init__.py +5 -0
- diffneusim/viz/__main__.py +41 -0
- diffneusim/viz/camera.py +115 -0
- diffneusim/viz/dnrec.py +118 -0
- diffneusim/viz/dnrec_io.py +686 -0
- diffneusim/viz/hud.py +565 -0
- diffneusim/viz/meshes.py +458 -0
- diffneusim/viz/play.py +237 -0
- diffneusim/viz/record.py +74 -0
- diffneusim/viz/render.py +1402 -0
- diffneusim/viz/renderer.py +268 -0
- diffneusim/viz/rl_env_render.py +635 -0
- diffneusim/viz/snapshot.py +54 -0
- diffneusim/viz/strobe.py +124 -0
- diffneusim/viz/to_mp4.py +58 -0
- diffneusim/viz/ui.py +481 -0
- diffneusim/viz/viewer.py +2086 -0
- diffneusim-1.0.0.dist-info/METADATA +226 -0
- diffneusim-1.0.0.dist-info/RECORD +682 -0
- diffneusim-1.0.0.dist-info/WHEEL +5 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSE +201 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-ARMS-hand-wrist-4.3.txt +20 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-MoBL-ARMS.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/CC-BY-3.0-OpenSim-geometry.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Christophy2012-lumbarspine.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lai2017-model-high-flex.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lee2015-hand_muscle.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Rajagopal2016-full_body.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Uhlrich2022-fbmodpassivecal.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/NOTICE +274 -0
- diffneusim-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"""Each foot's contact in the D16 engine's own law, from the pose alone (feat/d16-taskwalk step 3; C, 2026-11-09).
|
|
2
|
+
|
|
3
|
+
The D16 engine collides the floor (plane z = 0) with each floor pair's geom and keeps a contact iff its distance is below the pair's margin
|
|
4
|
+
(l2x14.cuh's COLLIDE stage: collide.h's colliders, MuJoCo's). A foot is DOWN when any of its floor-pair geoms (the law JSON's pairs with the
|
|
5
|
+
floor whose geom sits on calcn_<side> or toes_<side>) is within its pair's margin of the plane: exactly the engine's active contact set on that
|
|
6
|
+
foot, computed from the body poses with the colliders' own distances:
|
|
7
|
+
sphere p_z - r
|
|
8
|
+
capsule p_z - |a_z| h - r (a the capsule's axis, h its half-length; MuJoCo's two end contacts, the lower)
|
|
9
|
+
ellipsoid p_z - sqrt(sum_k (R[2,k] s_k)^2) (the support point along -z, exact)
|
|
10
|
+
The body poses are the env's own FK (DnModelMonitor.body_poses_subset on the old chart's q): calcn_* / toes_* frames equal MuJoCo's on the law's
|
|
11
|
+
expanded XML to 1e-8 (gate_kin_contact14.py K0). Flat ground only (the floor geom at the origin, unrotated: asserted).
|
|
12
|
+
This replaces the old engine's contact force for the mirror's strike latch (DN_MIRROR_SYM: fz > 1 N on the old foot spheres); the latch
|
|
13
|
+
reads it through env._mirror_down. gap() grounds a reset pose on these geoms (env14's E0_ENV14_GROUND14). Torch, any device, no engine call."""
|
|
14
|
+
import json
|
|
15
|
+
|
|
16
|
+
import torch
|
|
17
|
+
|
|
18
|
+
GEOM_PLANE, GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID = 0, 2, 3, 4
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def foot_geoms(law, sides=("r", "l")):
|
|
22
|
+
"""{side: [dict(body=name, type, size, pos, quat, margin)]}: the floor pairs' geoms on calcn_<side> / toes_<side>, from the law JSON"""
|
|
23
|
+
G, B = law["geoms"], law["bodies"]
|
|
24
|
+
fl = G[0]
|
|
25
|
+
assert fl["name"] == "floor" and fl["type"] == GEOM_PLANE and fl["pos"] == [0.0, 0.0, 0.0] and fl["quat"] == [1.0, 0.0, 0.0, 0.0], fl
|
|
26
|
+
out = {s: [] for s in sides}
|
|
27
|
+
for p in law["pairs"]:
|
|
28
|
+
if 0 not in (p["g1"], p["g2"]):
|
|
29
|
+
continue
|
|
30
|
+
assert p["gap"] == 0.0, p
|
|
31
|
+
g = G[p["g2"] if p["g1"] == 0 else p["g1"]]
|
|
32
|
+
bn = B[g["body"]]["name"]
|
|
33
|
+
for s in sides:
|
|
34
|
+
if bn in (f"calcn_{s}", f"toes_{s}"):
|
|
35
|
+
assert g["type"] in (GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID), g
|
|
36
|
+
out[s].append(dict(name=g["name"], body=bn, type=int(g["type"]), size=[float(x) for x in g["size"]],
|
|
37
|
+
pos=[float(x) for x in g["pos"]], quat=[float(x) for x in g["quat"]], margin=float(p["margin"])))
|
|
38
|
+
for s in sides:
|
|
39
|
+
assert out[s], f"no floor pair on the {s} foot"
|
|
40
|
+
return out
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _qmul(a, b): # (4, ...) quaternions, w first
|
|
44
|
+
aw, ax, ay, az = a
|
|
45
|
+
bw, bx, by, bz = b
|
|
46
|
+
return torch.stack([aw * bw - ax * bx - ay * by - az * bz, aw * bx + ax * bw + ay * bz - az * by,
|
|
47
|
+
aw * by - ax * bz + ay * bw + az * bx, aw * bz + ax * by - ay * bx + az * bw])
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _rot_row2(q): # the third row of R(q), (3, ...): world z of the body's x, y, z axes
|
|
51
|
+
w, x, y, z = q
|
|
52
|
+
return torch.stack([2 * (x * z - w * y), 2 * (y * z + w * x), 1 - 2 * (x * x + y * y)])
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _rotate_z(q, v): # the world z of R(q) v, v (3,) constant
|
|
56
|
+
r = _rot_row2(q)
|
|
57
|
+
return r[0] * v[0] + r[1] * v[1] + r[2] * v[2]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def other_geoms(law, feet=("calcn_r", "toes_r", "calcn_l", "toes_l")):
|
|
61
|
+
"""{"o": [...]}: the floor pairs' geoms on every body but the feet (the N1-290 law: Full Body, femur_*, tibia_*, lumbar1 with the welded
|
|
62
|
+
arms), in foot_geoms' form; TASKWALK_FALL_NONFOOT's contact set (11-13, the review)"""
|
|
63
|
+
G, B = law["geoms"], law["bodies"]
|
|
64
|
+
fl = G[0]
|
|
65
|
+
assert fl["name"] == "floor" and fl["type"] == GEOM_PLANE and fl["pos"] == [0.0, 0.0, 0.0] and fl["quat"] == [1.0, 0.0, 0.0, 0.0], fl
|
|
66
|
+
out = {"o": []}
|
|
67
|
+
for p in law["pairs"]:
|
|
68
|
+
if 0 not in (p["g1"], p["g2"]):
|
|
69
|
+
continue
|
|
70
|
+
assert p["gap"] == 0.0, p
|
|
71
|
+
g = G[p["g2"] if p["g1"] == 0 else p["g1"]]
|
|
72
|
+
bn = B[g["body"]]["name"]
|
|
73
|
+
if bn not in feet:
|
|
74
|
+
assert g["type"] in (GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID), g
|
|
75
|
+
# jname: the law body's joint, so the geom finds ITS link of a same-named dnmodel chain (tibia_r is 5 links there, the first a
|
|
76
|
+
# 0.001 kg phantom; a name lookup lands on it: 11-13, the MuJoCo check of this set)
|
|
77
|
+
out["o"].append(dict(name=g["name"], body=bn, jname=B[g["body"]]["joint_name"], type=int(g["type"]),
|
|
78
|
+
size=[float(x) for x in g["size"]], pos=[float(x) for x in g["pos"]], quat=[float(x) for x in g["quat"]],
|
|
79
|
+
margin=float(p["margin"])))
|
|
80
|
+
assert out["o"], "no non-foot floor pair in the law"
|
|
81
|
+
return out
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class FootTouch14:
|
|
85
|
+
"""touch(q) -> (down_r, down_l) (n,) bool; lowest(q) -> {side: (G, n) each geom's distance minus its margin}. With geoms=other_geoms
|
|
86
|
+
(TASKWALK_FALL_NONFOOT) the same colliders over the non-foot floor pairs: any_down(q) -> (n,) bool"""
|
|
87
|
+
|
|
88
|
+
def __init__(self, law_path, monitor, device, dtype=torch.float32, geoms=None):
|
|
89
|
+
law = json.load(open(law_path))
|
|
90
|
+
self.geoms = foot_geoms(law) if geoms is None else geoms(law)
|
|
91
|
+
jn = [b["name"] for b in monitor.jm["bodies"]]
|
|
92
|
+
self.mon = monitor
|
|
93
|
+
jb = monitor.jm["bodies"]
|
|
94
|
+
def link(g): # the foot geoms (unique names): the name; other_geoms: the link with the law body's name AND joint (asserted unique)
|
|
95
|
+
if "jname" not in g:
|
|
96
|
+
return jn.index(g["body"])
|
|
97
|
+
c = [i for i, x in enumerate(jb) if x["name"] == g["body"] and x.get("joint_name") == g["jname"]]
|
|
98
|
+
assert len(c) == 1, ("no unique dnmodel link for the law body", g["body"], g["jname"], c)
|
|
99
|
+
return c[0]
|
|
100
|
+
self.bodies = sorted({link(g) for s in self.geoms for g in self.geoms[s]})
|
|
101
|
+
self.dev, self.dt = device, dtype
|
|
102
|
+
self.tab = {}
|
|
103
|
+
for s, gs in self.geoms.items():
|
|
104
|
+
self.tab[s] = [(link(g), g["type"], torch.tensor(g["size"], dtype=dtype, device=device),
|
|
105
|
+
torch.tensor(g["pos"], dtype=dtype, device=device), torch.tensor(g["quat"], dtype=dtype, device=device)[:, None],
|
|
106
|
+
g["margin"]) for g in gs]
|
|
107
|
+
self.n_calls = 0
|
|
108
|
+
# TW1 K1 (11-10; the census: the per-geom loop below was ~764 kernel launches per control step, every step, in the mirror latch):
|
|
109
|
+
# every geom of both sides in one stacked computation. The arithmetic per element is the loop's, in the same order (the same
|
|
110
|
+
# products and sums, the constants as (G, 1) columns of the same float32 values instead of 0-d tensors), so lowest() equals
|
|
111
|
+
# lowest_reference() bitwise (test_kin_batched.py, tw1_traj.py). One margin for every row (asserted), subtracted as the same
|
|
112
|
+
# Python float.
|
|
113
|
+
rows = [(s, *r) for s in self.tab for r in self.tab[s]]
|
|
114
|
+
self.side_rows = {s: (sum(len(self.tab[x]) for x in list(self.tab)[:i]), len(self.tab[s])) for i, s in enumerate(self.tab)}
|
|
115
|
+
margins = {r[6] for r in rows}
|
|
116
|
+
assert len(margins) == 1, margins
|
|
117
|
+
self.margin = margins.pop()
|
|
118
|
+
self.row_body = [r[1] for r in rows]
|
|
119
|
+
col = lambda k, i: torch.stack([r[k][i] if len(r[k]) > i else r[k][0] for r in rows])[:, None] # noqa: E731 (G, 1)
|
|
120
|
+
self.gp = [col(4, i) for i in range(3)] # the geom's position in its body, per axis
|
|
121
|
+
self.gq = [torch.stack([r[5][i, 0] for r in rows])[:, None] for i in range(4)] # the geom's frame in its body (w, x, y, z)
|
|
122
|
+
self.size = [col(3, i) for i in range(3)]
|
|
123
|
+
types = [r[2] for r in rows]
|
|
124
|
+
self.groups = {t: torch.tensor([i for i, x in enumerate(types) if x == t], device=device)
|
|
125
|
+
for t in (GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID) if t in types}
|
|
126
|
+
order = [i for t in self.groups for i in self.groups[t].tolist()]
|
|
127
|
+
self.unperm = torch.tensor(sorted(range(len(order)), key=lambda j: order[j]), device=device) # cat order -> row order
|
|
128
|
+
|
|
129
|
+
def lowest(self, q, poses=None):
|
|
130
|
+
"""{side: (G, n)}: each foot geom's distance to the plane minus its pair's margin (< 0: the engine keeps the contact). poses = (pos,
|
|
131
|
+
quat) dicts covering the foot bodies (TW1 K2: the reward's own FK of the same q, detached) skips this call's FK"""
|
|
132
|
+
pos, quat = poses if poses is not None else self.mon.body_poses_subset(q, self.bodies, False)[:2]
|
|
133
|
+
Q = [torch.stack([quat[b][k] for b in self.row_body]).to(self.dt) for k in range(4)] # (G, n) each: w, x, y, z
|
|
134
|
+
w, x, y, z = Q
|
|
135
|
+
r0, r1, r2 = 2 * (x * z - w * y), 2 * (y * z + w * x), 1 - 2 * (x * x + y * y) # _rot_row2(qb)
|
|
136
|
+
pz = torch.stack([pos[b][2] for b in self.row_body]).to(self.dt) + (r0 * self.gp[0] + r1 * self.gp[1] + r2 * self.gp[2])
|
|
137
|
+
parts = []
|
|
138
|
+
if GEOM_SPHERE in self.groups:
|
|
139
|
+
i = self.groups[GEOM_SPHERE]
|
|
140
|
+
parts.append(pz[i] - self.size[0][i])
|
|
141
|
+
if GEOM_CAPSULE in self.groups or GEOM_ELLIPSOID in self.groups:
|
|
142
|
+
bw, bx, by, bz = self.gq # _qmul(qb, gq)
|
|
143
|
+
mw = w * bw - x * bx - y * by - z * bz
|
|
144
|
+
mx = w * bx + x * bw + y * bz - z * by
|
|
145
|
+
my = w * by - x * bz + y * bw + z * bx
|
|
146
|
+
mz = w * bz + x * by - y * bx + z * bw
|
|
147
|
+
g0, g1, g2 = 2 * (mx * mz - mw * my), 2 * (my * mz + mw * mx), 1 - 2 * (mx * mx + my * my) # _rot_row2 of the product
|
|
148
|
+
if GEOM_CAPSULE in self.groups:
|
|
149
|
+
i = self.groups[GEOM_CAPSULE]
|
|
150
|
+
parts.append(pz[i] - g2[i].abs() * self.size[1][i] - self.size[0][i])
|
|
151
|
+
if GEOM_ELLIPSOID in self.groups:
|
|
152
|
+
i = self.groups[GEOM_ELLIPSOID]
|
|
153
|
+
parts.append(pz[i] - torch.sqrt((g0[i] * self.size[0][i]) ** 2 + (g1[i] * self.size[1][i]) ** 2
|
|
154
|
+
+ (g2[i] * self.size[2][i]) ** 2))
|
|
155
|
+
d = torch.cat(parts)[self.unperm] - self.margin
|
|
156
|
+
return {s: d[a:a + n] for s, (a, n) in self.side_rows.items()}
|
|
157
|
+
|
|
158
|
+
def lowest_reference(self, q):
|
|
159
|
+
"""lowest()'s per-geom form (the original loop, kept as the reference lowest() is checked against bitwise)"""
|
|
160
|
+
pos, quat, _ = self.mon.body_poses_subset(q, self.bodies, False)
|
|
161
|
+
out = {}
|
|
162
|
+
for s, rows in self.tab.items():
|
|
163
|
+
d = []
|
|
164
|
+
for b, t, size, gp, gq, margin in rows:
|
|
165
|
+
qb = quat[b].to(self.dt)
|
|
166
|
+
pz = pos[b][2].to(self.dt) + _rotate_z(qb, gp) # the geom's centre, world z
|
|
167
|
+
if t == GEOM_SPHERE:
|
|
168
|
+
dist = pz - size[0]
|
|
169
|
+
else:
|
|
170
|
+
r2 = _rot_row2(_qmul(qb, gq.expand_as(qb))) # the geom frame's third row: R[2, 0..2]
|
|
171
|
+
if t == GEOM_CAPSULE: # the axis is the geom's z: its world z component R[2, 2]
|
|
172
|
+
dist = pz - r2[2].abs() * size[1] - size[0]
|
|
173
|
+
else:
|
|
174
|
+
dist = pz - torch.sqrt((r2[0] * size[0]) ** 2 + (r2[1] * size[1]) ** 2 + (r2[2] * size[2]) ** 2)
|
|
175
|
+
d.append(dist - margin)
|
|
176
|
+
out[s] = torch.stack(d)
|
|
177
|
+
return out
|
|
178
|
+
|
|
179
|
+
def gap(self, q):
|
|
180
|
+
"""(n,): the lowest foot geom's distance to the plane (the margin added back): 0 = the lowest geom touches"""
|
|
181
|
+
lo = self.lowest(q)
|
|
182
|
+
m = {s: torch.tensor([r[5] for r in self.tab[s]], dtype=self.dt, device=self.dev)[:, None] for s in self.tab}
|
|
183
|
+
return torch.minimum((lo["r"] + m["r"]).min(0).values, (lo["l"] + m["l"]).min(0).values)
|
|
184
|
+
|
|
185
|
+
def touch(self, q, poses=None):
|
|
186
|
+
self.n_calls += 1
|
|
187
|
+
lo = self.lowest(q, poses)
|
|
188
|
+
return (lo["r"] < 0).any(0), (lo["l"] < 0).any(0)
|
|
189
|
+
|
|
190
|
+
def any_down(self, q, poses=None):
|
|
191
|
+
"""(n,) bool: any of this set's geoms within its pair's margin (other_geoms: a non-foot body on the floor)"""
|
|
192
|
+
assert set(self.tab) == {"o"}, "any_down is the other_geoms set's"
|
|
193
|
+
return (self.lowest(q, poses)["o"] < 0).any(0)
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model": "fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.dnmodel",
|
|
3
|
+
"law": "e0_14x_soft_law_f1c2243ae6be449e_mmfloor.json",
|
|
4
|
+
"n_states": 256,
|
|
5
|
+
"sites": [
|
|
6
|
+
{
|
|
7
|
+
"site": "pelvis_mimic",
|
|
8
|
+
"body_old": "pelvis",
|
|
9
|
+
"b14": 1,
|
|
10
|
+
"b14_name": "Full Body",
|
|
11
|
+
"pos": [
|
|
12
|
+
0.0,
|
|
13
|
+
0.0,
|
|
14
|
+
0.0
|
|
15
|
+
],
|
|
16
|
+
"quat": [
|
|
17
|
+
0.7071067811865476,
|
|
18
|
+
0.7071067811865476,
|
|
19
|
+
-1.214306433183765e-17,
|
|
20
|
+
6.938893903907228e-18
|
|
21
|
+
],
|
|
22
|
+
"spread": 3.3306690738754696e-16,
|
|
23
|
+
"max_err_P": 0.0,
|
|
24
|
+
"max_err_Q": 2.220446049250313e-16
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"site": "upper_body_mimic",
|
|
28
|
+
"body_old": "lumbar1",
|
|
29
|
+
"b14": 19,
|
|
30
|
+
"b14_name": "lumbar1",
|
|
31
|
+
"pos": [
|
|
32
|
+
-1.0074504309411302e-17,
|
|
33
|
+
3.5738810517731515e-18,
|
|
34
|
+
9.655458800411759e-17
|
|
35
|
+
],
|
|
36
|
+
"quat": [
|
|
37
|
+
1.0,
|
|
38
|
+
2.200930410145574e-16,
|
|
39
|
+
1.1275702593849246e-17,
|
|
40
|
+
5.0306980803327406e-17
|
|
41
|
+
],
|
|
42
|
+
"spread": 8.881784197001252e-16,
|
|
43
|
+
"max_err_P": 4.440892098500626e-16,
|
|
44
|
+
"max_err_Q": 7.771561172376096e-16
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"site": "head_mimic",
|
|
48
|
+
"body_old": "head",
|
|
49
|
+
"b14": 19,
|
|
50
|
+
"b14_name": "lumbar1",
|
|
51
|
+
"pos": [
|
|
52
|
+
-0.0025000000000000334,
|
|
53
|
+
0.40100000000000036,
|
|
54
|
+
4.440892098500626e-16
|
|
55
|
+
],
|
|
56
|
+
"quat": [
|
|
57
|
+
1.0,
|
|
58
|
+
2.200930410145574e-16,
|
|
59
|
+
1.1275702593849246e-17,
|
|
60
|
+
5.0306980803327406e-17
|
|
61
|
+
],
|
|
62
|
+
"spread": 1.1891529427821013e-15,
|
|
63
|
+
"max_err_P": 1.3322676295501878e-15,
|
|
64
|
+
"max_err_Q": 7.771561172376096e-16
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"site": "left_shoulder_mimic",
|
|
68
|
+
"body_old": "humerus_l",
|
|
69
|
+
"b14": 51,
|
|
70
|
+
"b14_name": "humerus_l",
|
|
71
|
+
"pos": [
|
|
72
|
+
1.5009864778058442e-16,
|
|
73
|
+
1.1403607091067931e-16,
|
|
74
|
+
3.3979269872328656e-16
|
|
75
|
+
],
|
|
76
|
+
"quat": [
|
|
77
|
+
1.0000000000000007,
|
|
78
|
+
3.8510861166685117e-16,
|
|
79
|
+
1.249000902703301e-16,
|
|
80
|
+
-1.249000902703301e-16
|
|
81
|
+
],
|
|
82
|
+
"spread": 1.5543122344752192e-15,
|
|
83
|
+
"max_err_P": 1.1102230246251565e-15,
|
|
84
|
+
"max_err_Q": 1.5543122344752192e-15
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"site": "left_elbow_mimic",
|
|
88
|
+
"body_old": "ulna_l",
|
|
89
|
+
"b14": 52,
|
|
90
|
+
"b14_name": "ulna_l",
|
|
91
|
+
"pos": [
|
|
92
|
+
3.0666461355875576e-16,
|
|
93
|
+
3.850161386560089e-16,
|
|
94
|
+
6.510315389320607e-17
|
|
95
|
+
],
|
|
96
|
+
"quat": [
|
|
97
|
+
1.0000000000000004,
|
|
98
|
+
5.030698080332741e-16,
|
|
99
|
+
-5.898059818321144e-17,
|
|
100
|
+
-2.1337098754514727e-16
|
|
101
|
+
],
|
|
102
|
+
"spread": 1.3912482277333993e-15,
|
|
103
|
+
"max_err_P": 1.5543122344752192e-15,
|
|
104
|
+
"max_err_Q": 1.5543122344752192e-15
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"site": "left_hand_mimic",
|
|
108
|
+
"body_old": "lunate_l",
|
|
109
|
+
"b14": 55,
|
|
110
|
+
"b14_name": "lunate_l",
|
|
111
|
+
"pos": [
|
|
112
|
+
6.700460844903972e-17,
|
|
113
|
+
4.478358008932125e-16,
|
|
114
|
+
-3.3974728936514323e-16
|
|
115
|
+
],
|
|
116
|
+
"quat": [
|
|
117
|
+
1.0000000000000004,
|
|
118
|
+
4.0939474033052647e-16,
|
|
119
|
+
-2.7755575615628914e-17,
|
|
120
|
+
-3.7470027081099033e-16
|
|
121
|
+
],
|
|
122
|
+
"spread": 1.6350888179376964e-15,
|
|
123
|
+
"max_err_P": 1.887379141862766e-15,
|
|
124
|
+
"max_err_Q": 1.4432899320127035e-15
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"site": "right_shoulder_mimic",
|
|
128
|
+
"body_old": "humerus_r",
|
|
129
|
+
"b14": 33,
|
|
130
|
+
"b14_name": "humerus_r",
|
|
131
|
+
"pos": [
|
|
132
|
+
-1.1829060525433411e-16,
|
|
133
|
+
-5.177010932010586e-17,
|
|
134
|
+
3.070191415632783e-16
|
|
135
|
+
],
|
|
136
|
+
"quat": [
|
|
137
|
+
0.9999999999999998,
|
|
138
|
+
-2.0816681711721685e-17,
|
|
139
|
+
1.3877787807814457e-17,
|
|
140
|
+
1.249000902703301e-16
|
|
141
|
+
],
|
|
142
|
+
"spread": 1.3322676295501878e-15,
|
|
143
|
+
"max_err_P": 1.1102230246251565e-15,
|
|
144
|
+
"max_err_Q": 9.992007221626409e-16
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"site": "right_elbow_mimic",
|
|
148
|
+
"body_old": "ulna_r",
|
|
149
|
+
"b14": 34,
|
|
150
|
+
"b14_name": "ulna_r",
|
|
151
|
+
"pos": [
|
|
152
|
+
-3.602009003146464e-17,
|
|
153
|
+
-4.8774802034939207e-17,
|
|
154
|
+
3.4580787764503097e-16
|
|
155
|
+
],
|
|
156
|
+
"quat": [
|
|
157
|
+
1.0,
|
|
158
|
+
3.2959746043559335e-17,
|
|
159
|
+
-2.7755575615628914e-17,
|
|
160
|
+
8.326672684688674e-17
|
|
161
|
+
],
|
|
162
|
+
"spread": 1.3431114712333363e-15,
|
|
163
|
+
"max_err_P": 1.3322676295501878e-15,
|
|
164
|
+
"max_err_Q": 8.881784197001252e-16
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"site": "right_hand_mimic",
|
|
168
|
+
"body_old": "lunate_r",
|
|
169
|
+
"b14": 37,
|
|
170
|
+
"b14_name": "lunate_r",
|
|
171
|
+
"pos": [
|
|
172
|
+
7.334548164207165e-17,
|
|
173
|
+
-2.5957625256639473e-16,
|
|
174
|
+
3.36006333370681e-16
|
|
175
|
+
],
|
|
176
|
+
"quat": [
|
|
177
|
+
1.0,
|
|
178
|
+
-4.163336342344337e-17,
|
|
179
|
+
8.326672684688674e-17,
|
|
180
|
+
1.6653345369377348e-16
|
|
181
|
+
],
|
|
182
|
+
"spread": 1.3196973535350964e-15,
|
|
183
|
+
"max_err_P": 1.3322676295501878e-15,
|
|
184
|
+
"max_err_Q": 9.992007221626409e-16
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"site": "left_hip_mimic",
|
|
188
|
+
"body_old": "femur_l",
|
|
189
|
+
"b14": 61,
|
|
190
|
+
"b14_name": "femur_l",
|
|
191
|
+
"pos": [
|
|
192
|
+
-7.46157333973857e-18,
|
|
193
|
+
2.2488889989907985e-18,
|
|
194
|
+
-4.0897486127076716e-17
|
|
195
|
+
],
|
|
196
|
+
"quat": [
|
|
197
|
+
0.9999999999999999,
|
|
198
|
+
-8.673617379884035e-19,
|
|
199
|
+
6.938893903907228e-18,
|
|
200
|
+
-6.938893903907228e-18
|
|
201
|
+
],
|
|
202
|
+
"spread": 5.551115123125783e-16,
|
|
203
|
+
"max_err_P": 4.440892098500626e-16,
|
|
204
|
+
"max_err_Q": 3.3306690738754696e-16
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"site": "left_knee_mimic",
|
|
208
|
+
"body_old": "tibia_l",
|
|
209
|
+
"b14": 62,
|
|
210
|
+
"b14_name": "tibia_l",
|
|
211
|
+
"pos": [
|
|
212
|
+
1.7949924073108143e-16,
|
|
213
|
+
-6.691643951779404e-17,
|
|
214
|
+
-9.0423339926422e-17
|
|
215
|
+
],
|
|
216
|
+
"quat": [
|
|
217
|
+
0.9975666948000462,
|
|
218
|
+
-0.005119189982353875,
|
|
219
|
+
-0.06941652991575117,
|
|
220
|
+
-0.003978529136687975
|
|
221
|
+
],
|
|
222
|
+
"spread": 7.771561172376096e-16,
|
|
223
|
+
"max_err_P": 5.551115123125783e-16,
|
|
224
|
+
"max_err_Q": 6.661338147750939e-16
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"site": "left_ankle_mimic",
|
|
228
|
+
"body_old": "talus_l",
|
|
229
|
+
"b14": 63,
|
|
230
|
+
"b14_name": "talus_l",
|
|
231
|
+
"pos": [
|
|
232
|
+
5.0011213156424874e-17,
|
|
233
|
+
-3.128898778590592e-16,
|
|
234
|
+
-2.9592155288886903e-16
|
|
235
|
+
],
|
|
236
|
+
"quat": [
|
|
237
|
+
0.9999999999999999,
|
|
238
|
+
7.112366251504909e-17,
|
|
239
|
+
0.0,
|
|
240
|
+
8.326672684688674e-17
|
|
241
|
+
],
|
|
242
|
+
"spread": 1.0274165517734856e-15,
|
|
243
|
+
"max_err_P": 9.575673587391975e-16,
|
|
244
|
+
"max_err_Q": 5.551115123125783e-16
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"site": "left_toes_mimic",
|
|
248
|
+
"body_old": "toes_l",
|
|
249
|
+
"b14": 65,
|
|
250
|
+
"b14_name": "toes_l",
|
|
251
|
+
"pos": [
|
|
252
|
+
4.137547792515669e-17,
|
|
253
|
+
-3.7702010210257793e-16,
|
|
254
|
+
-2.533623781848e-16
|
|
255
|
+
],
|
|
256
|
+
"quat": [
|
|
257
|
+
0.9999999999999998,
|
|
258
|
+
7.134050294954619e-17,
|
|
259
|
+
-1.3877787807814457e-17,
|
|
260
|
+
1.249000902703301e-16
|
|
261
|
+
],
|
|
262
|
+
"spread": 1.1789569707612258e-15,
|
|
263
|
+
"max_err_P": 1.1102230246251565e-15,
|
|
264
|
+
"max_err_Q": 6.661338147750939e-16
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"site": "right_hip_mimic",
|
|
268
|
+
"body_old": "femur_r",
|
|
269
|
+
"b14": 56,
|
|
270
|
+
"b14_name": "femur_r",
|
|
271
|
+
"pos": [
|
|
272
|
+
-2.5854007489137302e-17,
|
|
273
|
+
-1.0734069569494286e-16,
|
|
274
|
+
1.8113254345763995e-17
|
|
275
|
+
],
|
|
276
|
+
"quat": [
|
|
277
|
+
1.0,
|
|
278
|
+
2.229119666630197e-16,
|
|
279
|
+
-1.3877787807814457e-17,
|
|
280
|
+
-2.0816681711721685e-17
|
|
281
|
+
],
|
|
282
|
+
"spread": 5.577135975265435e-16,
|
|
283
|
+
"max_err_P": 4.440892098500626e-16,
|
|
284
|
+
"max_err_Q": 6.661338147750939e-16
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"site": "right_knee_mimic",
|
|
288
|
+
"body_old": "tibia_r",
|
|
289
|
+
"b14": 57,
|
|
290
|
+
"b14_name": "tibia_r",
|
|
291
|
+
"pos": [
|
|
292
|
+
-3.766793150269113e-17,
|
|
293
|
+
-2.266355288104523e-16,
|
|
294
|
+
-1.851202244581025e-16
|
|
295
|
+
],
|
|
296
|
+
"quat": [
|
|
297
|
+
0.9975666948000463,
|
|
298
|
+
0.005119189982354258,
|
|
299
|
+
0.06941652991575119,
|
|
300
|
+
-0.003978529136688065
|
|
301
|
+
],
|
|
302
|
+
"spread": 1.0753893398233159e-15,
|
|
303
|
+
"max_err_P": 8.881784197001252e-16,
|
|
304
|
+
"max_err_Q": 5.551115123125783e-16
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"site": "right_ankle_mimic",
|
|
308
|
+
"body_old": "talus_r",
|
|
309
|
+
"b14": 58,
|
|
310
|
+
"b14_name": "talus_r",
|
|
311
|
+
"pos": [
|
|
312
|
+
-7.983856961282811e-17,
|
|
313
|
+
-2.3366770561190903e-16,
|
|
314
|
+
-3.5480777755062727e-16
|
|
315
|
+
],
|
|
316
|
+
"quat": [
|
|
317
|
+
1.0,
|
|
318
|
+
2.229119666630197e-16,
|
|
319
|
+
2.7755575615628914e-17,
|
|
320
|
+
6.938893903907228e-18
|
|
321
|
+
],
|
|
322
|
+
"spread": 1.2643572149880734e-15,
|
|
323
|
+
"max_err_P": 1.3322676295501878e-15,
|
|
324
|
+
"max_err_Q": 6.661338147750939e-16
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"site": "right_toes_mimic",
|
|
328
|
+
"body_old": "toes_r",
|
|
329
|
+
"b14": 60,
|
|
330
|
+
"b14_name": "toes_r",
|
|
331
|
+
"pos": [
|
|
332
|
+
-2.3489538564931953e-17,
|
|
333
|
+
-1.880723228394087e-16,
|
|
334
|
+
-4.171948647174534e-16
|
|
335
|
+
],
|
|
336
|
+
"quat": [
|
|
337
|
+
1.0,
|
|
338
|
+
1.682681771697503e-16,
|
|
339
|
+
1.3877787807814457e-17,
|
|
340
|
+
-6.938893903907228e-18
|
|
341
|
+
],
|
|
342
|
+
"spread": 1.3050975545358006e-15,
|
|
343
|
+
"max_err_P": 1.3322676295501878e-15,
|
|
344
|
+
"max_err_Q": 6.661338147750939e-16
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"root": {
|
|
348
|
+
"body_old": "Full Body",
|
|
349
|
+
"b14": 1,
|
|
350
|
+
"b14_name": "Full Body",
|
|
351
|
+
"pos": [
|
|
352
|
+
0.0,
|
|
353
|
+
0.0,
|
|
354
|
+
0.0
|
|
355
|
+
],
|
|
356
|
+
"quat": [
|
|
357
|
+
1.0,
|
|
358
|
+
0.0,
|
|
359
|
+
-4.363913744254155e-18,
|
|
360
|
+
0.0
|
|
361
|
+
],
|
|
362
|
+
"spread": 2.220446049250313e-16
|
|
363
|
+
},
|
|
364
|
+
"monitor_constants": "float64",
|
|
365
|
+
"worst_site_err": 1.887379141862766e-15
|
|
366
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""env14's count of the calls that still reach the OLD engine once env14 is installed (ENGINE_UNIFY_PLAN.md item 3.0.1; the review, 11-09).
|
|
2
|
+
|
|
3
|
+
Before this, count["old_sim"] was set to 0 and never incremented, so t4_collect.py's `old_sim == 0` checked nothing. E0_ENGINE14=1 replaces
|
|
4
|
+
only env.sim.step. These routes into the old engine remain, each counted here by a wrapper that makes the same call with the same arguments
|
|
5
|
+
and adds an integer:
|
|
6
|
+
old_act env._activation: the old sim's activate, bound at the env's construction (gpu_fullbody_vec_env.py:134), before env14 installs;
|
|
7
|
+
rew14_hook replaces it with an identity under E0_REW14_SKIP_ENV_ACT=1, and then it is never called
|
|
8
|
+
old_contact contact_force through env14's Sim.__getattr__ (gpu_fullbody_vec_env.py:759, 882, 1333; rew14_hook's cfnorm) and the env
|
|
9
|
+
module's gpu_bridge.contact_force_gpu (:1013, :1048)
|
|
10
|
+
old_equil the old mtu_gpu.equilibrate_fibers through env._myoleg_gpu (:699); with E0_ENV14_EQUIL14 the proxy replaces it with env14's
|
|
11
|
+
own, which is not counted
|
|
12
|
+
old_other any other callable reached through Sim.__getattr__, env._myoleg_gpu or the env module's gpu_bridge (name kept in .names)
|
|
13
|
+
old_sim their sum: every call into the old engine after the install
|
|
14
|
+
Not counted, by design: the parser and the model dims (`_dnmodel_json`, `dims`, `muscle_l_opts`, `_load_lopt`: no engine work), attribute reads
|
|
15
|
+
(`sim.path`: kept in .reads), and the construction itself (the env is built and its first reset equilibrated on the old engine before env14
|
|
16
|
+
exists: count["old_construct"] = 1 records that, always).
|
|
17
|
+
Torch-free, so its test (test_old_count.py) runs anywhere."""
|
|
18
|
+
import collections
|
|
19
|
+
|
|
20
|
+
PARSE = frozenset({"_dnmodel_json", "dims", "muscle_l_opts", "_load_lopt"})
|
|
21
|
+
KEYS = ("old_act", "old_contact", "old_equil", "old_other", "old_sim")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class OldCount:
|
|
25
|
+
def __init__(self, count):
|
|
26
|
+
self.count = count
|
|
27
|
+
for k in KEYS:
|
|
28
|
+
count[k] = 0
|
|
29
|
+
count["old_construct"] = 1
|
|
30
|
+
self.names = collections.Counter() # every counted call, by route and name
|
|
31
|
+
self.reads = collections.Counter() # non-callable attributes read through a forward
|
|
32
|
+
|
|
33
|
+
def _hit(self, key, name):
|
|
34
|
+
self.count[key] += 1
|
|
35
|
+
self.count["old_sim"] += 1
|
|
36
|
+
self.names[name] += 1
|
|
37
|
+
|
|
38
|
+
def wrap(self, key, name, fn):
|
|
39
|
+
def counted(*a, **kw):
|
|
40
|
+
self._hit(key, name)
|
|
41
|
+
return fn(*a, **kw)
|
|
42
|
+
return counted
|
|
43
|
+
|
|
44
|
+
def forward(self, route, obj, name):
|
|
45
|
+
"""getattr(obj, name) as a forward does it, with a callable wrapped so that a call counts"""
|
|
46
|
+
v = getattr(obj, name)
|
|
47
|
+
if not callable(v):
|
|
48
|
+
self.reads[f"{route}.{name}"] += 1
|
|
49
|
+
return v
|
|
50
|
+
if name in PARSE:
|
|
51
|
+
return v
|
|
52
|
+
key = "old_contact" if name.startswith("contact_force") else "old_equil" if name == "equilibrate_fibers" else "old_other"
|
|
53
|
+
return self.wrap(key, f"{route}.{name}", v)
|
|
54
|
+
|
|
55
|
+
def proxy(self, route, obj):
|
|
56
|
+
"""a stand-in for a module or object whose every callable attribute counts (attributes set on the proxy itself are not counted)"""
|
|
57
|
+
oc = self
|
|
58
|
+
|
|
59
|
+
class Proxy:
|
|
60
|
+
def __getattr__(self, name):
|
|
61
|
+
return oc.forward(route, obj, name)
|
|
62
|
+
return Proxy()
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def install(env, e14):
|
|
66
|
+
"""wrap the env's routes into the old engine; called by Env14.__init__ after it keeps env.sim as old_sim. Returns the OldCount."""
|
|
67
|
+
oc = OldCount(e14.count)
|
|
68
|
+
env._activation = oc.wrap("old_act", "env._activation", env._activation)
|
|
69
|
+
env._myoleg_gpu = oc.proxy("mtu_gpu", env._myoleg_gpu)
|
|
70
|
+
import sys
|
|
71
|
+
mod = sys.modules.get(type(env).__module__)
|
|
72
|
+
if mod is not None and hasattr(mod, "_bridge"):
|
|
73
|
+
# the env module's gpu_bridge handle (a module global): the original is kept once, so a second install re-points the proxy
|
|
74
|
+
# to its own count instead of nesting proxies
|
|
75
|
+
orig = getattr(mod, "_bridge_unproxied", None) or mod._bridge
|
|
76
|
+
mod._bridge_unproxied = orig
|
|
77
|
+
mod._bridge = oc.proxy("gpu_bridge", orig)
|
|
78
|
+
return oc
|