ROS2 URDF — Write a Robot Description

Easy URDF 82% pass rate
#urdf#robot-description#xml#validation

Practice the ROS2 URDF — Write a Robot Description coding problem in URDF. Browser-based execution with automated grading — no local ROS install required. 82% of engineers pass this challenge.

Problem Statement

A robot's physical structure is described in a URDF (Unified Robot Description Format) file — an XML file that defines every rigid link and every joint connecting them.

In this problem, you will write a complete URDF for a simple 2-link robot arm by editing robot.urdf directly. solution.py is already written — it loads your URDF, publishes it, and validates it. Your job is to make the URDF correct.

Requirements

Your robot.urdf must define:

Two links:

  • base_link — the fixed base of the robot. Use a <box size="0.5 0.5 0.1"/> geometry.
  • arm_link — the moving arm segment. Use a <cylinder radius="0.05" length="0.4"/> geometry.

Each link must have a <visual> block containing a <geometry> element.

One joint:

  • shoulder_joint — type revolute, connecting base_link (parent) to arm_link (child)
  • Must include <axis xyz="0 0 1"/>
  • Must include <limit lower="-1.57" upper="1.57" effort="10" velocity="1.0"/>

Input/Output Format

You edit: urdf/robot.urdf Do not edit: solution.py — it loads and validates your URDF automatically

Expected output when testScript runs:

[OK] URDF is well-formed XML
[OK] Robot name: simple_arm
[OK] Links found: ['base_link', 'arm_link']
[OK] All links have <visual> with <geometry>
[OK] Joints found: ['shoulder_joint']
[OK] TF tree has no loops
[PASSED] URDF is valid — 2 links, 1 joints, TF tree is clean

⚠️ Common Pitfalls

  • Joint type attribute is case-sensitive — revolute not Revolute
  • <parent link="..."/> and <child link="..."/> must exactly match your link names
  • Revolute joints require both <axis> and <limit> — missing either will fail
  • Every opening XML tag needs a matching closing tag

📚 Helpful Resources

Frequently asked questions

What is the ROS2 URDF — Write a Robot Description practice problem?

It is a hands-on URDF challenge on SimuCode where you implement and run ROS2 code in the browser with runtime-verified tests.

How do I practice ROS2 URDF — Write a Robot Description online?

Open this page, sign in, and solve the problem in the built-in IDE. Your solution is graded against real ROS2 execution checks.

What skills does ROS2 URDF — Write a Robot Description test?

This Easy problem focuses on urdf, robot-description, xml skills used in robotics interviews and production systems.