Skip to content

docs: correct the enable() lag figures and the 10 ms advice - #24

Merged
X-F-R merged 1 commit into
mainfrom
docs/enable-latency-figures
Oct 11, 2026
Merged

X-F-R merged 1 commit into
mainfrom
docs/enable-latency-figures

Conversation

@X-F-R

@X-F-R X-F-R commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Corrects the enable() latency figures this repository published in #23. Those numbers do
not reproduce, and the advice built on them — "wait a frame (or ~10 ms)" — is too short to
be safe.

Re-measured on the same arm (LiteArm 7-DOF, Litearm1.10.0-7J):

published in #23 measured now (n=11)
enable() returns 2.0-2.7 ms 2.0-3.1 ms
get_state().enabled turns true 7.0-7.8 ms 17.6-48.5 ms

An earlier run on the same unit did read 7.0-7.8 ms, so the lag is state-dependent. The
important half of #23 is unaffected and in fact stronger: a single read right after
enable() is always stale.

What changes is the prescription. 10 ms is shorter than the longest observed lag
(48.5 ms)
, so "wait a frame, then read" still returns a stale False. Every site now
says to poll until the flag flips.

disable() was checked at the same time and does not share the problem: it returns at
2.9-3.1 ms against 3.0-3.1 ms for enabled to read False. A single immediate read can
still return the frame from before the command — that is what made it look like the same
defect in the first place.

Changes

  • src/litearm/arm.py — enable() docstring: corrected figures; the advice is now to poll
    until the flag flips rather than to wait ~10 ms.
  • README.md, README.zh-CN.md — the same correction in the quick start section.
  • docs/DEVELOPER_GUIDE.md, docs/DEVELOPER_GUIDE.zh-CN.md — §5.1: corrected figures, and
    the disable() row now records that it has no long lag.

Documentation and one docstring. No behaviour change.

Testing

$ LITEARM_LIVE=1 python3 -m pytest -q
659 passed, 2 skipped

The measurement itself was taken on hardware, in both conditions — the first enable()
after connecting, and enable() after a disable() — so the figure is not an artefact of a
cold start:

冷启动 3 轮:  返回 2.8~3.1 ms | 首次为 True 41.7 / 48.9 / 48.1 ms
热循环 8 轮:  返回 2.8~3.0 ms | 首次为 True 17.6~48.5 ms

Issues

None — found while re-verifying these figures for a hardware test report. No tracking issue.

The 7.0-7.8 ms figure for get_state().enabled to turn true after enable()
does not reproduce. Re-measured on the same unit: return at 2.0-3.1 ms,
flag true at 17.6-48.5 ms (n=11, cold start and after disable alike). The
earlier run read 7.0-7.8 ms, so the lag is state-dependent -- but it is
always several status frames, never one.

That also makes the "wait a frame (or ~10 ms)" advice wrong: 10 ms is
shorter than the longest observed lag, so following it still reads a stale
False. Every site now says to poll until the flag flips.

disable() does not share the problem: return at 2.9-3.1 ms against 3.0-3.1
ms for enabled to read False. A single immediate read can still return the
frame from before the command, which is what made it look like the same
defect in the first place.

Docstring and documentation only, no behaviour change.
@X-F-R
X-F-R merged commit 5db9a15 into main Oct 11, 2026
2 checks passed
@X-F-R
X-F-R deleted the docs/enable-latency-figures branch October 11, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants