Skip to content

feat: report position and force in the teleop status - #17

Merged
yd-sl merged 1 commit into
mainfrom
feat/teleop-status-position-force
Sep 29, 2026
Merged

yd-sl merged 1 commit into
mainfrom
feat/teleop-status-position-force

Conversation

@yd-sl

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

Copy link
Copy Markdown
Contributor

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 reports position_mm and force_n: the master's own state, or the values
from the frame the slave last followed.

Changes

  • src/litegrip/teleop.py — _last_position_mm / _last_force_n seeded in __init__, updated
    in the master loop (own get_state) and the slave loop (the followed frame, including the align
    frame), and added to status(). Stored only on the good-frame path, so a non-finite reading is
    never surfaced.
  • tests/test_teleop.py — MasterLoopTest.test_status_reports_position_and_force (status agrees
    with the published frame) and SlaveLoopTest.test_status_reports_the_followed_position_and_force.
  • README.md / readme_zn.md — the status list gains position_mm / force_n.

Testing

$ cd /home/qql/sl/litegrip-python && python3 -m unittest discover -s tests -t tests
Ran 151 tests in 1.907s

OK

$ npx --yes markdownlint-cli2@0.23.3 "README.md" "readme_zn.md"
Summary: 0 issues in 0 files

Issues

None — the repository has no issue tracker entries, matching the previous PRs.

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.
@yd-sl
yd-sl merged commit 4eeb87d into main Sep 29, 2026
1 check passed
@yd-sl
yd-sl deleted the feat/teleop-status-position-force branch September 29, 2026 08:01
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.8.0 🎉

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