ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

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

`'

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

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