Skip to content

Use a private netft-cpp core snapshot - #9

Merged
han-xudong merged 25 commits into
mainfrom
feat/netft-cpp-core-snapshot
Jul 23, 2026
Merged

Use a private netft-cpp core snapshot#9
han-xudong merged 25 commits into
mainfrom
feat/netft-cpp-core-snapshot

Conversation

@han-xudong

@han-xudong han-xudong commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Replace the original ROS-specific Net F/T runtime with a private, byte-identical snapshot of netft-cpp v0.1.2 and adapt the ROS 1, ROS 2, diagnostic, CLI, and ros2_control layers to it.

The snapshot comes from netft/netft-cpp tag v0.1.2, commit bb7df8d211ecc36ebc1434da3686897d7b3d73cc. It remains in the upstream netft namespace. The core is built as an internal static target and is not installed, exported, discovered, or fetched as a separate dependency. This release also adopts Apache-2.0 for the complete repository, matching the upstream core.

This also changes the default runtime behavior to read calibration from the sensor when available and converts native Net F/T samples to ROS SI units (N, N*m). Manual counts-per-force and counts-per-torque settings remain available when sensor calibration is disabled.

Related issue

None.

Validation

  • pixi run unit
  • Relevant ROS build and smoke tests
  • Documentation-only change; runtime tests are not applicable

Tested ROS distributions and commands:

  • ROS-neutral: pixi run -e test core-test (14/14 passed) and pixi run unit (143 passed, 1 skipped).
  • Toolchain compatibility: the fallback path passed 14/14 core tests with GCC 9.5, while the production ros2_control DSO passed its private-symbol audit with GCC 13.3.
  • ROS Noetic: pixi run -e noetic build and pixi run -e noetic smoke.
  • ROS 2 Humble: pixi run -e humble build, pixi run -e humble smoke, and pixi run -e humble ros2-control-smoke.
  • ROS 2 Jazzy: pixi run -e jazzy build, pixi run -e jazzy smoke, and pixi run -e jazzy ros2-control-smoke.
  • The broader local ROS 2 matrix also passed on Kilted and Lyrical. Rolling passed all 188 package tests after the final multi-sensor test stabilization.
  • Production and installed ros2_control plugin audits found no exported private core/support symbols, no test hooks, and no external Net F/T library dependency.
  • A no-.git git archive source tree passed the manifest audit.

Checklist

  • The change is focused and contains no unrelated formatting or refactoring.
  • Behavior changes include appropriate tests.
  • Commands, parameters, interfaces, and safety guidance are documented when affected.
  • Repository content is written in English.
  • No physical sensor was used, or the test was explicitly authorized and is described below.
  • No software bias was issued, or it was authorized and performed while the sensor was stationary, unloaded, and safe.

Hardware validation, if any:

No physical sensor was used. All network integration tests used loopback fake sensors, and no software bias command was issued.

Summary by CodeRabbit

  • New Features

    • Added automatic sensor calibration discovery over HTTP, with conversion to Newtons and Newton-metres.
    • Added manual calibration overrides and configurable HTTP connection/timeouts.
    • Updated ROS 1, ROS 2, ros2_control, launch files, and command-line checks to support the new settings.
    • Improved diagnostics, recovery behavior, status reporting, and structured check results.
    • Added broader compatibility for Noetic/GCC 9 and ROS 2 integrations.
  • Documentation

    • Updated configuration, calibration, architecture, licensing, and release documentation.
  • Bug Fixes

    • Improved reconnect, timeout, fault handling, and calibration-change behavior.

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Continuous integration and repository automation driver Driver implementation and runtime behavior ros2-control ros2_control integration tests Test coverage and test infrastructure dependencies Dependency updates labels Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 21fc6422-a08f-4e3b-8f54-de6eb3a4b5e3

📥 Commits

Reviewing files that changed from the base of the PR and between f7eeb31 and 3377f6e.

