¿Is it possible to use the function checkCollision (robotics toolbox) from simulink?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ignacio Fidalgo
il 11 Gen 2022
Commentato: Ignacio Fidalgo
il 13 Gen 2022
I've simulated a robotic environment importing a URDF to simulink and getting the multibody representation of the robot. Now I need to check for self collisions, for that purpouse there's an implemented function in the robotics toolbox called checkCollision with two input arguments, the robot implemented as a rigidBodyTree structure and the joint configuration. This function has no implementation in simulink.
¿Is it possible to call this function from simulink?
So far the main issue that I'm facing is that the rigidBodyTree structure that the function takes as a input argument can't be imported to simulink through from workspace block nor from parameters to MatLab function blocks.
0 Commenti
Risposta accettata
Karsh Tharyani
il 12 Gen 2022
Modificato: Karsh Tharyani
il 12 Gen 2022
Hi Ignacio,
Thanks for your question. You can use a MATLAB Function Block which creates a rigidBodyTree inside of it and then you can call checkCollision inside the block.
As an illustration, see the MATLAB Function Block "checkSelfCollision" in the model and its code below
function y = checkSelfCollision(q)
persistent rbt
if(isempty(rbt))
rbt=importrobot("kinovaGen3.urdf","DataFormat","row");
end
y=checkCollision(rbt,q);
end
Note that you will have to specify the size of input argument "q" of the function block. The size should correspond to the size of the "rigidBodyTree's" joint configuration. In case of the above snippet, the size for the Kinova Gen 3 robot is [1,7] (1-by-7)
I hope this helps in answering your query.
Best,
Karsh
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Code Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!