Repository navigation
Conversation
Expose the firmware 1.13.0 contact-protection commands (0x16-0x1C):
set_contact_config/contact_on/contact_off, contact_calibrate,
contact_clear, contact_resume, get_contact_state, set_contact_mode and
get_contact_mode. Contact state/mode reads return Msg envelopes.
- Validate vectors and thresholds locally; refuse to arm the uncalibrated
generic table unless allow_default_thresholds=True.
- Accept the documented response names ("hold"/"warn"/"hard-only") in
set_contact_mode alongside the raw 0-2 values.
- Emulate 0x16-0x1C in FakeTransport and add offline tests.
- Add examples/11_contact.py and document the surface in the EN/ZH
README, developer guide and examples README.
- Refuse disable() while the zero-g keep-alive is active: disabling there
drops the gravity feedforward and hold torque, so the arm collapses.
Call zero_g_stop() first; emergency_stop() remains always reachable.
Tests: pytest 55 passed; python -m unittest discover -s tests runs the
7 CI tests OK. On a real Litearm1.13.0-7J arm, contact arm/calibrate/
latch/clear/resume, zero-g enter/exit, movej/move_l/move_p/move_path/
move_c, home, move_js, send_mit/send_mit_all/joint_follow, park and
emergency_stop/reset/disable were exercised; the arm ends enabled at the
studio ready pose with contact ARMED.
Co-Authored-By: Claude Code <noreply@anthropic.com>
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
Expose the firmware 1.13.0 contact-protection commands through the SDK, add a quick-start example, and make zero-gravity hand-guiding safe against an accidental
disable().Changes
0x16–0x1C:set_contact_config,contact_on,contact_off,contact_calibrate,contact_clear,contact_resume,get_contact_state,set_contact_mode,get_contact_mode.get_contact_state/get_contact_modereturn the standardMsgenvelope; phase/response names are decoded in the SDK.allow_default_thresholds=Trueis explicit.set_contact_mode()accepts the documented"hold"/"warn"/"hard-only"names as well as the raw0-2values.FakeTransportemulation for0x16–0x1C.examples/11_contact.py(studio ready pose → calibrate → hand push → clear) and document the surface in the EN/ZH README, developer guide and examples README.disable()is now refused while the zero-g keep-alive is active: zero-g holds the arm with gravity feedforward plus light damping, so disabling there collapses it. Callzero_g_stop()first;emergency_stop()remains always reachable.Testing
Offline, exactly as CI runs them:
Real arm (
Litearm1.13.0-7J,/dev/ttyACM0): exercised contact arm/calibrate/latch/clear/resume, zero-g enter/exit,movej/move_l/move_p/move_path/move_c,home,move_js,send_mit/send_mit_all/joint_follow,park, andemergency_stop/reset/disable. The zero-gdisable()now raises host-side with the arm staying enabled inZERO_G; afterzero_g_stop()the arm holds normally. Final state: enabled at the studio ready pose with contactARMED.Issues
None.
Checklist
.zh-CN.mdand keep the language switcher.Closesline is used.