flexible-collision-library / fcl

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

Computing OBB from Pointcloud? #551

Open yaadhavraajagility opened 2 years ago

yaadhavraajagility commented 2 years ago

Is this actually possible? I see there is an OBB class but it doesn't have any examples. Will this work for a pointcloud and not a mesh etc.

jmirabel commented 2 years ago

Point cloud collision detection in FCL relies on octomap. The bouding volumes are derived from octomap directly.

huiyue commented 2 years ago

Point cloud collision detection in FCL relies on octomap. The bouding volumes are derived from octomap directly.

I try to do this ,bus failed. would you mind give me a demo that check collide with two point cloud, thanks

JeffHough commented 2 weeks ago

@jmirabel to add to this question, is there a way to build, for example, a fcl::OBBRSS type, which is based on an fcl::OcTree? That way, collision checks would be much faster if the robot is far away from the obtained octree?

Something like this:

auto octomap_tree = std::make_shared<octomap::OcTree>(resolution);
// ... add points to the tree, merge scans, etc.

// create the fcl collision geometry:
auto fcl_octree = std::make_shared<fcl::OcTreed>(octomap_tree);

// create a bounding-volume which we can use to speed up collision checks if say,
// the robot is very very far away from the obtained point cloud.
auto geom = std::make_shared<fcl::BVHModel<fcl::OBBRSSd>>();
geom->beginModel();
geom->addSubModel(fcl_octree );
geom->endModel();

Assuming the above does not exist, then is there a recommended method of dealing with Octrees for the use case I mentioned (where robot is far from the tree, so in theory a collision check could return false very quickly)?

Thanks!