衝突検出のみに FCL ライブラリを使用したい。
私の最初のオブジェクトは、球体の形状を使用して指定したいロボットであり、2 つ目は octree を使用して世界の障害物です。
この検出コードを作成するために、指示に従ってみました。
ROS wiki の API から次の情報を入力するにはどうすればよいですか?
// 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();
この API では三角形を使用していますが、私が知る限り、三角形は 3D メッシュにのみ使用されます。私はメッシュを使いたくありません。オブジェクトとして octree と sphere が必要です。
- では、どうすればそれを変更できますか?
- あと、衝突したことを真偽で返すには、どの関数を使えばいいでしょうか?
- データが更新された場合はどうなりますか? ロボットが動いていて、ロボットと octree の位置を更新し続けたいということですか? どうすればそれを実行できますか?
- BVH モデルの意味は何ですか?
例を探したところ、次のことがわかりました。
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;
出力は「res1」でした
「1」とはどういう意味ですか? 衝突ということですか?そして、ここでの物理的な衝突の意味は何ですか? オブジェクトの位置はどこですか?なぜこれが ROS wiki の API に従っていないのですか?
長い質問で申し訳ありませんが、私は初めて FCL を使用し、それについて何も知りません。