Skip to content

no nearest_points attribute for python bindings #623

Answered by lmontaut
almazgaliev asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @almazgaliev,
A CollisionResult stores a vector of Contact (in case there is indeed a collision).
I don't know which branch of hpp-fcl you are using, but on the devel one (which will soon be released, @jorisv is working on it), you can retrieve the nearest points. On the master branch, you can use the normal and the contact point to find the associated "nearest" points.
On the devel branch, you can go over each Contact and use getNearestPoint1/2 methods:

col_res = hppfcl.CollisionResult()
[...] # do some collision checks
if col_res.isCollision():
    contact = col_res.getContact(0) # get the first `Contact` object
    cp1, cp2 = contact.getNearestPoint1(), contact.getNearestPoint2()

If…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by almazgaliev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #622 on September 19, 2024 09:19.