policy_client: PolicyClient bridge, Face adapters, inference loop#253
Open
shantanuparab-tr wants to merge 4 commits into
Open
policy_client: PolicyClient bridge, Face adapters, inference loop#253shantanuparab-tr wants to merge 4 commits into
shantanuparab-tr wants to merge 4 commits into
Conversation
This was referenced Jun 15, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 15, 2026
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
June 15, 2026 16:56
6f2f314 to
e213588
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-04-transports
branch
2 times, most recently
from
June 15, 2026 18:45
26b0e67 to
1485f2f
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
June 15, 2026 18:45
e213588 to
30f15ff
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-04-transports
branch
from
June 16, 2026 21:51
1485f2f to
f781714
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
June 16, 2026 21:51
30f15ff to
f34359c
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-04-transports
branch
from
June 16, 2026 21:58
f781714 to
b456b0e
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
June 16, 2026 21:59
f34359c to
7673339
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-04-transports
branch
from
July 16, 2026 15:12
b456b0e to
cc2b35e
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
July 16, 2026 15:12
7673339 to
74ce303
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-04-transports
branch
from
July 16, 2026 15:41
cc2b35e to
b167d44
Compare
shantanuparab-tr
added a commit
that referenced
this pull request
Jul 16, 2026
Replace the non-ASCII theta symbol with ASCII across the PolicyClient header, implementation, and tests, matching the rest of the stack (Copilot portability comment).
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
July 16, 2026 15:41
74ce303 to
7d32137
Compare
shantanuparab-tr
added a commit
that referenced
this pull request
Jul 16, 2026
Replace the non-ASCII theta symbol with ASCII across the PolicyClient header, implementation, and tests, matching the rest of the stack (Copilot portability comment).
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
July 16, 2026 17:13
7d32137 to
42c5dc0
Compare
shantanuparab-tr
added a commit
that referenced
this pull request
Jul 16, 2026
Replace the non-ASCII theta symbol with ASCII across the PolicyClient header, implementation, and tests, matching the rest of the stack (Copilot portability comment).
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
July 16, 2026 17:27
42c5dc0 to
3d44957
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-04-transports
branch
from
July 17, 2026 00:21
e160d6b to
cf93349
Compare
shantanuparab-tr
added a commit
that referenced
this pull request
Jul 17, 2026
Replace the non-ASCII theta symbol with ASCII across the PolicyClient header, implementation, and tests, matching the rest of the stack (Copilot portability comment).
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
July 17, 2026 00:22
3d44957 to
1664d6a
Compare
The hardware/observer bridge that packs neutral Observations, drives one transport via the async push/poll contract, and presents per-arm action slices through Face adapters. Implements the chunk-timing core: timestep clock, drain-threshold theta firing, must_go starvation flag, freshness barrier, and hold-last-action under any failure.
…he arm Safety hardening on the untrusted-server -> physical-motion path: - Reject any chunk containing NaN/Inf before it commands the arm; NaN defeats naive downstream clamps, so an unchecked value became uncontrolled motion. Hold-last on rejection, with an ongoing (not warn-once) log (PR253-F1). - Stop a single non-finite row from permanently poisoning the per-arm EMA filter (PR253-F2). - Add inference_timeout_ms so a half-open server that never returns a chunk can no longer silently freeze the arm forever (PR253-F3). - Bound a far-future server base_timestep in the overlap path (PR253-F4). - Fix a Face use-after-free: Face now holds shared state, not a raw back-pointer to the client, so a teleop consumer outliving the client degrades to hold-last instead of dereferencing freed memory (PR253-F5). - Derive image channels from the Mat, not the encoding string, fixing a heap over-read on a mono8 record; convert to 3-channel RGB (PR253-F6). - Make missing-camera behavior uniform regardless of resize (PR253-F7). - read() failure now holds last, not a drive-to-zero-pose (PR253-F9). - Correct the exhaust-target comment (PR253-F8); drop ADR/section refs in favor of inline facts (PR253-F10). Also define ActiveHardwareRegistry::unregister here (with tests), where its callers live, so this branch compiles standalone (PR254-F5).
…pass-2) Pass-2 review noted an inconsistency: a configured camera with no resize that never delivers a frame makes pack_observation_ return nullopt every cycle (inference stalls forever), yet it was logged warn_once_ - the weakest logging for the least-recoverable failure, contradicting the throttled ongoing logging used for non-finite rejects. Switch it to warn_throttled_ so a frozen arm keeps surfacing the cause. Also document inline why the θ=0 consume-fully path needs no base_timestep guard.
Replace the non-ASCII theta symbol with ASCII across the PolicyClient header, implementation, and tests, matching the rest of the stack (Copilot portability comment).
shantanuparab-tr
force-pushed
the
06-15-policy-client-04-transports
branch
from
July 17, 2026 14:17
cf93349 to
d6b2d74
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-05-policy-client
branch
from
July 17, 2026 14:17
1664d6a to
3e64359
Compare
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
Adds
PolicyClient— the hardware/observer bridge that packs neutralObservations, drives onePolicyTransportover the async push/poll contract, and presents per-arm action slices throughFaceadapters to the existing teleop machinery. This is the chunk-timing core of the subsystem.Changes
include/trossen_sdk/hw/policy/policy_client.hpp+src/hw/policy/policy_client.cpp:PolicyClient(multi-inheritsHardwareComponent+ObserverBase) and its per-armFace. Implements the inference loop and its timing model:⌊(now − epoch)·rate⌋) stamped on every observation and paired with the chunk'sbase_timestepon the return path;must_gostarvation flag for queueing servers;Face::read()never throws), plus per-arm EMA output smoothing.tests/test_policy_client.cpp+tests/CMakeLists.txt: drives the client against aFakeTransport(the two-arg constructor) — chunk apply/publish, hold-last-action, pause/resume, width-mismatch rejection.cmake/policy_client.cmake: addpolicy_client.cppto the gated sources.Test Plan
-DTROSSEN_SDK_ENABLE_POLICY_CLIENT=ONtest_policy_clientpre-commit run --all-files)Breaking Changes
None. New gated sources behind
TROSSEN_SDK_ENABLE_POLICY_CLIENT(default OFF).Related
Based on #248. Stacked on #252; followed by #254–#255.