Convert xacro for use in Matlab

asked 2020-10-14 13:33:25 -0500

_fp gravatar image

I am new to ROS and would like to use the following robot models in Matlab: https://github.com/ros-industrial/kuk...

Since I failed to load the xacro models (e.g. kuka_kr6_support/urdf/kr6r900sixx.xacro) directly into Matlab, I want to convert the model first to the URDF format. Solely for this purpose, I have spent many hours trying to install ROS and do the format conversion without success. Problems start with having to use Windows (I use macOS Catalina only, which does not work with ROS) and not knowning anything about ROS in general. I have tried following guides like https://answers.ros.org/question/3256... without success so far. I don't even know where to begin and this seems like huge task just for a simple format conversion.

Now, I have two questions: 1) Will it even be worth it or will I fail to use the model in Matlab anyway? I want to use it for collision detection. 2) Is there anyone who could simply convert the files for me using a working ROS install and send the files to me? This is literally the only task I need ROS for and it should be done by executing one line of code.

edit retag flag offensive close merge delete

Comments

I'm willing to convert some files for you, but you'll have to be more specific than just giving a link to the repository.

I'm not going to convert everything for you.

Alternatively: use Docker and the osrf/ros:melodic-desktop image. You wouldn't need anyone and could do everything yourself.

Problems start with having to use Windows

I don't understand this part of your question. ROS is primarily used on Linux. Where did you understand you "hav[e] to use Windows"?

gvdhoorn gravatar image gvdhoorn  ( 2020-10-14 14:50:26 -0500 )edit

Thanks a lot for responding so quickly. Of course, I don't HAVE to use Windows. But this is what I have available apart from Catalina at the moment. If absolutely needed, I could install a Linux VM but I have no experience with that either. If Docker makes this easier, I can give it a try but again, I have never heard of it. In case, you can directly help me out with converting the files, I am interested in the kr6r900 robot model. However, it seems that there are a lot of common resources used by all models (e. g. located in kuka_resources). I am not sure how to deal with that exactly, but probably this is common and when converting to URDF, everything needed gets packed into one model?

_fp gravatar image _fp  ( 2020-10-14 15:10:41 -0500 )edit
1

Just had an opportunity to convert the file: https://gist.github.com/gavanderhoorn....

However, it seems that there are a lot of common resources used by all models (e. g. located in kuka_resources)

actually only 2 files.

I am not sure how to deal with that exactly, but probably this is common and when converting to URDF, everything needed gets packed into one model?

No, that's not how it works I'm afraid. The URDF still references external files: the Collada meshes.

I looked around a bit and if I'm not mistaken Peter Corke's Robotics Toolbox appears to support loading .xacro directly: petercorke/robotics-toolbox-matlab/URDF.m. Could perhaps be useful.

gvdhoorn gravatar image gvdhoorn  ( 2020-10-20 03:29:47 -0500 )edit

thank you very much! I will let you know if it worked when I get to test it with Matlab.

_fp gravatar image _fp  ( 2020-10-20 09:35:48 -0500 )edit

it totally worked! thank you a million times!

_fp gravatar image _fp  ( 2020-10-20 15:27:43 -0500 )edit

Hello, I am encountering the same issue with a xacro files that I want to use in matlab. I tried to Peter Corke's Robotics Toolbox code but it doesn't convert the file from xacro to urdf. could it be possible to get my file also converted from xacro to urdf ? This is the file location: https://github.com/dingo-cpr/dingo_ma....

jtchapdi gravatar image jtchapdi  ( 2023-01-28 20:40:31 -0500 )edit

I don't run a convert-my-file-to-urdf service, so I'm afraid you'll have to find another way of converting the model you link to.

gvdhoorn gravatar image gvdhoorn  ( 2023-01-29 05:05:23 -0500 )edit