From da4183539d1a36e097b856a995eca091c9cdf9e0 Mon Sep 17 00:00:00 2001 From: Cutshion Date: Wed, 18 Nov 2026 18:37:10 +0900 Subject: [PATCH] Added live arm joints Co-Authored-By: Claude Opus 5.5 --- api/server.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/server.py b/api/server.py index d869ace..c4c0b97 100644 --- a/api/server.py +++ b/api/server.py @@ -1381,6 +1381,16 @@ def go_point(body: PointBody): 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") def arm_state(): d = arm.cmd("get_data")