Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get chain #24

Merged
merged 4 commits into from
Jun 17, 2022
Merged

Fix get chain #24

merged 4 commits into from
Jun 17, 2022

Conversation

Giulero
Copy link
Collaborator

@Giulero Giulero commented Jun 16, 2022

In methods like forward_kinematics or jacobian, we need to access the kinematic tree that goes from the base frame to the end-effector. To get this kinematic chain I use the method get_chain (from urdf_parser_py), which returns the sequence of the kinematic tree as [...-link-joint-link-joint-...]
Sometimes a link and a joint may have the same name.

Before I was just checking that an element in the chain is in the joints list, supposing that links and joints could not have the same name. For example, if a joint and a link are named right_elbow, the check would return that both the elements are in the joints list.

To solve this issue I'm allowing the method get_chain to return only the joints in the chain.

Changing:

chain = self.robot_desc.get_chain(self.root_link, frame)
...
if item in self.robot_desc.joint_map:

with

chain = self.robot_desc.get_chain(self.root_link, frame, links=False)

I'm using this PR also to allow the creation of a link list with only links with inertial properties. With this modification, no fictitious zero inertia is needed. (See #23 (comment))

@Giulero Giulero self-assigned this Jun 16, 2022
@Giulero Giulero mentioned this pull request Jun 16, 2022
@Giulero Giulero requested a review from traversaro June 16, 2022 13:21
@Giulero
Copy link
Collaborator Author

Giulero commented Jun 17, 2022

Thanks @FabioBergonti!

@Giulero Giulero merged commit 94b3bc1 into main Jun 17, 2022
@Giulero Giulero deleted the fix_get_chain branch June 17, 2022 10:51
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.

2 participants