"""Apply contact settings selected by the matched CPU/GPU short replay probe.""" from pathlib import Path import json,xml.etree.ElementTree as ET O=Path(__file__).resolve().parents[1]/'output/spider_dynamics_fix_20260915';p=O/'datasets/processed/current/l20/bimanual/boxes/scene_act.xml';tree=ET.parse(p) for g in tree.findall('.//geom'): g.set('solimp','.9 .95 .001 .5 2');g.set('solref','.02 1') if g.get('contype') in ['1','2']:g.set('margin','.004');g.set('gap','.002') tree.write(p) s=json.loads((O/'physics_parameters.json').read_text());s.update(contact_solimp=[.9,.95,.001,.5,2],contact_solref=[.02,1],contact_activation_distance_m=.002,note='Contact regularization and 2 mm activation distance selected from GPU/CPU short replay. Simulation parameters, not measured hardware.');(O/'physics_parameters.json').write_text(json.dumps(s,indent=2))