# Revision history [back]

Xacro is just a scriptig mechanism that allows more modularity and code re-use when defining a URDF model. When using it, what is actually uploaded to the parameter servers (per default as the "robot_description" parameter) actually is a URDF, as that gets generated from the xacro file in the launch file (by expanding the xacro macros used).

As an example, say you have a "robot.urdf.xacro" file. You can run

rosrun xacro xacro.py robot.urdf.xacro > robot.urdf


and that gives you the URDF generated from your xacro file. The same approach is commonly used in launch files when a xacro-based robot_description is uploaded.

Xacro is just another way of defining a URDF, not an alternative to it. It makes certain things easier, for instance you can generate a "wheel" macro and instantiate that 6 times with different parameters to put 6 wheels on your robot, as opposed to copying and pasting the same code six times manually.

Xacro is just a scriptig scripting mechanism that allows more modularity and code re-use when defining a URDF model. When using it, what is actually uploaded to the parameter servers (per default as the "robot_description" parameter) actually is a URDF, as that gets generated from the xacro file in the launch file (by expanding the xacro macros used).

As an example, say you have a "robot.urdf.xacro" file. You can run

rosrun xacro xacro.py robot.urdf.xacro > robot.urdf


and that gives you the URDF generated from your xacro file. The same approach is commonly used in launch files when a xacro-based robot_description is uploaded.

Xacro is just another way of defining a URDF, not an alternative to it. It makes certain things easier, for instance you can generate a "wheel" macro and instantiate that 6 times with different parameters to put 6 wheels on your robot, as opposed to copying and pasting the same code six times manually.