urdf
earthtojake/text-to-cad
Generate and validate URDF robot descriptions from Python sources with frame-aware kinematic modeling.
What is urdf?
This skill generates URDF robot-description files from Python `gen_urdf()` sources and validates them at generation time. Use it when creating, editing, or debugging robot kinematics, joint limits, inertials, geometry, mesh references, and frame conventions. It enforces frame semantics, unit consistency, and spatial correctness to catch kinematic errors early.
- Generate URDF files from Python source definitions with `scripts/urdf`
- Validate generated URDFs at generation time for XML, graph, joint, geometry, and inertial correctness
- Enforce URDF frame semantics for joint origins, link frames, joint axes, and visual/collision/inertial origins
- Support multi-target generation with custom output paths using `SOURCE.py=OUTPUT.urdf` syntax
- Integrate with design ledgers and frame-semantics references to document spatial assumptions
- Hand off completed URDF files to CAD Viewer for visualization and consumer smoke testing
How to install urdf
npx skills add https://github.com/earthtojake/text-to-cad --skill urdf- Python 3 interpreter (standard library only for generation and validation)
- Project or workspace directory containing `gen_urdf()` Python sources
- Downstream consumers (RViz, Gazebo, MoveIt) require their own runtime packages
How to use urdf
- 1.Identify the `gen_urdf()` Python source file and target `.urdf` output location
- 2.Establish a design ledger documenting robot frames, joints, geometry, units, and spatial assumptions (see `references/design-ledger.md`)
- 3.Review frame semantics in `references/frame-semantics.md` to understand joint origins, link frames, and axis conventions
- 4.Edit the Python generator source (not the generated URDF XML) to define links, joints, limits, inertials, and geometry
- 5.Run `python scripts/urdf path/to/source.py` to generate and validate the URDF; use `-o path/to/robot.urdf` for custom output or `SOURCE.py=OUTPUT.urdf` pairs for multi-target generation
- 6.Review validation errors and correct the Python source or spatial data
- 7.Run a consumer smoke test (RViz display, robot_state_publisher tree, Gazebo load, or MoveIt model load) to verify correctness
- 8.Hand the generated `.urdf` file path to `$cad-viewer` for visualization if that skill is installed
Use cases
- Create a new robot kinematic model by defining links, joints, and geometry in Python, then generate and validate the URDF
- Debug joint-axis misalignment or frame-placement errors by consulting frame-semantics reference and regenerating
- Regenerate a URDF after updating mesh exports or CAD transforms to ensure spatial consistency
- Inspect generated URDF artifacts for unit consistency, mesh-scale correctness, and inertial data before passing to RViz or Gazebo
- Maintain multiple robot variants by generating several URDF targets from related Python sources in one command
- Robot engineers designing or debugging kinematics and joint constraints
- Developers integrating robot descriptions with RViz, Gazebo, Ignition, or MoveIt
- Teams maintaining robot-description repositories with generated URDF artifacts
- Anyone working with URDF frame semantics, inertial properties, or mesh references
urdf FAQ
Always edit the Python `gen_urdf()` source. Treat generated `.urdf` files as artifacts. This ensures changes are auditable, reproducible, and not lost on regeneration.
The validator checks XML well-formedness, graph connectivity, joint axis semantics, geometry references, mesh paths, inertial data consistency, and frame correctness. It fails fast to catch kinematic errors before downstream consumers encounter them.
Use the syntax `python scripts/urdf path/to/a.py=out/a.urdf path/to/b.py=out/b.urdf` to generate several targets in one command with custom output paths.
Consult your design ledger and frame-semantics reference to document assumptions. If geometry or mesh exports changed, regenerate those artifacts with the owning CAD or mesh workflow first, then regenerate the URDF.
Use SRDF for MoveIt2 semantic groups and IK/path-planning semantics. Use CAD for STEP/STL/3MF/DXF/GLB outputs. Use cad-viewer for local MoveIt2 server controls and visualization.
Full instructions (SKILL.md)
Source of truth, from earthtojake/text-to-cad.
name: urdf
description: URDF robot description generation and default generation-time validation. Use when creating, editing, regenerating, inspecting, or debugging .urdf files, Python gen_urdf() sources, robot links, joints, limits, inertials, visual/collision geometry, mesh references, frame conventions, or generated robot-description artifacts. Use the SRDF skill for MoveIt2 semantic groups and IK/path-planning semantics; use the cad-viewer skill for local MoveIt2 server controls; use the CAD skill for STEP/STL/3MF/DXF/GLB outputs.
URDF
Provenance: maintained in earthtojake/text-to-cad. Use the installed local skill files as the runtime source of truth; the repository link is only for provenance and release review.
Use this skill for URDF robot-description outputs. Treat URDF work as constrained kinematic modeling, not just XML writing. The main correctness risks are frame placement, joint-axis semantics, unit consistency, mesh scale, inertial data, and generated-artifact drift.
Core Rules
- Treat the Python source that defines
gen_urdf()as the source of truth. Treat configured.urdffiles as generated artifacts. - Generate only explicit URDF targets. Do not regenerate unrelated CAD, mesh, render, SRDF, SDF, or simulator artifacts from this skill.
- The
scripts/urdfgenerator validates generated URDFs by default. Do not use or document a separatevalidatecommand. - Before writing or changing URDF XML, establish the robot's frame, joint, geometry, unit, and assumption ledger. See
references/design-ledger.md. - Use URDF frame semantics exactly. Joint origins, link frames, joint axes, and visual/collision/inertial origins use different reference frames. See
references/frame-semantics.md. - Do not infer spatial transforms, mesh units, handedness, axes, or joint signs from vague prose. Use CAD transforms, dimensioned drawings, measured values, existing source data, or explicit documented assumptions.
- Prefer simple, auditable generator code over clever XML construction. Keep constants named by physical meaning, not by arbitrary numbers.
- For physical links, model
inertial,visual, andcollisionseparately when the target consumer needs them. Frame-only links may intentionally omit mass and geometry.
CAD Viewer Handoff
After completing URDF work that creates or modifies a .urdf, you must ALWAYS hand the explicit file path to $cad-viewer when that skill is installed. $cad-viewer must start CAD Viewer if it is not already running and return link(s) to the relevant created or updated file(s); if $cad-viewer is unavailable or startup fails, report that instead of silently omitting the handoff.
Workflow
- Identify the
gen_urdf()Python source and target.urdfoutput. - Identify target consumers: RViz, robot_state_publisher, Gazebo/Ignition, MoveIt, a real robot driver, or another simulator.
- Read or create the design ledger before editing frames, origins, axes, mesh scale, limits, or inertials.
- Edit the generator source, not generated URDF XML.
- Regenerate only explicit targets with
scripts/urdf. - Let generation-time validation fail fast on XML, graph, joint, geometry, mesh-reference, and inertial problems.
- When geometry or mesh references depend on changed CAD or exported mesh outputs, regenerate those explicit artifacts with the owning CAD or mesh workflow, then regenerate the affected URDF target.
- When available, run a consumer smoke test appropriate to the target: RViz display, robot_state_publisher tree, Gazebo/Ignition loading, or MoveIt model loading.
- Report remaining assumptions, unchecked spatial data, and validation/smoke-test gaps.
Commands
Run with the Python environment for the project or workspace. Treat python in examples as an interpreter placeholder; if bare python is unavailable, substitute python3, a project virtualenv interpreter, or the configured interpreter path. The URDF generator and lightweight validator use only the Python standard library; downstream consumers such as RViz, Gazebo, or MoveIt may need their own runtime packages.
From this skill directory, the launcher shape is:
python scripts/urdf path/to/source.py
python scripts/urdf path/to/source.py -o path/to/robot.urdf
python scripts/urdf path/to/a.py=out/a.urdf path/to/b.py=out/b.urdf
Plain Python targets write a sibling .urdf beside the source. -o/--output is valid only with one plain target. Use SOURCE.py=OUTPUT.urdf pairs for custom multi-target destinations.
Relative source targets and CLI output overrides are resolved from the current working directory. When running from outside this skill directory, prefix the launcher path so target files still resolve from the intended workspace.
The launcher executes only gen_urdf() and validates the generated URDF output. It does not provide a separate validation-only command.
References
- Design ledger:
references/design-ledger.md - Frame semantics:
references/frame-semantics.md - URDF generator contract:
references/generator-contract.md - URDF generation command:
references/gen-urdf.md - URDF edit workflow:
references/urdf-workflow.md - Generation-time validation expectations:
references/validation.md
Related skills
More from earthtojake/text-to-cad and the wider catalog.
cad
Create, modify, and validate parametric CAD parts and assemblies from natural language, technical drawings, or STEP files.
step-parts
Search and download off-the-shelf CAD parts from step.parts catalog—actuators, motors, connectors, fasteners, and more.
sdf
Generate, validate, and hand off SDFormat models and worlds for Gazebo and other simulators.
srdf
MoveIt2 SRDF generation, validation, and planning-semantics workflow for robot manipulation.
sendcutsend
Preflight validation for SendCutSend.com DXF and STEP/STP orders against official specs and ordering rules.
cad-viewer
Start a local CAD Viewer and generate review links for STEP, STL, implicit CAD, G-code, URDF, and other model files.