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

Performance of FCL #616

Open
AdmiralPellaeon opened this issue Apr 23, 2024 · 1 comment
Open

Performance of FCL #616

AdmiralPellaeon opened this issue Apr 23, 2024 · 1 comment

Comments

@AdmiralPellaeon
Copy link

Hi,

I have a software for checking collisions within the working area of a machine tool. Atm I use the old library opcode to do the collision check.
I also included FCL to give it a try and to have a newer software design. In principle, it works, but I noticed a much slower performance compared to the Opcode library.

I have followed the instructions from the Git homepage. Here is an excerpt of the main parts for using FCL:

auto model = std::make_shared<fcl::BVHModel<fcl::Bounding_box>>();
model->beginModel();
model->addSubModel(vertices, triangles);
model->endModel();

coll_geo = fcl::Collision_object(model);

This is done for every collision object (I have a lot of different geomtries which needs to be checked. It is handled in the struct Node_fcl.

And this is the actual collision check of two nodes:

bool Collision_detector_fcl::is_collision(Node_fcl& left, Node_fcl& right)
{
	fcl::CollisionResult<fcl::Real_t> result;

	left.coll_geo.setTransform(left.get_full_transformation());
	right.coll_geo.setTransform(right.get_full_transformation());

	fcl::CollisionRequest<fcl::Real_t> request;		
	fcl::collide(&left.coll_geo, &right.coll_geo, request, result);

	return result.isCollision();
}

Perhaps I use the library in an inefficient way? Is there some kind of best practice for FCL if performance is crucial?

Best regards

@jcarpent
Copy link

Is your mesh convex?

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