Repository navigation
feat: drop single-axis bench support and add the litearm-cpp CLI - #11
Merged
Merged
Conversation
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.
|
🎉 This PR is included in version 0.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delivers the
litearm-cppCLI the README already promised, fixes a shell-option leak inthe 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-1Junit instead of running it througha fallback mapping.
This breaks
proto::BENCH_MODEL_AXIS,Arm::bench_model_axis,Arm::ik()on non-7-jointarms,
decode_status()on 1-joint frames, andconnect()against-1Jfirmware forconsumers; 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.shleaked itssetflags into the calling shell.feat: drop support for the single-axis bench (1J) firmware(0251df6) — removesproto::BENCH_MODEL_AXIS,Arm::bench_model_axis, the 1-joint branch ofdecode_status(), and the fallback seed inArm::ik();connect()now rejects any variant other than7J, empty included.CMD_JOINT_FOLLOW(0x08) is implemented in the firmware with no SDK entry; it is now recorded inpreexisting_gaps(), and the sentinel-table tests pin those tables to their real contents instead of asserting they are empty.test_protocol_syncused to end inSKIP, andrun_alldiscards theCHECKfailures 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 the0x08gap; the two cannot be split into separate green commits for that reason.README,README.zh-CNanddocs/DEVELOPER_GUIDEdrop the1Jcolumn 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.test_protocol_syncwent from Skipped to Passed (12 passed / 0 skipped)./dev/ttyACM1, firmwareLitearm1.10.0-7J):01_hello,04_ik_tcp,02_movej,03_move_ppass;06_cartesianand07_vel_jitter_tracepass from an interior pose.err=1/err=4when the arm starts at maximum reach (TCP Z = 0.7831, exactly wherehomeparks it). Reproduced byte-identically on a cleanmainworktree, so it is a pose-dependent firmware-planner condition, not a regression from this branch.Issues
None — no open issue covers this work.