addCollision not compatible with Matlab Coder when using *.STL File
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ran Shaham
le 19 Jan 2022
Modifié(e) : Karsh Tharyani
le 25 Jan 2022
Hello, i am trying to compile a code that uses addCollision Function.
The syntax:
Tool_name = 'Tool Effector';
Tool = rigidBody(Tool_name);
addCollision(Tool, 'Mesh', "C:\WorkingFolder\Tool.STL");
When using this function from MATLAB, i get no errors. When trying to compile in Coder , i get this:
??? Cell contents reference from a non-cell array object.
Error in ==>> CollisionGeometryFactory Line: 85 Column: 40
Code generation failed: View Error Report
so i edited CollisionGeometryFactory, instead of:
geometryFile = parameters{1};%If it is a string
i put:
geometryFile = parameters;%If it is a string
Okay, not the error is somewhere else:
??? Function 'which' not supported for code generation.
More information
Error in ==>> CollisionGeometryFactory Line: 96 Column: 40
Code generation failed: View Error Report
So i took that out as well.
But, then i get:
??? Function 'fileparts' not supported for code generation.
More information
Error in ==>> readCADFile Line: 15 Column: 1
Code generation failed: View Error Report
There i decided to stop.
It states that addCollision is compaitble with C\C++ Coder generation. and i could'nt find a comment about an exception when importing a collison from .STL
What am i missing ?
Thank you
0 commentaires
Réponse acceptée
Plus de réponses (1)
Karsh Tharyani
le 25 Jan 2022
Modifié(e) : Karsh Tharyani
le 25 Jan 2022
Hi Ran,
Thanks for your question, and I apologize you are facing this issue.
It is expected that adding STL mesh files for collision geometries to the "rigidBody" via "addCollision" is not supported for code generation. Your suggested workaround should help in resolving your issue, and you are right in that you can't add STL meshes as collision geometries during runtime.
I have conveyed your suggested enhancement to the development team at MathWorks.
Please do not hesitate to reach out to our Technical Support team to share your use case or if you have come across other issues.
Best,
Karsh
0 commentaires
Voir également
Catégories
En savoir plus sur Robotics dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!