To begin with xacro, we have to specify a namespace so that the file is parsed properly, as shown in the following code snippet:
<?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="mobile">
We must remember that the file must have an xacro extension in place of URDF:
- We can use xacro to declare constant values, just like we do in any other programming language. For example, in the case of the mobile robot which has four wheels with the same values for length and radius, this can be declared and defined as follows:
<xacro:property name="length_wheel" value="0.05" /> <xacro:property name="radius_wheel" value="0.05" />
- These values can be used in the following ways, later in the code: ...