フィルターのクリア

Collision over-simplification in RST

9 ビュー (過去 30 日間)
Denizhan AKINCI
Denizhan AKINCI 2024 年 6 月 11 日
コメント済み: Denizhan AKINCI 2024 年 6 月 12 日
Hello,
I am working with MATLAB to visualize the collision meshes of a robot I've designed. When using the show(robot) function, I notice that the collision meshes appear less detailed, I guess, the idea is to optimize execution time and reduce CPU load.
Could you please provide information on the maximum number of triangles allowed per STL file for collision meshes? I aim to achieve a balance between having detailed collision meshes and maintaining computational efficiency.
How it's supposed to look like :
meshTri = stlread("concept_c-bras5_col.stl");
trisurf(meshTri)
axis equal
How it actually looks like :
rbt = importrobot("concept.urdf");
show(rbt,Collisions="on");
As you can see it's really ugly. Do you know how to improve the collision meshes make them more accurate ?

採用された回答

Githin John
Githin John 2024 年 6 月 12 日
Hello,
You are seeing this over-simplification because it makes use of the convex hull of the available mesh, as we need a convex mesh for the collision check.
You could make use of convex decomposition of your mesh to get a more represntative collision mesh.
robotCollisionDecomp = importrobot("concept.urdf",CollisionDecomposition=true);
You can check this link to see more details about how to customize the decomposition of your mesh.
Alternatively, you could use collisionVHACD to decompose just the required mesh.
meshTri = stlread("concept_c-bras5_col.stl");
decomposedMesh = collisionVHACD(meshTri);
showCollisionArray(decomposedMesh);
Then clear the approximated collision mesh from the rigidBody and replace with the decomposed one.
rbt.Bodies{indexOfBody}.clearCollision;
for i=1:numel(decomposedMesh)
rbt.Bodies{indexOfBody}.addCollision(decomposedMesh{i})
end
More details here.
  1 件のコメント
Denizhan AKINCI
Denizhan AKINCI 2024 年 6 月 12 日
It works. Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCollision Detection についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by