Skip to content

feat(ets): a trailing underscore numbers a joint name from one; document joint descriptors - #811

Merged
petercorke merged 4 commits into
mainfrom
fix/et-descriptor-one-based
Oct 16, 2026
Merged

petercorke merged 4 commits into
mainfrom
fix/et-descriptor-one-based

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

A joint descriptor such as "A1" has joint index 1, the digits as written, so the names A1 to A6 of a Kuka arm gave indices 1 to 6, which a robot rejects with an unhelpful message. A trailing underscore now says the name counts from one: "A1_" is joint 0, "-A1_" is joint 0 flipped, "θ2_" is joint 1. The underscore is an instruction and is not shown, Rz(A1). "A0_" is an error.

  • The Unicode minus sign − negates a joint like -; it silently did not before.
  • A robot whose joint indices are exactly 1 to n gets an error message that says to use the trailing underscore. Other out-of-range cases keep the old message.
  • Joint descriptors were documented only in code comments. They are now described in the BaseET docstring (index, sign, one-based names, no-number and constant cases, the conflict rule), and each ET and ET2 constructor's param line links to it.

No hidden renumbering: indices are as written unless the user adds the underscore.

Tests

tests/test_et_joint_descriptor.py, written first (25 of 45 failed on main): 24 descriptor forms, all six ET constructors and ET2, the zero and conflict errors, numeric strings, flip semantics, and a 6-joint ERobot from A1_..A6_ giving the same fkine and jacob0 as q0..q5, with one joint flipped. The existing descriptor tests in test_ET.py and test_ETS.py pass unchanged.

Full suite: same 29 failures as main here (stale compiled extension). mypy clean on 164 files.

Related issue

Issue #803 (joint-index resolver). One observation recorded there: an ETS whose jindices are not a permutation of 0..n-1 evaluates fkine in joint order and ignores the numbers.

🤖 Generated with Claude Code

petercorke and others added 3 commits October 16, 2026 10:55
…es included

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ent joint descriptors

A joint descriptor such as "A1" has jindex 1, the digits as written, so the
names A1 to A6 of a Kuka arm gave indices 1 to 6, which a robot rejects.
"A1_" is joint 0: the underscore says the name counts from one, and is not
part of the displayed name.  "A0_" is an error.  The Unicode minus sign
negates a joint like the hyphen.

The descriptors were documented only in code comments.  They are now described
in the BaseET docstring, with the minus sign, and linked from the parameter of
each ET and ET2 constructor.  A robot whose joint indices are exactly 1 to n
gets an error message that says to use the underscore.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 14 high

Alerts:
⚠ 14 issues (≤ 0 issues of at least minor severity)

Results:
14 new issues

Category Results
Security 14 high

View in Codacy

🟢 Metrics 35 complexity · 0 duplication

Metric Results
Complexity 35
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (681c725) to head (4d217dc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/roboticstoolbox/ets/_ET.py 0.00% 13 Missing ⚠️
src/roboticstoolbox/robot/BaseRobot.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #811   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        144     144           
  Lines      14917   14931   +14     
=====================================
- Misses     14917   14931   +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke enabled auto-merge (squash) October 16, 2026 21:22
@petercorke
petercorke merged commit 68f525a into main Oct 16, 2026
22 of 23 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant