Skip to content

feat: drop single-axis bench support and add the litearm-cpp CLI - #11

Merged
X-F-R merged 4 commits into
mainfrom
feat/drop-1j-and-add-cli
Oct 12, 2026
Merged

X-F-R merged 4 commits into
mainfrom
feat/drop-1j-and-add-cli

Conversation

@X-F-R

@X-F-R X-F-R commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Delivers the litearm-cpp CLI the README already promised, fixes a shell-option leak in
the example runner, and syncs the SDK with the firmware's 2026-09-28 changes. The firmware
dropped the bench single-axis (1J) mode while the SDK still half-supported it, so this
removes 1J outright and makes connect() reject a -1J unit instead of running it through
a fallback mapping.

This breaks proto::BENCH_MODEL_AXIS, Arm::bench_model_axis, Arm::ik() on non-7-joint
arms, decode_status() on 1-joint frames, and connect() against -1J firmware for
consumers; publishes as a minor under this policy.

Changes

  • feat: add the litearm-cpp command-line binary (0efca49) — a real CLI (status, fw, enable, disable, reset, emergency, movej, home, tcp) behind the name the README already documented.
  • build: install the litearm-cpp CLI into the bindir (a66444a) — installs the binary so the documented command resolves.
  • fix: restore caller shell options in env.sh (7b39631) — env.sh leaked its set flags into the calling shell.
  • feat: drop support for the single-axis bench (1J) firmware (0251df6) — removes proto::BENCH_MODEL_AXIS, Arm::bench_model_axis, the 1-joint branch of decode_status(), and the fallback seed in Arm::ik(); connect() now rejects any variant other than 7J, empty included.
  • CMD_JOINT_FOLLOW (0x08) is implemented in the firmware with no SDK entry; it is now recorded in preexisting_gaps(), and the sentinel-table tests pin those tables to their real contents instead of asserting they are empty.
  • test_protocol_sync used to end in SKIP, and run_all discards the CHECK failures recorded before a skip — every assertion in it was silently thrown away. It now fails loudly, which is what exposed both the 1J state and the 0x08 gap; the two cannot be split into separate green commits for that reason.
  • Docs track the code: README, README.zh-CN and docs/DEVELOPER_GUIDE drop the 1J column from the status-frame length table and assert the bench mode is gone on both sides.

Testing

  • ./build.sh --clean --werror — 29/29 ctest, 100% tests passed, 0 tests failed out of 29.
  • ./build.sh --asan — 29/29 passed.
  • Every test binary run directly so the framework's own summary line is visible (28 binaries): 396 passed / 0 failed / 0 skipped. test_protocol_sync went from Skipped to Passed (12 passed / 0 skipped).
  • Real hardware (/dev/ttyACM1, firmware Litearm1.10.0-7J): 01_hello, 04_ik_tcp, 02_movej, 03_move_p pass; 06_cartesian and 07_vel_jitter_trace pass from an interior pose.
  • The cartesian examples fail with err=1 / err=4 when the arm starts at maximum reach (TCP Z = 0.7831, exactly where home parks it). Reproduced byte-identically on a clean main worktree, so it is a pose-dependent firmware-planner condition, not a regression from this branch.

Issues

None — no open issue covers this work.

Sourcing env.sh forced `set -euo pipefail` and never restored the
caller's options, so `set -e` leaked into interactive shells. A later
command returning non-zero (an example exiting 1 with no arm attached)
then closed the terminal.

Capture the options before enabling strict mode and restore them on
every exit path, including the cmake failure branches. errexit is
captured separately via `$-`: `set +o` reports it off inside command
substitution (bash disables errexit there), so `"$(set +o)"` alone loses
it.

The READMEs now point at `run_example.sh` (which sources env.sh itself)
instead of `source env.sh` by hand.
The README documents a `litearm-cpp` CLI for walk-up checks, but no such
executable was built. Add cli/main.cpp, a thin wrapper around the
existing litearm::main_impl that turns any LiteArmError/std::exception
into a one-line stderr message and exit code 1, and build it by default.

Also add a ctest smoke test that runs `litearm-cpp --help` (exit 0).
The READMEs say the SDK ships a small CLI, but `cmake --install` only
produced the library and its headers: the binary stayed in the build
tree, so an installed SDK offered no CLI at all. That matters for the
walk-up check use case, where the person at the machine has no source
checkout.

Install it into ${CMAKE_INSTALL_BINDIR}, deliberately without EXPORT —
an executable means nothing to a find_package consumer. List it in the
installed-files block of both READMEs, and pin the promise with a
packaging test that ties the CMake install rule to the documented path.
The 2026-09-28 firmware removed the bench single-axis (1J) mode, but the
SDK still carried everything for it: the `proto::BENCH_MODEL_AXIS`
constant, `Arm::bench_model_axis`, the 1-joint branch of
`decode_status()`, and the fallback seed in `Arm::ik()`. Remove all of
it. `connect()` now rejects any variant other than `7J`, an empty one
included, so a bench unit fails loudly at connect instead of being
half-supported.

`test_protocol_sync` could not see any of this: it ended in `SKIP`, and
`run_all` discards CHECK failures recorded before a skip, so every
assertion in it was silently thrown away. It now fails instead. That
exposed a second gap in the same place -- the firmware implements
`CMD_JOINT_FOLLOW` (0x08) with no SDK entry -- recorded in
`preexisting_gaps()` together with tests that pin the sentinel tables to
their real contents instead of asserting they are empty.

Breaks `proto::BENCH_MODEL_AXIS`, `Arm::bench_model_axis`, `Arm::ik()` on
non-7-joint arms, `decode_status()` on 1-joint frames, and `connect()`
against `-1J` firmware for consumers; publishes as a minor under this
policy.
@X-F-R X-F-R changed the title Feat/drop 1j and add cli feat: drop single-axis bench support and add the litearm-cpp CLI Oct 12, 2026
@X-F-R
X-F-R merged commit 8f8b825 into main Oct 12, 2026
1 check passed
@X-F-R
X-F-R deleted the feat/drop-1j-and-add-cli branch October 12, 2026 08:32
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Shipped in a release label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants