Bird
Raised Fist0
ROSframework~20 mins

Building a mobile robot URDF in ROS - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
URDF Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What is the effect of the element in a URDF?
In a URDF file for a mobile robot, what does the element define?
AIt specifies the visual appearance of a robot part.
BIt defines the connection and movement relationship between two links.
CIt sets the robot's sensor parameters.
DIt declares the robot's control algorithms.
Attempts:
2 left
💡 Hint
Think about how parts of a robot are connected and move relative to each other.
📝 Syntax
intermediate
2:00remaining
Identify the syntax error in this URDF snippet
What is wrong with this URDF snippet for a link element? <link name="base_link"> <visual> <geometry> <box size="1 1 0.5"/> </geometry> </visual> </link
ROS
<link name="base_link">
  <visual>
    <geometry>
      <box size="1 1 0.5"/>
    </geometry>
  </visual>
</link>
AThe closing tag for &lt;link&gt; is missing the closing angle bracket '>'.
BThe &lt;geometry&gt; tag is not allowed inside &lt;visual&gt;.
CThe &lt;visual&gt; tag cannot be inside a &lt;link&gt; tag.
DThe size attribute in &lt;box&gt; should use commas instead of spaces.
Attempts:
2 left
💡 Hint
Check the last line carefully for missing characters.
state_output
advanced
2:00remaining
What is the resulting number of links in this URDF?
Given this URDF snippet, how many links does the robot model have? <robot name="simple_bot"> <link name="base_link"/> <link name="wheel_left"/> <link name="wheel_right"/> <joint name="joint_left" type="continuous"> <parent link="base_link"/> <child link="wheel_left"/> </joint> <joint name="joint_right" type="continuous"> <parent link="base_link"/> <child link="wheel_right"/> </joint> </robot>
ROS
<robot name="simple_bot">
  <link name="base_link"/>
  <link name="wheel_left"/>
  <link name="wheel_right"/>
  <joint name="joint_left" type="continuous">
    <parent link="base_link"/>
    <child link="wheel_left"/>
  </joint>
  <joint name="joint_right" type="continuous">
    <parent link="base_link"/>
    <child link="wheel_right"/>
  </joint>
</robot>
A4
B2
C3
D5
Attempts:
2 left
💡 Hint
Count all the <link> elements defined inside the <robot> tag.
🔧 Debug
advanced
2:00remaining
Why does this URDF cause a runtime error in ROS?
This URDF snippet causes a runtime error when loaded in ROS. What is the cause? <joint name="joint1" type="fixed"> <parent link="link1"/> <child link="link2"/> <axis xyz="0 0 1"/> </joint>
ROS
<joint name="joint1" type="fixed">
  <parent link="link1"/>
  <child link="link2"/>
  <axis xyz="0 0 1"/>
</joint>
AThe 'xyz' attribute in 'axis' must have four values instead of three.
BThe 'parent' and 'child' links are reversed.
CThe joint type 'fixed' is not supported in URDF.
DThe 'axis' tag is not allowed in a fixed joint and causes a runtime error.
Attempts:
2 left
💡 Hint
Think about what a fixed joint means for movement and axis.
🧠 Conceptual
expert
3:00remaining
What is the purpose of the tag in a mobile robot URDF?
In a mobile robot URDF, what does the <transmission> tag define?
AIt links actuators to joints, specifying how motor commands translate to joint movement.
BIt defines the robot's communication protocol for sensors.
CIt specifies the visual textures for robot parts.
DIt sets the robot's battery capacity and power limits.
Attempts:
2 left
💡 Hint
Think about how motors control the robot's moving parts.

Practice

(1/5)
1. What does a URDF file primarily describe in ROS for a mobile robot?
easy
A. The robot's parts (links) and how they connect (joints)
B. The robot's sensor data processing algorithms
C. The robot's network communication protocols
D. The robot's battery charging schedule

Solution

  1. Step 1: Understand URDF purpose

    A URDF (Unified Robot Description Format) file describes the physical structure of a robot, including its parts and connections.
  2. Step 2: Identify mobile robot components

    Mobile robots have links (like base and wheels) connected by joints, which URDF models.
  3. Final Answer:

    The robot's parts (links) and how they connect (joints) -> Option A
  4. Quick Check:

    URDF = robot parts and joints [OK]
Hint: URDF = robot structure, not software or data [OK]
Common Mistakes:
  • Confusing URDF with software algorithms
  • Thinking URDF handles communication
  • Assuming URDF manages battery or sensors
2. Which of the following is the correct syntax to define a link named base_link in a URDF file?
easy
A.
B.
C.
D.

Solution

  1. Step 1: Recognize URDF link syntax

    In URDF, links are defined with the <link> tag and a name attribute.
  2. Step 2: Check option correctness

    <link name="base_link"/> uses <link name="base_link"/>, which is correct syntax. Other options use wrong tags or attributes.
  3. Final Answer:

    <link name="base_link"/> -> Option A
  4. Quick Check:

    Link tag uses name attribute [OK]
Hint: Links use syntax in URDF [OK]
Common Mistakes:
  • Using <joint> instead of <link> for links
  • Using id instead of name attribute
  • Using non-existent tags like <base>
3. Given this URDF snippet for a wheel joint:
<joint name="wheel_joint" type="continuous">
  <parent link="base_link"/>
  <child link="wheel_link"/>
</joint>

What does the type="continuous" mean for this joint?
medium
A. The joint rotates but only up to 90 degrees
B. The joint is fixed and cannot move
C. The joint moves only in a straight line
D. The joint can rotate infinitely without limits

Solution

  1. Step 1: Understand joint types in URDF

    URDF joint types include fixed, revolute, continuous, prismatic, etc. Continuous means unlimited rotation.
  2. Step 2: Interpret continuous joint meaning

    Continuous joints rotate endlessly, suitable for wheels that spin freely.
  3. Final Answer:

    The joint can rotate infinitely without limits -> Option D
  4. Quick Check:

    continuous joint = infinite rotation [OK]
Hint: Continuous joint means unlimited rotation [OK]
Common Mistakes:
  • Confusing continuous with fixed joint
  • Thinking continuous means linear movement
  • Assuming rotation limits apply
4. You wrote this URDF joint definition but your robot's wheel does not move:
<joint name="wheel_joint" type="revolute">
  <parent link="base_link"/>
  <child link="wheel_link"/>
</joint>

What is the likely problem?
medium
A. The joint type should be fixed for wheels
B. Missing <limit> tag specifying joint rotation limits
C. The parent and child links are reversed
D. The joint name cannot contain underscores

Solution

  1. Step 1: Check joint type and limits

    Revolute joints require <limit> tags to define rotation range; missing limits can cause no movement.
  2. Step 2: Verify other options

    Fixed joints do not move, so B is wrong. Parent/child order is correct. Underscores are allowed in names.
  3. Final Answer:

    Missing <limit> tag specifying joint rotation limits -> Option B
  4. Quick Check:

    Revolute joints need limits to move [OK]
Hint: Revolute joints need <limit> tags to move [OK]
Common Mistakes:
  • Omitting <limit> tag for revolute joints
  • Using fixed joint for moving parts
  • Swapping parent and child links
  • Thinking joint names can't have underscores
5. You want to build a mobile robot URDF with a base and two wheels. Which joint types and connections correctly model the wheels that spin freely?
hard
A. Use connecting wheel_link to base_link for both wheels
B. Use connecting base_link to wheel_link for both wheels
C. Use connecting base_link to wheel_link for both wheels
D. Use without <limit> tags connecting wheel_link to base_link

Solution

  1. Step 1: Identify wheel joint requirements

    Wheels spin freely, so joints must allow infinite rotation, which is continuous type.
  2. Step 2: Check connection direction and joint type

    Parent link is base_link, child is wheel_link. Continuous joint type is correct for free spinning wheels.
  3. Step 3: Eliminate incorrect options

    Fixed joints don't move. Prismatic joints slide linearly, not rotate. Revolute without limits won't move properly.
  4. Final Answer:

    Use <joint type="continuous"> connecting base_link to wheel_link for both wheels -> Option C
  5. Quick Check:

    Continuous joints + correct parent-child = wheels spin [OK]
Hint: Wheels need continuous joints from base to wheel [OK]
Common Mistakes:
  • Using fixed joints for wheels
  • Using prismatic joints for rotation
  • Omitting limits on revolute joints
  • Reversing parent and child links