ETS/ETS2: one joint-index resolver; the all-or-none, unique guarantee breaks under concatenation and insert
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 10/100
調査の方向性
Start with the duplicated joint-index logic in ETS.__init__, ETS2.__init__ and ETS2.jacob, then BaseRobot.__init__ and Gripper.__init__. Reproduce the concatenation case from the issue (ETS([ET.Rz()]) * ETS([ET.Rx()]) giving duplicate jindex values) and check the insert path. Done means one shared resolver that enforces all-or-none, unique and contiguous indices, with the proposed regression tests passing. The design choices (lazy versus eager resolution, read-only ET.jindex) need maintainer agreement first.
索引モデルが issue の本文から書いたものです。
説明
Summary
The rule "an ETS has either all or none of its joint indices set, and they are unique and contiguous" is implemented four times and enforced in only one place, the constructor. Incremental construction and later mutation can break it.
Found while reviewing #792, which fixed one symptom (np.all([...jindex]) treats index 0 as missing, so a permuted or sparse mapping was silently overwritten with 0..n-1).
Where the logic lives today
| Place | What it does |
|---|---|
ETS.__init__ |
counts joints with a jindex; all-but-last sequential auto-fills the last, mixture raises ValueError, none assigns 0..n-1 |
ETS2.__init__ |
the same ~25 lines, copy-pasted |
ETS2.jacob |
re-checks "all set?" and renumbers (the check #792 fixes) |
BaseRobot.__init__ |
re-derives none/all across the links, via _auto_jindex, then assigns in DFS order |
Gripper.__init__ |
the same again with a slightly different filter |
The guarantee does not hold under incremental construction
On main:
a, b = ET.Rz(), ET.Rx()
e = ETS([a]) * ETS([b]) # each piece was auto-assigned jindex 0
[j.jindex for j in e.joints()] # -> [0, 0], n = 2: all set, but not unique
- Concatenating two auto-indexed ETS gives duplicate indices with no error, because the constructor only checks "all or none", not unique and contiguous.
ETS.insertappends to_datawith no re-check at all and does not reset_auto_jindex.ET.jindexhas a public setter, so indices can be changed after construction, outside the owning ETS (Link.jindex,BaseRobot,Gripper,DHRobotandETS2.jacoball do).
Proposal
- One helper (a function, or a method on the common base
BaseETS) that takes the joints and does the whole job: all-or-none check, uniqueness and contiguity, auto-fill, and returns whether the indices were auto-assigned.ETSandETS2constructors call it. - Re-run it from every mutator (
insert,append,__setitem__,__imul__) or resolve it lazily on first use, sincejindicesis already a cached property. - Make
ET.jindexread-only once the ET belongs to an ETS (the ET is already deep-copied into the ETS, so ownership is clear). Mutation then goes through one sanctioned ETS method that keeps the_auto_jindexflag and the cachedjindicesconsistent.Link.jindex,BaseRobot,GripperandDHRobotuse that method. BaseRobotandGrippershare a small classifier (none/all/mixed) instead of each re-writingall([... is None ...]), and their DFS assignment becomes one base-class method.- The unreachable renumbering block in
ETS2.jacobis deleted.
Regression tests: concatenation of two auto-indexed ETS, insert of a joint, permuted explicit indices surviving jacob, and a mixture still raising.
Fits the ets group of the typing pass (problems 61 to 65).
Related
- #792 (the symptom fix, independent of this)
- 主要言語
- C++
- スター
- 3.5k
- フォーク
- 639
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 96
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
petercorke/robotics-toolbox-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
petercorke/robotics-toolbox-python#709 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
petercorke/robotics-toolbox-python#839 ·
メンテナーはふだん 1 日以内に返信
-
enhancement help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
petercorke/robotics-toolbox-python#825 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
feat(ets): numerical inverse kinematics for planar ETS2対応中かも @qwist1233-cpu が 1 日前に担当しました。 オープンenhancement help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
petercorke/robotics-toolbox-python#824 ·
メンテナーはふだん 1 日以内に返信
-
Rigorous testing of operational-space methods対応中かも @kVinsom が今日担当しました。 オープンtech-debt Tests needed
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
petercorke/robotics-toolbox-python#804 ·
メンテナーはふだん 1 日以内に返信
petercorke/robotics-toolbox-python の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
メンテナーはふだん 1 日以内に返信
-
(S1 - Need confirmation)
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CleverRaven/Cataclysm-DDA#89159 ·
メンテナーはふだん 1 日以内に返信
-
area:libnvmpi bug P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gjrtimmer/jetson-nvmpi#33 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug(wasi_crypto): ArrayOutput::pull reports the wrong all-pulled flag対応中かも @Yashbhu が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信