URDF and SDF Robot Description Formats - Exercises
Exercise 2.1: URDF Fundamentals
Objective: Create a simple robot model with basic links and joints.
- Create a URDF file for a simple wheeled robot with:
- One base link (box shape)
- Two wheel links (cylinder shapes)
- Two continuous joints connecting wheels to base
- Validate your URDF using the
check_urdftool - Visualize the robot using RViz or Gazebo
- Document any issues encountered during validation
Difficulty: Beginner
Exercise 2.2: Xacro Macros Implementation
Objective: Implement a complex robot using Xacro macros to reduce redundancy.
- Take the simple robot from Exercise 2.1 and convert it to use Xacro
- Create a macro for wheels that can be reused for multiple wheels
- Add parameters for wheel radius, width, and position
- Create a second robot model using the same wheel macro but with different parameters
- Compare the code complexity between the original and Xacro versions
Difficulty: Intermediate
Exercise 2.3: Humanoid Robot Modeling
Objective: Create a complete humanoid robot model with proper kinematic chain.
- Extend the example humanoid model from the chapter with:
- Additional joints for shoulder yaw and roll
- Wrist joints for more dexterity
- Feet with ankle joints
- Ensure proper joint limits that reflect human-like movement ranges
- Calculate and verify the total degrees of freedom
- Validate the model and test its kinematic structure
Difficulty: Advanced
Exercise 2.4: Inertial Properties Estimation
Objective: Calculate realistic inertial properties for robot links.
- Choose 3 links from your humanoid robot (torso, upper arm, thigh)
- Estimate their mass based on approximate dimensions and material density (assume aluminum: 2700 kg/m³)
- Calculate their inertia tensors using standard geometric formulas
- Validate that your inertia values are physically plausible
- Test the robot in Gazebo simulation to observe the effect of inertial properties
Difficulty: Intermediate
Exercise 2.5: URDF to SDF Conversion and Enhancement
Objective: Convert a URDF model to SDF and add simulation-specific features.
- Take your humanoid robot URDF and convert it to SDF format
- Add at least 3 different sensor definitions (IMU, camera, LiDAR)
- Include realistic noise models for the sensors
- Add physics properties like friction and contact parameters
- Compare the simulation behavior between the original URDF and enhanced SDF
Difficulty: Advanced
Exercise 2.6: Validation and Debugging
Objective: Validate and debug common URDF issues.
- Create a URDF file with intentional errors (incorrect joint limits, invalid inertia values, etc.)
- Use validation tools to identify the issues
- Correct the errors systematically
- Document the common error types and how to fix them
- Create a validation checklist for future robot models
Difficulty: Intermediate
Exercise 2.7: Multi-Link Chain Optimization
Objective: Optimize a complex robot chain for simulation performance.
- Create a robot with at least 10 links and joints
- Profile the simulation performance in Gazebo
- Optimize the model by:
- Simplifying collision geometries
- Adjusting physics parameters
- Reducing unnecessary visual details
- Measure the performance improvement
- Document the trade-offs between accuracy and performance
Difficulty: Advanced
Solutions Reference
Solutions to these exercises can be found in Chapter 2 Solutions.