📒 Files selected for processing (11)
  • CHANGELOG.rst
  • CMakeLists.txt
  • CONTRIBUTING.md
  • LICENSE
  • README.md
  • package.xml
  • pixi.toml
  • test/cpp/test_hardware_interface.cpp
  • test/cpp/test_ros1_node.cpp
  • test/support/fake_sensor.py
  • test/test_manifest.py
💤 Files with no reviewable changes (1)
  • package.xml
🚧 Files skipped from review as they are similar to previous changes (7)
  • pixi.toml
  • CHANGELOG.rst
  • test/support/fake_sensor.py
  • test/test_manifest.py
  • test/cpp/test_ros1_node.cpp
  • test/cpp/test_hardware_interface.cpp
  • CMakeLists.txt

📝 Walkthrough

Walkthrough

This release replaces the legacy driver API with a vendored netft core, adding HTTP calibration discovery, recovery-aware streaming, SI conversion, ROS adapter migration, updated build/install wiring, expanded test infrastructure, and integration validation.

Changes

NetFT core and build

Layer / File(s) Summary
Core contracts and runtime
src/core/include/netft/*, src/core/src/*
Adds the netft::Client API, configuration validation, UDP transport, protocol decoding, sequence tracking, status handling, HTTP/XML discovery, calibration revisions, recovery, and fault management.
ROS adapter boundary
src/ros/*, src/netft_hardware_interface.cpp, src/ros1_node.cpp, src/ros2_node.cpp
Migrates ROS components to netft types, converts samples to SI units before publication or realtime buffering, and adds HTTP/calibration parameters and diagnostics.
Build and packaging
CMakeLists.txt, package.xml, pixi.toml, .github/workflows/coverage.yml
Splits netft_core from netft_ros_support, adds libcurl dependencies, updates installation targets, and adds coverage prerequisites.

Validation and integration

Layer / File(s) Summary
Core and ROS tests
test/core/*, test/cpp/*
Adds coverage for discovery, streaming, recovery, lifecycle, diagnostics, validation, unit conversion, adapter mapping, and ros2_control behavior.
Integration fixtures and audits
test/integration/*, test/support/fake_sensor.py
Adds HTTP-port orchestration, symbol/export audits, private-core install checks, structured smoke-test assertions, and fake-sensor calibration serving.
Configuration and documentation
README.md, docs/architecture.md, config/*, launch/*, urdf/*, CONTRIBUTING.md
Documents automatic and manual calibration, HTTP configuration, core provenance, licensing, and updated launch/Xacro parameter forwarding.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • netft/ros-netft#3: Both changes update the C++ coverage workflow, including core coverage setup and dependency installation.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.37% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: replacing the runtime with a private netft-cpp core snapshot.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/netft-cpp-core-snapshot

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CMakeLists.txt`:
- Around line 11-12: Update the CURL requirement in the CMake package
configuration from 7.62 to a minimum of 7.63, ensuring builds using
CURLOPT_CURLU satisfy the dependency required by discovery.cpp.

In `@src/core/src/detail/posix_transport.cpp`:
- Around line 98-108: Update the EINTR retry loop around ::poll in receive() to
track elapsed time and recompute the remaining timeout before each retry, rather
than reusing the original timeout_milliseconds(timeout). Return 0 once the
caller-specified timeout has been exhausted, while preserving the existing error
handling for non-EINTR failures.

In `@test/cpp/test_ros1_node.cpp`:
- Around line 32-37: Initialize ROS at the beginning of
MapsEveryAdapterParameterWithManualCalibration with an anonymous node name,
before calling ros::master::check() or constructing the private NodeHandle,
mirroring the initialization in the first test so it runs independently.

In `@test/support/fake_sensor.py`:
- Around line 43-44: Rename the log_message method’s format parameter to a
non-conflicting name while preserving its positional signature and the existing
no-op behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 69ebc753-610d-4be8-8296-ebec5545f933

📥 Commits

Reviewing files that changed from the base of the PR and between 8f06673 and 4f66f52.

⛔ Files ignored due to path filters (1)
  • pixi.lock is excluded by !**/*.lock
