petercorke / petercorke/robotics-toolbox-python

Inconsistent joint indexes in ETS

Open
#393 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3.5k
Forks
624
Avg merge
2d 4h
Merged PRs (30d)
53

Description

Describe the bug
Multiplication (concatenation) of several ETS does not update joint indexes

Version information

roboticstoolbox-python 1.1.0

To Reproduce

import roboticstoolbox as rtb

et = rtb.ET.Rz()
ets = rtb.ETS([et, ])

print((et * et).joints()) # OK:
# [ET.Rz(jindex=0), ET.Rz(jindex=1)]

print((ets * ets).joints()) # NOT OK:
# [ET.Rz(jindex=0), ET.Rz(jindex=0)]

print((et * et *  ets).joints()) # NOT OK:
# [ET.Rz(jindex=0), ET.Rz(jindex=1), ET.Rz(jindex=0)]

print((et *  ets).joints()) # NOT OK:
# raise ValueError( "You can not have some jindices set for the ET's in arg. It must be all")

Expected behavior
ETS consctructor should re-enumerate joint indexes

Environment (please complete the following information):

  • Ubuntu 22.04
  • python 3.10.6

p.s. Awesome work btw :) !!!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ETS constructor and the joints() behavior shown in the reproduction. Run the provided examples for concatenating ET and ETS objects, then make the constructor re-enumerate joint indexes so the resulting joints have distinct indexes and the mixed concatenation no longer raises the reported ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.