Open MarkusZh opened 3 years ago
I noticed the same issue, for both the collision checking and distance checking examples. The issue goes away if you re-define the res
result object before calling fcl.collide
or fcl.distance
, e.g.:
req = fcl.CollisionRequest(enable_contact=True)
res = fcl.CollisionResult()
n_contacts = fcl.collide(
fcl.CollisionObject(box, fcl.Transform()),
fcl.CollisionObject(cone, fcl.Transform()),
req,
res,
)
print_collision_result("Box", "Cone", res)
res = fcl.CollisionResult() # Add this line to reset the result.
n_contacts = fcl.collide(
fcl.CollisionObject(box, fcl.Transform()),
fcl.CollisionObject(cyl, fcl.Transform(np.array([6.0, 0.0, 0.0]))),
req,
res,
)
print_collision_result("Box", "Cylinder", res)
Why is the collision result always True? And why is the distance between the two objects always -1.0. Actually I have changed the sizes and postions of the test objects for multiple times, sometimes, it is obviouly that the two objects will no collide with each other(for example, I set the two objects very far from each other), but the result remain the unchanged of being Collided. No error was raised. And my python-fcl version is python-fcl-win32-nr. What is wrong with my scripts? or Is there any dependency which I need to install? Thanks a lot for help.