Skip to content

policy_client: producer + hardware-registry integration#254

Open
shantanuparab-tr wants to merge 2 commits into
06-15-policy-client-05-policy-clientfrom
06-15-policy-client-06-producer-integration
Open

policy_client: producer + hardware-registry integration#254
shantanuparab-tr wants to merge 2 commits into
06-15-policy-client-05-policy-clientfrom
06-15-policy-client-06-producer-integration

Conversation

@shantanuparab-tr

@shantanuparab-tr shantanuparab-tr commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Wires PolicyClient into the SDK runtime: a PolicyClientProducer (so the chunk-aligned command stream is a recordable source), registry placement so it constructs from config, and the small arm change the playback path needs.

Stack: PolicyClient stack, based on #248. Review bottom-up (#253 → here). This PR touches ArmConfig/TrossenArmComponent, which #248 also changes — see Related.

Changes

  • In include/trossen_sdk/hw/policy/policy_client_producer.{hpp} + src/hw/policy/policy_client_producer.cpp: PolicyClientProducer emitting the commanded rows (with joint_names in the stream metadata/features); REGISTER_PRODUCER / REGISTER_HARDWARE under "policy_client".
  • In include/trossen_sdk/hw/active_hardware_registry.hpp + src/hw/active_hardware_registry.cpp: registry placement so a policy_client hardware entry is constructed and configured from JSON.
  • In include/trossen_sdk/configuration/types/producers/producer_config.hpp: carry the policy-client producer config.
  • In include/trossen_sdk/configuration/types/hardware/arm_config.hpp + include/trossen_sdk/hw/arm/trossen_arm_component.{hpp,cpp}: add write_moving_time_s — the per-tick trajectory time passed to set_all_positions() in write_joint() (0 = apply immediately; non-zero smooths per-tick motion, on top of the Face EMA). Reconciled with control: per-episode hardware lifecycle driven by SessionManager #248's arm changes: built on control: per-episode hardware lifecycle driven by SessionManager #248's slew_time_s/staged_position/episode_lifecycle_enabled, adding only write_moving_time_s.
  • In tests/test_policy_client_producer.cpp, tests/test_active_hardware_registry.cpp, tests/CMakeLists.txt: producer metadata + registry construction coverage.
  • In cmake/policy_client.cmake: add policy_client_producer.cpp to the gated sources.

Test Plan

  • Builds cleanly with -DTROSSEN_SDK_ENABLE_POLICY_CLIENT=ON
  • Tests pass — test_policy_client_producer, test_active_hardware_registry, test_config
  • Lint passes (pre-commit run --all-files)
  • Hardware — exercised end-to-end via the live pi05 integration (see policy_client: stationary examples (openpi + lerobot) #255)

Breaking Changes

None. write_moving_time_s is optional (defaults to 0.0 = previous behavior). New gated sources behind TROSSEN_SDK_ENABLE_POLICY_CLIENT (default OFF).

Related

Based on #248. Depends on #248's ArmConfig rework — this PR's arm change is reconciled on top of slew_time_s/staging (adds only write_moving_time_s), so it must merge after #248. Stacked on #253; followed by #255.

shantanuparab-tr commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 6f2f314 to e213588 Compare June 15, 2026 16:56
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch 2 times, most recently from b1d4a71 to 6b1f894 Compare June 15, 2026 18:45
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from e213588 to 30f15ff Compare June 15, 2026 18:45
@shantanuparab-tr shantanuparab-tr added the enhancement New feature or request label Jun 15, 2026 — with Graphite App
@shantanuparab-tr shantanuparab-tr self-assigned this Jun 15, 2026
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 30f15ff to f34359c Compare June 16, 2026 21:51
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from 6b1f894 to 06c5043 Compare June 16, 2026 21:51
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from f34359c to 7673339 Compare June 16, 2026 21:59
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from 06c5043 to cf403e3 Compare June 16, 2026 22:00
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 7673339 to 74ce303 Compare July 16, 2026 15:12
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from cf403e3 to 8df0b25 Compare July 16, 2026 15:12
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 74ce303 to 7d32137 Compare July 16, 2026 15:41
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from 8df0b25 to 5a6e544 Compare July 16, 2026 15:41
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 7d32137 to 42c5dc0 Compare July 16, 2026 17:13
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from 5a6e544 to d54a50d Compare July 16, 2026 17:13
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 42c5dc0 to 3d44957 Compare July 16, 2026 17:27
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from d54a50d to 4ff0d26 Compare July 16, 2026 17:27
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 3d44957 to 1664d6a Compare July 17, 2026 00:22
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from 4ff0d26 to 8574895 Compare July 17, 2026 00:22
Wires PolicyClient into the SDK runtime: PolicyClientProducer (record source
for the chunk-aligned command stream), REGISTER_HARDWARE/REGISTER_PRODUCER
under "policy_client", active_hardware_registry placement, producer_config,
and the arm joint_names support the observation packer reads.
… + device-time docs

- Re-add gtest_discover_tests for test_msgpack_ndarray and
  test_openpi_websocket_transport: both still compiled but had been
  dropped from ctest, so the untrusted-msgpack decoder suite silently
  stopped running while CI stayed green (PR254-F1). Note the add/discover
  pairing invariant so it can't drift again.
- Reconcile a duplicate test_active_hardware_registry CMake target left
  by relocating unregister down the stack.
- Document that write_moving_time_s affects every TrossenArmComponent
  write (not just the policy client) and must stay below the control
  period or the arm chases a moving goal (PR254-F4).
- Document that use_device_time gives every row of a chunk the same
  received_at timestamp; per-row timing is a deferred follow-up (PR254-F2/F3).
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-05-policy-client branch from 1664d6a to 3e64359 Compare July 17, 2026 14:17
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-06-producer-integration branch from 8574895 to 09f8db9 Compare July 17, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant