Bug Fix : pair-collision.hxx, changing the method to check the pair_id with collisionPair.size() #1178
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.
Hello,
First, I'd like to thank you for your work. Here's what I think a small mistake in pair-collision.hxx I corrected.
Pull Request: Update condition to use collisionPairs.size()
Description
This pull request updates a conditional statement to use
collisionPairs.size()
instead ofngeoms
because ngeoms is not the number of collision pairs but the number of geometry objects in geom_model.The number of pairs can be higher than the number of geometry objects, hence this pull request.
Changes Made
static_cast<pinocchio::FrameIndex>(geom_model->ngeoms)
withstatic_cast<pinocchio::FrameIndex>(geom_model->collisionPairs.size())
in the condition.Testing
After building it, I tried on a small example in python and it works. I did not run unit tests after this but it builds successfully. Please, do not hesitate to tell me if I did something wrong here.
Related Issues
None
Checklist
Thank you,
Arthur Haffemayer
PhD. Student, LAAS CNRS, Gepetto