# Convert xacro to sdf when catkin_make is used

Hi all,

I have a model defined in xacro file with gazebo extension, similar to files rrbot.xacro and rrbot.gazebo as described in this tutorial. In my project I sometimes want to use urdf and sometimes sdf, which I generate using the following commands:

rosrun xacro xacro --inorder -o rrbot.urdf rrbot.xacro
gz sdf -p rrbot.urdf > rrbot.sdf


The problem is that mesh paths in sdf are absolute. This is inconvenient if I want to share my package. Is there a way to automatically convert rrbot.xacro to rrbot.sdf, for example when I build all packages using catkin_make?

edit retag close merge delete

That's what I did, but the relative path is converted to absolute by rosrun .... However, the following path definition model://low_poly_paddle.stl stays relative even after conversion. I think this is a good enough solution for me!