flexible-collision-library / fcl

Flexible Collision Library
https://flexible-collision-library.github.io/
Other
1.38k stars 416 forks source link

Raycasting? #310

Open dendicott-jpl opened 6 years ago

dendicott-jpl commented 6 years ago

Is there any recommended way to go about checking for collision along a line? I'm implementing FCL as an alternative to bullet and need to provide the same functionality. I'm considering using a very long and thin cylinder, but wanted to check before using a hacky solution.

sherm1 commented 6 years ago

We need FCL raycasting at TRI also!

the13fools commented 4 years ago

It looks like there is a feature flag for this, but it doesn't look like it does anything? https://github.com/j-rivero/fcl0.5/blob/master/src/continuous_collision.cpp#L279.

Perhaps someone here knows of a test case we could look at for implementing ray casting on top of FCL's BVH datastructures?

jmirabel commented 4 years ago

I'm considering using a very long and thin cylinder, but wanted to check before using a hacky solution.

Better use a capsule than a cylinder. It's faster and behaves better numerically.

the13fools commented 4 years ago

I see, thank you for the quick reply!

Would the preferred way be to set a very long capsule and then sort the resulting collision points along the ray, or to ray march the length of the capsule?

I suppose that you could also use continuous collision detection to shoot a sphere along a ray, but I guess this is probably slower?

jmirabel commented 4 years ago

If you only need the first collision, then a sphere of a very tiny radius and ccd is probably fine. I never used ccd from FCL (it does not support relative motions coming from robot kinematics) so I can't say about performances with the FCL implementation. However, I guess it is going to be a lot slower because you will have several BVH traversal.

The fastest is definitely to implement a special raycasting traversal. I don't think it is hard but, with FCL design, it's going to be verbose and spread into several classes.

caxapexac commented 2 years ago

Still no solution?

vincentdchan commented 7 months ago

+1 Need raycasting