feat: report position and force in the teleop status - #17
Merged
Merged
Conversation
An operator UI that watches a teleop session cannot read the gripper itself while it runs — the loop owns the CAN bus until teleop_stop. The status dict was the only window into the session, and it carried the opening but not the position or the force behind it, so a caller had no way to show what the jaws were doing (or, on a follower, how hard the leader was squeezing). status() now also reports position_mm and force_n: the master's own state, or the values from the frame the slave last followed.
|
🎉 This PR is included in version 0.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This was referenced Sep 29, 2026
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
A caller watching a teleop session cannot read the gripper itself while it runs — the loop owns
the CAN bus until
teleop_stop.teleop_status()is therefore the only window into the session,and it reported the opening but not the position or the force behind it. An operator UI had no way
to show what the jaws were doing, or how hard a leader was squeezing.
status()now also reportsposition_mmandforce_n: the master's own state, or the valuesfrom the frame the slave last followed.
Changes
src/litegrip/teleop.py—_last_position_mm/_last_force_nseeded in__init__, updatedin the master loop (own
get_state) and the slave loop (the followed frame, including the alignframe), and added to
status(). Stored only on the good-frame path, so a non-finite reading isnever surfaced.
tests/test_teleop.py—MasterLoopTest.test_status_reports_position_and_force(status agreeswith the published frame) and
SlaveLoopTest.test_status_reports_the_followed_position_and_force.README.md/readme_zn.md— the status list gainsposition_mm/force_n.Testing
Issues
None — the repository has no issue tracker entries, matching the previous PRs.