📒 Files selected for processing (101)
  • .github/workflows/coverage.yml
  • CHANGELOG.rst
  • CMakeLists.txt
  • CONTRIBUTING.md
  • README.md
  • config/netft_ros1.yaml
  • config/netft_ros2.yaml
  • docs/architecture.md
  • include/netft_driver/client.hpp
  • include/netft_driver/status.hpp
  • include/netft_driver/types.hpp
  • launch/netft.launch
  • launch/netft.launch.py
  • launch/netft_ros2_control.launch.py
  • package.xml
  • pixi.toml
  • src/check_main.cpp
  • src/client.cpp
  • src/core/LICENSE
  • src/core/UPSTREAM
  • src/core/include/netft/client.hpp
  • src/core/include/netft/discovery.hpp
  • src/core/include/netft/export.hpp
  • src/core/include/netft/status.hpp
  • src/core/include/netft/types.hpp
  • src/core/src/client.cpp
  • src/core/src/detail/client_impl.cpp
  • src/core/src/detail/client_impl.hpp
  • src/core/src/detail/fault_latch.cpp
  • src/core/src/detail/fault_latch.hpp
  • src/core/src/detail/posix_transport.cpp
  • src/core/src/detail/posix_transport.hpp
  • src/core/src/detail/protocol.cpp
  • src/core/src/detail/protocol.hpp
  • src/core/src/detail/sequence.cpp
  • src/core/src/detail/sequence.hpp
  • src/core/src/detail/xml_config.cpp
  • src/core/src/detail/xml_config.hpp
  • src/core/src/discovery.cpp
  • src/core/src/status.cpp
  • src/core/src/types.cpp
  • src/netft_hardware_interface.cpp
  • src/protocol.cpp
  • src/ros/adapter_config.hpp
  • src/ros/diagnostics.cpp
  • src/ros/diagnostics.hpp
  • src/ros/ros2_control_compat.hpp
  • src/ros/ros2_control_test_access.hpp
  • src/ros/unit_conversion.cpp
  • src/ros/unit_conversion.hpp
  • src/ros1_node.cpp
  • src/ros2_node.cpp
  • src/status.cpp
  • test/core/CMakeLists.txt
  • test/core/support/fake_http_server.cpp
  • test/core/support/fake_http_server.hpp
  • test/core/support/fake_sensor.cpp
  • test/core/support/fake_sensor.hpp
  • test/core/test_client_lifecycle.cpp
  • test/core/test_client_recovery.cpp
  • test/core/test_client_stream.cpp
  • test/core/test_discovery.cpp
  • test/core/test_fault_latch.cpp
  • test/core/test_protocol.cpp
  • test/core/test_sequence.cpp
  • test/core/test_status.cpp
  • test/core/test_types.cpp
  • test/cpp/CMakeLists.txt
  • test/cpp/netft_hardware_test_plugins.xml
  • test/cpp/support/fake_sensor.cpp
  • test/cpp/support/fake_sensor.hpp
  • test/cpp/support/ros2_control_test_access.cpp
  • test/cpp/test_adapter_config.cpp
  • test/cpp/test_check.cpp
  • test/cpp/test_client.cpp
  • test/cpp/test_diagnostics.cpp
  • test/cpp/test_hardware_interface.cpp
  • test/cpp/test_protocol.cpp
  • test/cpp/test_ros1_node.cpp
  • test/cpp/test_ros2_node.cpp
  • test/cpp/test_status.cpp
  • test/cpp/test_types.cpp
  • test/cpp/test_unit_conversion.cpp
  • test/integration/audit_ros2_control_symbols.sh
  • test/integration/build_package.sh
  • test/integration/fake_sensor_process.py
  • test/integration/ros1_smoke.sh
  • test/integration/ros2_control_isolation_test.sh
  • test/integration/ros2_control_smoke.sh
  • test/integration/ros2_smoke.sh
  • test/integration/ros_graph_assertions.py
  • test/support/fake_sensor.py
  • test/test_config_validation.py
  • test/test_fake_sensor.py
  • test/test_gitignore.py
  • test/test_launch_validation.py
  • test/test_manifest.py
  • test/test_ros_graph_assertions.py
  • test/test_urdf_validation.py
  • test/test_workflow_validation.py
  • urdf/netft.ros2_control.xacro
