Skip to content

fix: keep the leader's resident publisher across teleop sessions - #19

Merged
yd-sl merged 1 commit into
mainfrom
fix/resident-teleop-publisher
Sep 29, 2026
Merged

yd-sl merged 1 commit into
mainfrom
fix/resident-teleop-publisher

Conversation

@yd-sl

@yd-sl yd-sl commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

teleop_stop() closed the leader's resident zenoh publisher, because
teleop_start registered that resident endpoint as the session's transport.
_teleop_pub kept pointing at the dead endpoint, so every session after the
first published into a closed zenoh session: the follower received nothing
while the leader's own frame counter kept climbing.

Observed on hardware through the GUI: the first master/slave pairing delivered
frames (follower received 577), and each of the next five pairings delivered
none (0 frames received, align timeout), with the leader still reporting
thousands of frames sent. After this change the same GUI flow delivers frames
on every session (1406, then 3393).

Changes

  • src/litegrip/gripper.py: the master path of teleop_start no longer
    registers the resident publisher as created_transport, so teleop_stop
    closes only the follower's per-session subscriber. The publisher's lifetime
    stays with disconnect() / _close_teleop_pub(), which is what the
    docstrings already claimed.
  • tests/test_teleop.py: a regression test asserting that a stop leaves the
    resident publisher open, that a second session reuses it, and that
    disconnect() closes it.

Testing

  • python3 -m unittest discover -s tests -t tests -> Ran 152 tests ... OK
  • Regression test against the unfixed code -> FAIL: test_master_keeps_its_resident_publisher_across_sessions ... AssertionError: True is not false : teleop_stop must not close the resident publisher
  • Hardware: two python3 -m liteteleop instances (master on can0, follower on can1, port 17448), toggling gripper teleoperation on and off; every session received frames.

teleop_start registered the leader's resident zenoh publisher as the
session's transport, so teleop_stop closed it. _teleop_pub kept pointing
at that dead endpoint, so every session after the first published into a
closed zenoh session. On hardware the first master/slave pairing
delivered frames and every later one delivered none, while the leader's
own frame counter kept climbing.

The resident publisher is no longer registered, so teleop_stop closes
only the follower's per-session subscriber and the publisher lives until
disconnect().
@yd-sl
yd-sl force-pushed the fix/resident-teleop-publisher branch from 4372972 to 0f6e95d Compare September 29, 2026 08:52
@yd-sl
yd-sl merged commit 47293e7 into main Sep 29, 2026
1 check passed
@yd-sl
yd-sl deleted the fix/resident-teleop-publisher branch September 29, 2026 08:53
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.9.1 🎉

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