ae28d55f81
Source: RGB-D -> Dyn-HaMR -> L20 retargeting -> FoundationPose -> reference repair -> SPIDER, documented in docs/PIPELINE_LATEST.md and docs/SETUP_AND_WEIGHTS.md. Adds FoundationPose and nvdiffrast upstream snapshots, requirements/pipeline_venv.txt and the FoundationPose weight manifest/downloader. Assets (Git LFS): weights/ (WiLoR detector, HandFlow denoiser, UniDepth-L), FoundationPose checkpoints, HaMeR checkpoint, Dyn-HaMR HMP model and BMC constraints, L20 URDF/meshes, the 20260915_171525 D405 recording and the two box CADs. MANO models are not redistributed (third_party/hamer/_DATA/data/mano/README.txt). Environments, caches and run outputs excluded. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
23 lines
2.1 KiB
Python
23 lines
2.1 KiB
Python
"""Small full-clip CPU replay to choose bounded drive and contact settings before GPU rerun."""
|
|
import os
|
|
os.environ['OPENBLAS_NUM_THREADS']='1';os.environ['OMP_NUM_THREADS']='1'
|
|
from pathlib import Path
|
|
import json,time,numpy as np,mujoco
|
|
O=Path(__file__).resolve().parents[1]/'output/collision_fix_20260915';T=O/'datasets/processed/current/l20/bimanual/boxes';r=np.load(T/'0/trajectory_kinematic_act.npz');rq=r['qpos'];rv=r['qvel'];rc=r['ctrl'];a=np.load(O/'physics_attempt1/trajectory_mjwp_act.npz');ctrl=a['ctrl'].reshape(-1,56);allreports=[]
|
|
for name,drive,hard,sub in [('hard_only',1.,True,1),('bounded_drive',.1,True,1),('bounded_half_dt',.1,True,2),('softer_drive',.03,True,2)]:
|
|
m=mujoco.MjModel.from_xml_path(str(T/'scene_act.xml'));m.opt.iterations=80;m.opt.ls_iterations=50;m.opt.timestep=.0025/sub
|
|
if hard:
|
|
ids=np.flatnonzero(np.isin(m.geom_contype,[1,2]));m.geom_solimp[ids,:]=[.999,.9999,.0001,.5,2];m.geom_solref[ids,:]=[.005,1]
|
|
for i in range(m.nu-12):
|
|
n=m.actuator(i).name
|
|
if '_hand_pos_' in n:kp,kv,limit=500,30,200*drive
|
|
elif '_hand_rot_' in n:kp,kv,limit=15,2,20*drive
|
|
else:kp,kv,limit=4,.15,drive
|
|
m.actuator_gainprm[i,0]=kp;m.actuator_biasprm[i,1]=-kp;m.actuator_biasprm[i,2]=-kv;m.actuator_forcerange[i]=[-limit,limit]
|
|
d=mujoco.MjData(m);d.qpos[:]=rq[0];d.qvel[:]=rv[0];d.ctrl[:]=rc[0];mujoco.mj_step(m,d);pen=[];rows=[];start=time.monotonic()
|
|
for f,u in enumerate(ctrl):
|
|
d.ctrl[:]=u
|
|
for _ in range(sub):mujoco.mj_step(m,d)
|
|
mujoco.mj_kinematics(m,d);mujoco.mj_collision(m,d);cs=[c for c in d.contact if {int(m.geom_contype[c.geom[0]]),int(m.geom_contype[c.geom[1]])}=={1,2}];pen.append(max([max(0,-c.dist) for c in cs],default=0)*1000);rows.append(d.qpos.copy())
|
|
report=dict(name=name,drive_scale=drive,hard=hard,substeps=sub,max_penetration_mm=float(max(pen)),steps_over_1mm=int(np.sum(np.array(pen)>1)),finite=bool(np.isfinite(rows).all()),wall_s=time.monotonic()-start);allreports.append(report);np.savez_compressed(O/(name+'_cpu_probe.npz'),qpos=rows,max_penetration_mm=pen);(O/'dynamics_probe.json').write_text(json.dumps(allreports,indent=2));print(report,flush=True)
|