💤 Files with no reviewable changes (13)
  • test/cpp/test_protocol.cpp
  • test/cpp/test_status.cpp
  • test/cpp/test_types.cpp
  • include/netft_driver/client.hpp
  • src/client.cpp
  • test/cpp/test_client.cpp
  • include/netft_driver/types.hpp
  • src/status.cpp
  • src/protocol.cpp
  • src/ros/ros2_control_compat.hpp
  • test/cpp/support/fake_sensor.hpp
  • include/netft_driver/status.hpp
  • test/cpp/support/fake_sensor.cpp

Comment thread CMakeLists.txt Outdated
Comment thread src/core/src/detail/posix_transport.cpp
Comment thread test/cpp/test_ros1_node.cpp
Comment thread test/support/fake_sensor.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/compat/xml_config.cpp (1)

15-274: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Share the XML tokenizer with the canonical parser
src/compat/xml_config.cpp still duplicates the XML tag-scanning and validation logic from src/core/src/detail/xml_config.cpp; only parse_positive_count needs the compat-specific path. Moving extract_required_fields, find_tag_end, and the markup checks into a shared unit would reduce drift risk in the calibration parser.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compat/xml_config.cpp` around lines 15 - 274, The XML scanning and
validation logic in extract_required_fields, find_tag_end, and their associated
markup helpers duplicates the canonical parser. Move or reuse these symbols
through a shared tokenizer/parser unit, updating both compat and canonical
parsing paths to use it, while retaining parse_positive_count as the
compat-specific implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/compat/xml_config.cpp`:
- Around line 15-274: The XML scanning and validation logic in
extract_required_fields, find_tag_end, and their associated markup helpers
duplicates the canonical parser. Move or reuse these symbols through a shared
tokenizer/parser unit, updating both compat and canonical parsing paths to use
it, while retaining parse_positive_count as the compat-specific implementation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42178889-878e-4cba-b037-195a69f77c6c

📥 Commits

Reviewing files that changed from the base of the PR and between 4f66f52 and 3a60dc6.

📒 Files selected for processing (12)
  • CHANGELOG.rst
  • CMakeLists.txt
  • CONTRIBUTING.md
  • README.md
  • docs/architecture.md
  • src/compat/xml_config.cpp
  • src/netft_hardware_interface.cpp
  • test/core/CMakeLists.txt
  • test/core/test_discovery.cpp
  • test/cpp/support/ros2_control_test_access.cpp
  • test/cpp/test_check.cpp
  • test/integration/audit_ros2_control_symbols.sh
💤 Files with no reviewable changes (1)
  • test/integration/audit_ros2_control_symbols.sh
🚧 Files skipped from review as they are similar to previous changes (10)
  • CHANGELOG.rst
  • test/core/CMakeLists.txt
  • test/cpp/support/ros2_control_test_access.cpp
  • CONTRIBUTING.md
  • README.md
  • docs/architecture.md
  • test/cpp/test_check.cpp
  • test/core/test_discovery.cpp
  • CMakeLists.txt
  • src/netft_hardware_interface.cpp

@han-xudong
han-xudong enabled auto-merge (squash) July 23, 2026 06:09
@han-xudong
han-xudong merged commit 33597c7 into main Jul 23, 2026
15 of 16 checks passed
@han-xudong
han-xudong deleted the feat/netft-cpp-core-snapshot branch July 23, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration and repository automation dependencies Dependency updates documentation Improvements or additions to documentation driver Driver implementation and runtime behavior ros2-control ros2_control integration tests Test coverage and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant