Repository navigation
feat: hold the grasp on over-torque and return the force to the leader - #81
Merged
Merged
Conversation
An over-torque follower used to drop to zero stiffness and damping in place,
so the clamped part pushed the jaws straight open — the gripper could not
hold anything. It now keeps pressing with a bounded pure-torque frame
(kp=kd=0, tau=+/-torque_limit_nm, signed by the torque measured at the trip),
the same shape as the hardware-validated GripperActions._hold_force. The old
behaviour is still available as torque_guard_action="release".
The leader can now feel the grasp: the follower publishes its mount-normalised
squeeze on its own zenoh key (litearm/v4/{grip_id}/gripper_feedback, an 8-byte
double, additive so older peers degrade to position-only teleop) and the leader
renders a resistance torque above a threshold, capped, with damping only while
the force is fresh. The forward and ready frames are untouched. UDP has no
receive path on the leader, so feedback turns itself off there.
Both mounts are covered by tests: the hold direction follows the measured
torque sign, not close_sign, and a wrong leader sign would drive the grasp
closed instead of resisting it.
Reading status() after the publish loop exits is a race: the master loop keeps spinning with no further frames, so the 0.3 s timeout zeroes feedback_tau_nm before the assertion reads it. Take the status sample inside the predicate, while feedback is still being published. Seen on CI.
|
🎉 This PR is included in version 1.3.0 🎉 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
An over-torque follower used to go slack in place, so the part it had just clamped pushed the jaws open — the gripper could not hold anything. It now keeps pressing with a bounded pure-torque frame. The leader can also feel the grasp: the follower reports its squeeze and the leader renders it as a resistance torque, so the operator no longer has to judge the grasp by eye alone.
The implementation follows the hardware-validated force path rather than inventing a new one: the hold frame has the same shape as
GripperActions._hold_force, andsend_mit_frame(tau=...)is the documented call for force feedback.Changes
teleop.py: on a torque-guard trip, latch the sign of the measured torque and sendkp=kd=0, tau=±torque_limit_nminstead of a zero-stiffness frame. The previous behaviour is available astorque_guard_action="release". Applied to the follow loop, the align ramp, and the handover so all three stay consistent.teleop.py: add the feedback codec (>d, 8 bytes),feedback_topic(), and the leader-side render (threshold→gain→cap, signed to oppose closing, damping only while the force is fresh, both torque and damping zero on timeout / never received).teleop.py: drain the ready and feedback subscriptions every cycle (the ready drain used to run first and never again), and exposefeedback_force_n,feedback_tau_nm,feedback_rx,feedback_txfromstatus().zenoh_link.py: carry the third key throughListener,Connector, andZenohTeleopTransport;feedback_key=Noneis byte-for-byte the previous behaviour.gripper.py/__init__.py: accept and forward the newteleop_startarguments and the feedback key, and export the new constants, codec, and topic.README.md,README.zh-CN.md: document the hold semantics, the feedback key and defaults, and the automatic degradation (older peer, UDP leader).Testing
New tests cover both mounts (the hold direction follows the torque measured at the trip, not
close_sign), thereleaseoption, the align and handover paths, the codec boundaries (wrong length, non-finite), the leader render (fresh / below threshold / capped / stale / off by default), a publish-only UDP leader, and the follower's mount-normalised publish.npx markdownlint-cli2@0.23.3 README.md README.zh-CN.mdreports no issues.Issues
No linked issue — requested from the field: the follower could not hold a part, and the leader had no feel for the grasp.
Checklist
.zh-CN.mdand open with the language switcher.Closesis used only when the pull request fully resolves the issue.