Keep XYZAC tool motion smooth and expose rotary DRO values

This commit is contained in:
2026-08-30 18:51:53 +08:00
parent c015709d26
commit 99fe5a4151
4 changed files with 104 additions and 35 deletions

View File

@@ -89,7 +89,16 @@ function projection(result: Record<string, unknown>, message: MessageEnvelope, p
program: (result.program as Record<string, unknown>) ?? previous.snapshot.program,
motion: {
...previous.snapshot.motion,
axes: [Number(pose.x ?? previous.snapshot.motion?.axes?.[0] ?? 0), Number(pose.y ?? previous.snapshot.motion?.axes?.[1] ?? 0), Number(pose.z ?? previous.snapshot.motion?.axes?.[2] ?? 0)],
// Keep the XYZAC axis vector intact on every motion delta. Older
// projection code rebuilt only XYZ, which made A/C disappear from
// consumers that read the canonical motion array.
axes: [
Number(pose.x ?? previous.snapshot.motion?.axes?.[0] ?? 0),
Number(pose.y ?? previous.snapshot.motion?.axes?.[1] ?? 0),
Number(pose.z ?? previous.snapshot.motion?.axes?.[2] ?? 0),
Number(pose.a ?? previous.snapshot.motion?.axes?.[3] ?? 0),
Number(pose.c ?? previous.snapshot.motion?.axes?.[4] ?? 0),
],
joints,
},
wasm_motion: (result.wasm_motion as Record<string, unknown>) ?? previous.snapshot.wasm_motion,