# armature per joint for cost-down DIY actuators (mirrors costdown/sim/run_all.py arm('diy'))
import json, harness1k as h
AJ = json.load(open("/workspace/asimov-guide/costdown/data/actuators.json")); A = AJ["actuators"]; jt = {j["role"]: j for j in AJ["joints"]}
SIDE = lambda r: "left" if r.startswith("left") else "right"
def jrow(j):
    if "ankle_pitch" in j: return jt[f"{SIDE(j)}_ankle_A"]
    if "ankle_roll" in j: return jt[f"{SIDE(j)}_ankle_B"]
    return jt[j]
ARM = {j: (2 if "ankle" in j else 1) * A[jrow(j)["diy"][-1]]["armature"] for j in h.J}
