Bird
Raised Fist0
ROSframework~20 mins

Building a simple robot arm 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 Robot Arm Master
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's tag in a URDF?
In a URDF file describing a robot arm, the element often contains an tag. What does this tag specify?
AIt defines the position and orientation of the child link relative to the parent link.
BIt specifies the physical material properties of the joint.
CIt sets the maximum torque the joint can apply.
DIt declares the joint's type, such as revolute or fixed.
Attempts:
2 left
💡 Hint
Think about how parts connect and where they are placed in space.
📝 Syntax
intermediate
2:00remaining
Identify the syntax error in this URDF joint definition
Which option contains a syntax error in the URDF joint definition below?
ROS
<joint name="elbow_joint" type="revolute">
  <parent link="upper_arm"/>
  <child link="forearm"/>
  <origin xyz="0 0 0.3" rpy="0 0 0"/>
  <axis xyz="0 1 0"/>
  <limit lower="-1.57" upper="1.57" effort="10" velocity="1.0"/>
</joint>
A
&lt;joint name="elbow_joint" type="revolute"&gt;
  &lt;parent link="upper_arm"/&gt;
  &lt;child link="forearm"/&gt;
  &lt;origin xyz="0 0 0.3" rpy="0 0"/&gt;
  &lt;axis xyz="0 1 0"/&gt;
  &lt;limit lower="-1.57" upper="1.57" effort="10" velocity="1.0"/&gt;
&lt;/joint&gt;
B
&lt;joint name="elbow_joint" type="revolute"&gt;
  &lt;parent link="upper_arm"/&gt;
  &lt;child link="forearm"/&gt;
  &lt;origin xyz="0 0 0.3" rpy="0 0 0"/&gt;
  &lt;axis xyz="0 1 0"/&gt;
  &lt;limit lower="-1.57" upper="1.57" effort="10" velocity="1.0"/&gt;
&lt;/joint&gt;
C
&lt;joint name="elbow_joint" type="revolute"&gt;
  &lt;parent link="upper_arm"/&gt;
  &lt;child link="forearm"/&gt;
  &lt;origin xyz="0 0 0.3" rpy="0 0 0"/&gt;
  &lt;axis xyz="0 1"/&gt;
  &lt;limit lower="-1.57" upper="1.57" effort="10" velocity="1.0"/&gt;
&lt;/joint&gt;
D
&lt;joint name="elbow_joint" type="revolute"&gt;
  &lt;parent link="upper_arm"/&gt;
  &lt;child link="forearm"/&gt;
  &lt;origin xyz="0 0 0.3" rpy="0 0 0"/&gt;
  &lt;axis xyz="0 1 0"/&gt;
  &lt;limit lower="-1.57" upper="1.57" effort="ten" velocity="1.0"/&gt;
&lt;/joint&gt;
Attempts:
2 left
💡 Hint
Check the number of values in the rpy attribute.
state_output
advanced
2:00remaining
What is the resulting number of links in this simple robot arm URDF?
Given the following URDF snippet describing a robot arm, how many links does the robot have?
ROS
<robot name="simple_arm">
  <link name="base_link"/>
  <link name="shoulder_link"/>
  <link name="elbow_link"/>
  <joint name="shoulder_joint" type="revolute">
    <parent link="base_link"/>
    <child link="shoulder_link"/>
  </joint>
  <joint name="elbow_joint" type="revolute">
    <parent link="shoulder_link"/>
    <child link="elbow_link"/>
  </joint>
</robot>
A5
B2
C3
D4
Attempts:
2 left
💡 Hint
Count all unique elements defined.
🔧 Debug
advanced
2:00remaining
Which option causes a runtime error when loading this URDF in ROS?
Consider a URDF with two joints connecting three links. Which option will cause a runtime error due to an invalid joint configuration?
A
&lt;joint name="joint1" type="fixed"&gt;
  &lt;parent link="link1"/&gt;
  &lt;child link="link2"/&gt;
&lt;/joint&gt;
&lt;joint name="joint2" type="revolute"&gt;
  &lt;parent link="link3"/&gt;
  &lt;child link="link4"/&gt;
&lt;/joint&gt;
B
&lt;joint name="joint1" type="fixed"&gt;
  &lt;parent link="link1"/&gt;
  &lt;child link="link2"/&gt;
&lt;/joint&gt;
&lt;joint name="joint2" type="revolute"&gt;
  &lt;parent link="link2"/&gt;
  &lt;child link="link3"/&gt;
&lt;/joint&gt;
C
&gt;tnioj/&lt;
&gt;/"3knil"=knil dlihc&lt;  
&gt;/"2knil"=knil tnerap&lt;  
&gt;"etulover"=epyt "2tnioj"=eman tnioj&lt;
&gt;tnioj/&lt;
&gt;/"2knil"=knil dlihc&lt;  
&gt;/"1knil"=knil tnerap&lt;  
&gt;"dexif"=epyt "1tnioj"=eman tnioj&lt;
D
&lt;joint name="joint1" type="fixed"&gt;
  &lt;parent link="link1"/&gt;
  &lt;child link="link3"/&gt;
&lt;/joint&gt;
&lt;joint name="joint2" type="revolute"&gt;
  &lt;parent link="link2"/&gt;
  &lt;child link="link3"/&gt;
&lt;/joint&gt;
Attempts:
2 left
💡 Hint
Check if any link is used as a child in more than one joint.
🧠 Conceptual
expert
3:00remaining
How does the element affect a robot arm URDF in ROS?
In a robot arm URDF, what is the main purpose of the element?
AIt specifies the visual appearance of the robot links.
BIt defines the physical connection and mechanical reduction between actuators and joints.
CIt sets the collision properties for the robot's links.
DIt declares the sensor data topics for the robot.
Attempts:
2 left
💡 Hint
Think about how motors control the joints.

Practice

(1/5)
1. What is the main purpose of a URDF file in ROS when building a robot arm?
easy
A. To describe the robot's parts and how they connect
B. To write the robot's control software
C. To store sensor data from the robot
D. To compile the robot's firmware

Solution

  1. Step 1: Understand URDF role

    A URDF file defines the robot's physical structure, including parts and joints.
  2. Step 2: Differentiate from other files

    Control software, sensor data, and firmware are handled separately, not in URDF.
  3. Final Answer:

    To describe the robot's parts and how they connect -> Option A
  4. Quick Check:

    URDF = robot structure description [OK]
Hint: URDF = robot parts + connections description [OK]
Common Mistakes:
  • Confusing URDF with control code
  • Thinking URDF stores sensor data
  • Assuming URDF compiles firmware
2. Which of the following is the correct way to define a link in a URDF file?
easy
A.
B.
C.
D.

Solution

  1. Step 1: Identify correct URDF tag for a link

    The <link> tag with a name attribute defines a robot part.
  2. Step 2: Check syntax correctness

    <link name="arm_link"/> uses correct self-closing tag with name attribute. <link arm_link></link> misses quotes and uses open-close tags unnecessarily. Options A and B use wrong tags.
  3. Final Answer:

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

    Link tag syntax = <link name="arm_link"/> [OK]
Hint: Use to define parts [OK]
Common Mistakes:
  • Using <joint> instead of <link> for parts
  • Missing quotes around name
  • Using non-existent <part> tag
3. Given this URDF snippet, what is the parent link of the joint named elbow_joint?
<joint name="elbow_joint" type="revolute">
  <parent link="upper_arm"/>
  <child link="forearm"/>
</joint>
medium
A. wrist
B. elbow_joint
C. forearm
D. upper_arm

Solution

  1. Step 1: Locate parent link in joint tag

    The <parent> tag inside the joint defines the parent link connected by the joint.
  2. Step 2: Read the parent link attribute

    Here, parent link="upper_arm" means the joint connects from upper_arm to forearm.
  3. Final Answer:

    upper_arm -> Option D
  4. Quick Check:

    Parent link = upper_arm [OK]
Hint: Parent link is inside [OK]
Common Mistakes:
  • Confusing parent and child links
  • Choosing joint name as parent
  • Picking child link as parent
4. Identify the error in this URDF joint definition:
<joint name="wrist_joint" type="fixed">
  <parent link="forearm"/>
  <child link="hand">
</joint>
medium
A. Incorrect joint type 'fixed'
B. Parent link name is invalid
C. Missing closing tag for <child>
D. Joint name cannot have underscore

Solution

  1. Step 1: Check XML tag completeness

    The <child> tag is opened but not closed properly.
  2. Step 2: Verify joint type and names

    Joint type 'fixed' is valid, parent link name looks correct, underscores in names are allowed.
  3. Final Answer:

    Missing closing tag for <child> -> Option C
  4. Quick Check:

    Unclosed tag error = Missing closing tag for <child> [OK]
Hint: Check all XML tags are properly closed [OK]
Common Mistakes:
  • Ignoring unclosed tags
  • Thinking 'fixed' is invalid joint type
  • Assuming underscores are disallowed
5. You want to add a new joint connecting the 'forearm' link to a new 'wrist' link with a revolute joint rotating around the Z axis. Which of these URDF snippets correctly defines this joint?
hard
A.
B.
C.
D.

Solution

  1. Step 1: Confirm joint type and link order

    The joint should be revolute, connecting parent 'forearm' to child 'wrist'.
  2. Step 2: Check rotation axis

    The axis must be around Z axis: xyz="0 0 1".
  3. Step 3: Validate options

    <joint name="wrist_joint" type="revolute"> <parent link="forearm"/> <child link="wrist"/> <axis xyz="0 0 1"/> </joint> matches all requirements. <joint name="wrist_joint" type="fixed"> <parent link="wrist"/> <child link="forearm"/> <axis xyz="0 0 1"/> </joint> reverses parent and child and uses fixed type. <joint name="wrist_joint" type="revolute"> <parent link="wrist"/> <child link="forearm"/> <axis xyz="1 0 0"/> </joint> reverses links and uses wrong axis. <joint name="wrist_joint" type="continuous"> <parent link="forearm"/> <child link="wrist"/> <axis xyz="0 1 0"/> </joint> uses continuous type and wrong axis.
  4. Final Answer:

    <joint name="wrist_joint" type="revolute"> <parent link="forearm"/> <child link="wrist"/> <axis xyz="0 0 1"/> </joint> -> Option B
  5. Quick Check:

    Correct joint type + parent-child + axis = <joint name="wrist_joint" type="revolute"> <parent link="forearm"/> <child link="wrist"/> <axis xyz="0 0 1"/> </joint> [OK]
Hint: Parent link first, child second, axis xyz="0 0 1" for Z rotation [OK]
Common Mistakes:
  • Swapping parent and child links
  • Using wrong joint type
  • Setting axis to wrong vector