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 api.contact.in_contact #119

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Fix api.contact.in_contact #119

merged 2 commits into from
Mar 26, 2024

Conversation

flferretti
Copy link
Collaborator

@flferretti flferretti commented Mar 26, 2024

The returned length of links_in_contact was always equal to the total number of links in the model, instead of being equal to the length of the input link_names


📚 Documentation preview 📚: https://jaxsim--119.org.readthedocs.build//119/

@flferretti flferretti self-assigned this Mar 26, 2024
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for having a look @flferretti. It is indeed wrongly returning always an array with $n_L$ elements. However, I fear your fix is not correct. I guess you need to create a boolean mask that selects the elements of links_in_contact corresponding to the passed link_names. Right now, you are selecting the first elements of links_in_contact, that would not correspond to link_names. Did I get it right?

And, would it be a problem to rebase this PR on top of #108 as soon as #117 will get merged? The functional APIs of main will be updated soon, I'd prefer to directly fix the final ones.

@flferretti flferretti changed the base branch from main to functional March 26, 2024 14:51
The length of `links_in_contact` was always equal to number of links in the model
src/jaxsim/api/contact.py Outdated Show resolved Hide resolved
src/jaxsim/api/contact.py Outdated Show resolved Hide resolved
src/jaxsim/api/contact.py Outdated Show resolved Hide resolved
Co-authored-by: Diego Ferigo <[email protected]>
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, thanks!

@flferretti flferretti merged commit 31ee91f into functional Mar 26, 2024
21 checks passed
@flferretti flferretti deleted the flferretti-patch-1 branch March 26, 2024 17:02
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.

None yet

2 participants