Skip to content

feat: add the LiteGrip C++ SDK - #5

Merged
thetooler merged 2 commits into
mainfrom
feat/cpp-sdk-source
Sep 28, 2026
Merged

thetooler merged 2 commits into
mainfrom
feat/cpp-sdk-source

Conversation

@thetooler

Copy link
Copy Markdown
Contributor

Summary

Lands the LiteGrip C++ SDK source: until now this repository held only the
bootstrapped standards. This is layer 1 of the litegrip stack — the
ROS-agnostic library that litegrip_ros2_control links, and the layer
litegrip_moveit_config sits above.

The suite starts running on every pull request from here on. Merging publishes
as a minor (v0.0.0 -> v0.1.0). Nothing consumes this repository yet, so no
existing consumer breaks.

Changes

  • Add the library, headers and sources: the SocketCAN transport, the Damiao DM4310 MIT protocol codec, GripperBus, the LiteGrip high-level API, the SafetyGuard red-line gate, the calibration and json layer, and the 200 Hz ControlLoop.
  • Add the 12-executable CTest suite, including the parity harness that drives the real Python SDK and checks the exact bytes it produces (test/generate_golden.py).
  • Add CMake packaging for both consumers: find_package(litegrip_cpp) plus pkg-config, and a plain-cmake package.xml so a ROS workspace builds it without ament.
  • Add the shipped calibration data under calibration/, which the read-only fallback in load_calibration() needs.
  • Replace the placeholder README with the SDK's own documentation, and add its Chinese translation.
  • Update .github/workflows/ci.yml to configure, build and test the real toolchain in place of the documentation-only placeholder, as the workflow instructed once source landed.
  • Drop the emoji from two README headings and fix the heading-increment, blank-line and dead-path problems the real README carried, so the markdownlint gate passes.

Testing

Fresh out-of-tree Release build, exactly as CI runs it:

cmake -S . -B /tmp/lg-ci-build -DCMAKE_BUILD_TYPE=Release
cmake --build /tmp/lg-ci-build -j
ctest --test-dir /tmp/lg-ci-build --output-on-failure

Result: 12/12 tests pass, 0 failures, 2.60 s.

Repository lint, under the committed .markdownlint.json:

npx --yes markdownlint-cli2@0.23.3 "README.md" "README_zh.md"

Result: 0 issues in 2 files.

No hardware or CAN interface is required: test_transport is deliberately
non-transmitting, and the remaining tests cover behaviour that must hold while
disconnected. Motion, calibration and the transport send/receive path still
need the real device and are not covered here.

Issues

No tracking issue — the repository has none open. Nothing is closed by this
pull request.

thetooler added 2 commits September 28, 2026 16:17
Add the ROS-agnostic C++ SDK for the LiteGrip adaptive two-finger
gripper: the SocketCAN transport, the Damiao DM4310 MIT protocol codec,
GripperBus, the LiteGrip high-level API, the SafetyGuard red-line gate,
the calibration and json layer, and the 200 Hz ControlLoop.

The library is C++17 with no third-party dependencies beyond the stdlib,
pthread and the Linux SocketCAN headers. It installs both into a ROS
workspace (plain-cmake package.xml) and into a normal prefix
(find_package + pkg-config), so ros2_control can link it without ament.

Replace the placeholder README with the SDK's own documentation and add
its Chinese translation.

Update the CI gate to build and run the real toolchain instead of the
documentation-only placeholder, as the workflow instructed once source
landed. The suite needs no hardware: the transport test is deliberately
non-transmitting, and the rest cover behaviour that must hold while
disconnected.
test_calibration wrote its fixtures with std::fopen, which creates the file
but not its parent directory. The suite therefore passed only where an
earlier run had already left /tmp/litegrip_calib_test behind, and failed
with "FAIL: write fixture" on a fresh checkout. CI caught it.

Create the directory in main, as test_safety already does, and build the
fixture paths from that one constant. No library code changes.
@thetooler
thetooler merged commit 5cf2f5d into main Sep 28, 2026
1 check passed
@thetooler
thetooler deleted the feat/cpp-sdk-source branch September 28, 2026 08:28
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant