Introduction to URDF and Xacro
In ROS 2, we use the URDF/Xacro format to represent the robot model. URDF is an XML format, and inside URDF, there are tags to describe the robot’s structure, kinematics, appearances, collision, and basic dynamics parameters. It can also hold simulation tags, which can be used for robot simulators like Gazebo.
Writing URDF can sometimes be lengthy and complex. It doesn’t offer any programmability. We need to add hardcoded values for joints and links. That’s where Xacro comes in. Xacro (or XML Macros) is a tool in ROS 2 to simplify complex URDF files. As the name suggests, it enables us to use macros/functions inside URDF.
Along with macros, we can use variables and conditional statements with XML, making it easier to build, reuse, and modify large robot models. Using Xacro, we can create reusable templates and parameters to make URDF development easier. After creating the URDF model using Xacro, we will use the Xacro tool...