Fix get_link_names exception for single-link groups (#160)#465
Open
Swastik-Verma wants to merge 1 commit into
Open
Fix get_link_names exception for single-link groups (#160)#465Swastik-Verma wants to merge 1 commit into
Swastik-Verma wants to merge 1 commit into
Conversation
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.
Fixes #160
Problem
RobotCell.get_link_names()raised an exception when called on a groupconsisting of a single link (e.g. an end-effector group with no
configurable joints), instead of returning that link's name.
Root cause
When a group's base link and end-effector link are the same (i.e. the
group has only one link),
get_link_names()would still calliter_link_chain(), which internally tries to compute a shortest pathbetween two identical nodes. This returns an empty path, which was
incorrectly treated as "no chain found," raising an exception even
though the group is valid.
Fix
Added a check in
get_link_names(): if the base link and end-effectorlink are the same, the function returns that single link's name
directly, without going through the chain-finding logic.
Testing
Added a test case in
test_get_link_namesusing theendeffectorgroup on the
ur10e_gripper_one_beamfixture, which has a single linkand zero configurable joints — reproducing the original bug scenario.
Verified the fix with:
invoke test --doctestinvoke testcodeblocksBoth show the same pre-existing, unrelated baseline failures as before
this change (documented in issue discussion/PR comments if needed),
with no new failures introduced.