fix: keep the leader's resident publisher across teleop sessions - #19
Merged
Merged
Conversation
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
force-pushed
the
fix/resident-teleop-publisher
branch
from
September 29, 2026 08:52
4372972 to
0f6e95d
Compare
|
🎉 This PR is included in version 0.9.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
teleop_stop()closed the leader's resident zenoh publisher, becauseteleop_startregistered that resident endpoint as the session's transport._teleop_pubkept pointing at the dead endpoint, so every session after thefirst 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 reportingthousands 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 ofteleop_startno longerregisters the resident publisher as
created_transport, soteleop_stopcloses only the follower's per-session subscriber. The publisher's lifetime
stays with
disconnect()/_close_teleop_pub(), which is what thedocstrings already claimed.
tests/test_teleop.py: a regression test asserting that a stop leaves theresident 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 ... OKFAIL: test_master_keeps_its_resident_publisher_across_sessions ... AssertionError: True is not false : teleop_stop must not close the resident publisherpython3 -m liteteleopinstances (master on can0, follower on can1, port 17448), toggling gripper teleoperation on and off; every session received frames.