Guide for creating appropriate geometry in URDF files - basic shapes vs OpenSCAD vs mesh files
This skill helps you choose and create the right type of geometry for robot links in URDF files.
Use this skill when:
Basic geometry types in URDF:
<box size="x y z"/> - Rectangular boxes<cylinder radius="r" length="l"/> - Cylinders<sphere radius="r"/> - SpheresUse basic geometry when:
Example:
<link name="base_link">
<visual>
<geometry>
<box size="0.5 0.3 0.1"/>
</geometry>
<material name="gray">
<color rgba="0.7 0.7 0.7 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.5 0.3 0.1"/>
</geometry>
</collision>
</link>
If basic geometry won't work, you have two options:
Use OpenSCAD when:
Advantages:
Process:
meshes/ folder)Example:
// meshes/custom_bracket.scad
module bracket(width=50, height=30, thickness=5) {
difference() {
// Main body
cube([width, height, thickness]);
// Mounting holes
translate([10, height/2, 0])
cylinder(h=thickness, r=3);
translate([width-10, height/2, 0])
cylinder(h=thickness, r=3);
}
}
bracket(width=60, height=40, thickness=6);
<!-- Reference in URDF -->
<link name="mounting_bracket">
<visual>
<geometry>
<mesh filename="package://my_robot/meshes/custom_bracket.stl"/>
</geometry>
</visual>
</link>
Use existing meshes when:
Supported formats:
.stl - Standard Tessellation Language (most common).dae - COLLADA (supports colors and textures).glb/.gltf - GL Transmission FormatImportant checks:
package://robot_name/meshes/part.stlExample:
<link name="sensor_housing">
<visual>
<geometry>
<mesh filename="package://my_robot/meshes/housing.stl" scale="0.001 0.001 0.001"/>
</geometry>
</visual>
</link>
Before creating custom OpenSCAD code, check for existing libraries:
Common OpenSCAD libraries:
Check available libraries:
Example using MCAD:
include <MCAD/motors.sh>
use <MCAD/gears.scad>
// Use predefined motor mount
motorWidth = 28;
motorHeight = 46;
motorLength = 42;
stepper_motor_mount(28);
Visual geometry:
Collision geometry:
Example:
<link name="gripper">
<!-- Detailed visual -->
<visual>
<geometry>
<mesh filename="package://my_robot/meshes/gripper_detailed.stl"/>
</geometry>
</visual>
<!-- Simple collision (box approximation) -->
<collision>
<geometry>
<box size="0.08 0.12 0.05"/>
</geometry>
</collision>
</link>
meshes/ directory, OpenSCAD in scad/ or meshes/❌ Don't:
✅ Do:
User request: "I need a wheel for my robot"
Decision process:
Response:
For a basic wheel, I'll use a cylinder:
```xml
<link name="wheel">
<visual>
<geometry>
<cylinder radius="0.1" length="0.05"/>
</geometry>
<material name="black">
<color rgba="0.1 0.1 0.1 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder radius="0.1" length="0.05"/>
</geometry>
</collision>
</link>
If you need a more detailed wheel with treads, I can create an OpenSCAD file. Would you like me to do that?
## Extension Integration
This skill works with the URDF editor's features:
- **Auto-conversion**: .scad files automatically convert to .stl
- **Preview**: See geometry in 3D immediately
- **Library discovery**: Access to configured OpenSCAD libraries
- **Validation**: Schema validation ensures correct URDF syntax
## Summary
**Decision flow:**
1. Basic geometry (box/cylinder/sphere)? → Use it
2. Need custom shape? → Ask user → Create OpenSCAD file
3. Have existing mesh? → Verify existence → Reference it
4. Always use simple collision geometry
5. Test with preview command
npx skills add Ranch-Hand-Robotics/urdf-geometry下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer