-
Notifications
You must be signed in to change notification settings - Fork 0
Workshop 2: Building Robotic Manipulators with URDF
This page describes how to create a custom robotic arm using URDF/Xacro, and visualize it in RViz. It assumes you are using ROS 2 and a modern Gazebo / Ignition distribution.
For step‑by‑step code examples, see:
Follow the ROS tutorial on how to create a package
For this workshop you can create a package with the required dependencies typing:
ros2 pkg create --build-type ament_cmake my_robot_description --dependencies urdf xacro robot_state_publisher
Create a urdf folder within which you will create the urdf file of the robot
Organize your package so ROS tools can find models and launch files:
my_robot_description/
├── CMakeLists.txt
├── package.xml
├── urdf/
│ ├── my_arm.urdf.xacroURDF represents a robot as a tree structure of Links connected by Joints.
A Link is a rigid body. It contains:
-
<visual>: The appearance (mesh or primitive shape). -
<collision>: The simplified shape for the physics engine. -
<inertial>: Mass and inertia matrix (required for Gazebo simulation).
A Joint connects two links. Key attributes:
-
Type:
revolute(limited rotation),continuous(infinite rotation), orfixed. -
Axis: The axis of rotation (e.g.,
0 0 1for Z-axis). - Origin: The XYZ/RPY offset from the parent link.
Create a file named arm.urdf.xacro inside your urdf/ folder.
Design Challenge: Define a robot with the following kinematic chain:
- world (Optional virtual link).
- base_link: Fixed to the world.
- shoulder_link: Rotates around the Z-axis (pan).
Snippet (Base Link):
<link name="base_link">
<visual>
<geometry>
<cylinder length="0.1" radius="0.2"/>
</geometry>
<material name="Gray">
<color rgba="0.5 0.5 0.5 1.0"/>
</material>
</visual>
</link>See:
For a quick inspection of the urdf you can run:
ros2 launch urdf_tutorial display.launch.py model:=path/to/your/arm.urdf