Open velecto1 opened 1 year ago
I did some more testing:
Tested 3D Objects | 1-on-1, or grouped? | How is Translation Set | Works? |
---|---|---|---|
box × box | CollisionObject | anyhow | YES |
mesh × box | CollisionObject | anyhow | YES |
box × box | CollisionManager | anyhow | YES |
mesh × box | CollisionManager | collisionObject.setTranslation(...) | NO |
mesh × box | CollisionManager | CollisionObject |
YES |
So, collision detection does not work only and only if
CollisionManager
,CollisionObject
but after CollisionObject
s' creation.This led me to a question: Why is an AABB
of a CollisionObject
dependent on the way the transformation of the CollisionObject
is set, and does it influence collision checking with CollisionManager
s?
See -- the code
auto transformation_Transform3 = fcl::Transform3<double>(translation_Translation3);
auto twoMetersBox_CollisionObject = std::make_shared<fcl::CollisionObject<double>>(twoMeters_Box, transformation_Transform3);
produces
twoMetersBox_AABB.center()= [10, 10, 5.65],
while
auto twoMetersBox_CollisionObject = std::make_shared<fcl::CollisionObject<double>>(twoMeters_Box);
twoMetersBox_CollisionObject->setTranslation(twoMetersBoxTranslation_Vector3);
produces:
twoMetersBox_AABB.center()= [0, 0, 0].
My proposition is to make CollisionObject::setTranslation()
and CollisionObject::setRotation()
protected or fix the way CollisionManager
s are handling them, but I still lack the full understanding of how the whole thing works.
I just gave a last shot trying to find a similar issue, and here we are! This issue would have been solved long ago if the terribly old issue https://github.com/flexible-collision-library/fcl/issues/40 was solved, too!!!
Hello, I am having trouble with a simple program to detect collision between a mesh soup and a box.
I have written it according to the README of this repository, partially inspired by the code from fcl_examples: https://github.com/RyodoTanaka/fcl_examples/blob/master/src/broadphase/bp_dynamic_aabb_tree.cpp
CMakeLists.txt (using my fork of FCL to avoid issues with compiling Eigen3, to program itself should work with the original FCL as well):
main.cpp:
When I add something like the
twoMetersBox_CollisionObect
tobigCuboid_CollisionManager
on the right location ([10, 10, 5.65] or similar), collision is detected. But the mesh soup seems to be somehow ignored... Why, please?Update: With
CollisionObject
s directly, it works: