Collision detection using FCL by shere and octree objects following Ros wiki

asked 2015-02-11 06:08:58 -0500

RSA_kustar gravatar image

updated 2015-02-11 06:09:22 -0500

I want to use fcl library for collision detection only.

My first object is the robot where I want to specify it using a sphare shape and sceond the obstacles in the world using octree..

I tried to follwo the instruction in order to create this detection code.

How can I fill the follwoing information from the API in ROS wiki ???

// set mesh triangles and vertice indices
std::vector<Vec3f> vertices;  
std::vector<Triangle> triangles;
// code to set the vertices and triangles
 ...
// BVHModel is a template class for mesh geometry, for default OBBRSS     template is used
typedef BVHModel<OBBRSS>* Model; 
Model* model = new Model();
// add the mesh data into the BVHModel structure 
model->beginModel();
model->addSubModel(vertices, triangles);
model->endModel();

In this API they are using triangle and as far as I know that triangles are anly used for 3d mesh.. I dont want to use meshes I want octree and sphere as objects... 1- So How can I modify that ? 2- after that Which function I should use to return for me true or false that the collision happened ??? 3- what if my data is updated?? I mean the robot is moving and I want to keep updating the position of the robot and the octree ? how can I perform that ?

4- what is the meaning of the BVH model ????

I looked for examples and from the examples I found the follwoing thing:

 Sphere s1(10);
 Box s2(5, 5, 5);
 Transform3f transform;
 Transform3f identity;
 CollisionRequest request;
 CollisionResult result; 
 bool res;
res = (collide(&s1, Transform3f(), &s2, Transform3f(), request, result) > 0);
std::cout << "res" << res << std::endl;

The output was res1

What is the 1 ?? does it mean it is collision ? and what is the meaning of collision physically here ?? where is the position of the objects and why this is not following the API of the ROS wiki ????

Sorry for the long question but I using the FCL for the firat time and I dont know anything about it

edit retag flag offensive close merge delete

Comments

I am facing a similar issue. Could you solve it?

botbuilder gravatar imagebotbuilder ( 2016-08-02 13:22:41 -0500 )edit