Skip to content

Workshop 2: Building Robotic Manipulators with URDF

Athanasios Polydoros edited this page Feb 10, 2026 · 4 revisions

Custom Robotic Arm URDF + RViz & Gazebo

This page describes how to create a custom robotic arm using URDF/Xacro, visualize it in RViz, and spawn it in Gazebo simulation. It assumes you are using ROS 2 and a modern Gazebo / Ignition distribution.

For step‑by‑step code examples, see:


1. Create the URDF/Xacro model

A robotic arm is defined via URDF (Unified Robot Description Format) or Xacro (XML macro language that generates URDF). The key elements are:

  • <link>: Each rigid body (base, arm link, gripper, etc.).
  • <joint>: Constraints between links (revolute, prismatic, etc.).
  • <visual> / <collision>: Geometry, mesh files, and material.
  • <xacro:macro>: Reusable components (optional, improves maintainability).

Recommended workflow:

  1. Design simple CAD geometry for each link (e.g., boxes, cylinders, or meshes).
  2. Export meshes as .stl/.dae and place them in <package>/urdf/meshes/.
  3. Write a modular Xacro file (e.g. my_arm.urdf.xacro) that assembles the arm from base, links, and joints.

See:


2. Create a ROS 2 package structure

Organize your package so ROS tools can find models and launch files:

my_arm_description/
├── CMakeLists.txt
├── package.xml
├── urdf/
│   ├── my_arm.urdf.xacro
│   └── meshes/
│       └── arm_link1.stl
└── config/
    └── rviz/
        └── my_arm.rviz

Clone this wiki locally