Added live arm joints

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 18:37:10 +09:00
co-authored by Claude Opus 5.5
parent 9a31386b6f
commit da4183539d
+10
View File
@@ -1381,6 +1381,16 @@ def go_point(body: PointBody):
return {"ok": True} return {"ok": True}
@app.get("/arm/joints", tags=["arm"], summary="Joints (deg) only: one controller read (~10 ms), for a live 3D arm "
"(the Lumi app asks it 5 times a second)")
def arm_joints():
try:
d = arm.cmd("get_data")
except (ConnectionError, OSError) as e:
raise HTTPException(502, f"arm controller: {e}")
return {"joints": [round(v, 2) for v in d.get("joint_actual_position", [])]}
@app.get("/arm/state", tags=["arm"], summary="Joints (deg), TCP (mm, deg), power, enable, program") @app.get("/arm/state", tags=["arm"], summary="Joints (deg), TCP (mm, deg), power, enable, program")
def arm_state(): def arm_state():
d = arm.cmd("get_data") d = arm.cmd("get_data")