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

Inconsistent results for continuous collision checking #11

Open
clemense opened this issue Jan 19, 2019 · 3 comments
Open

Inconsistent results for continuous collision checking #11

clemense opened this issue Jan 19, 2019 · 3 comments

Comments

@clemense
Copy link

clemense commented Jan 19, 2019

This program gives different results if run repeatedly:

from __future__ import print_function

import numpy as np
import fcl

def main():
    g1 = fcl.Box(1,2,3)
    t1 = fcl.Transform([-10.0, 0, 0])
    o1 = fcl.CollisionObject(g1, t1)
    t1_final = fcl.Transform(np.array([10.0, 0.0, 0.0]))

    g2 = fcl.Cone(1,3)
    t2 = fcl.Transform([0, 0, 0])
    o2 = fcl.CollisionObject(g2, t2)
    t2_final = fcl.Transform(np.array([0.0, 0.0, 0.0]))

    request = fcl.ContinuousCollisionRequest()
    result = fcl.ContinuousCollisionResult()

    ret = fcl.continuousCollide(o1, t1_final, o2, t2_final, request, result)

    return result
    
if __name__ == "__main__":
    print("FCL version: ", fcl.__version__)

    result = main()

    print("Time of contact: ", result.time_of_contact)
    print("Is colliding: ", result.is_collide)

Why?

@mmatl
Copy link
Collaborator

mmatl commented Jan 19, 2019

Thanks for the minimal working example. I'm not sure why this could be happening -- the Python code looks correct, so I'll need to run a CPP test and see if the issue is with FCL itself.

@clemense
Copy link
Author

Ok, I get consistent results if I use GST_INDEP as the narrow phase collision solver (request.gjk_solver_type = 1).

Just a wild guess: This might be related to this issue: flexible-collision-library/fcl#243 (since the continuous collision check interface has a maximum number of iterations, 'hanging' might result in no detected collision)

@mmatl
Copy link
Collaborator

mmatl commented Jan 23, 2019

Good find. I can change the default solver to avoid that issue.

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

No branches or pull requests

2 participants