The URDF vs SDF discussion is something delicate. It is true that SDF is more flexible in terms of simulation as it solves some URDF problems, but URDF has much better integration with ROS and you can easily leverage ROS tools such as TF, etc. It really depends whether the URDF limitations affect your application.
Anyway, it is possible to give parameters to xacro from launchfiles as detailed in this answer. In short, you can write in your launchfile
<param name="robot_description" command="$(find xacro)/xacro.py '$(find my_robot_description)/urdf/my_robot.urdf.xacro' prefix:=$(arg ns)" />
and then use $(arg prefix)
in your xacro file.
Note: As far as I know, there is a limitation with this solution that xacro default values cannot be given, which means that you always have to include your values when calling xacro.py
Originally posted by Javier V. Gómez with karma: 1305 on 2016-01-18
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by AlexandreB on 2016-01-18:
Thanks for the clarification! I heard gazebo is heading towards SDF is that correct?
Comment by Javier V. Gómez on 2016-01-19:
Kind of correct. SDF aims to be an unified format for simulators. Gazebo is not bound to ROS; while URDF is a ROS thing. Therefore, it would not make sense to use URDF if you are using Gazebo but not ROS.