URDF robot description authoring and validation. Use when creating, editing, inspecting, validating, or debugging `.urdf` files, robot links, joints, limits, in
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-urdf-2da40e10084e ,按照其中的说明把「urdf」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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, and inertial data.
This skill's commands are thin entrypoints over the cadgen distribution, which
carries the Python build runtime and the JavaScript it executes. Install it once:
python -m pip install -r requirements.txt
Rendering additionally needs a browser, which pip cannot supply:
python -m playwright install chromium
.urdf file is the source of truth. Author and edit URDF XML directly; do not build a Python generation pipeline for it. There is no gen_urdf() contract..urdf file. See references/design-ledger.md.references/frame-semantics.md.references/inertials.md.inertial, visual, and collision separately when the target consumer needs them. Frame-only links may intentionally omit mass and geometry..urdf with cadgen urdf validate before reporting completion. See references/validation.md..urdf remains canonical.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.
.urdf file and its consumers: RViz, robot_state_publisher, Gazebo/Ignition, MoveIt, a real robot driver, or another simulator..urdf itself.references/meshes.md.references/authoring-contract.md for structure, ordering, and naming.references/inertials.md.cadgen urdf validate; fix findings and re-validate until clean.references/validation.md: external tools when available (check_urdf), then a viewer review sweeping every joint.Run cadgen from the Python environment this skill's requirements.txt was installed into (python -m cadgen.cli <verb> with that interpreter is the PATH-independent equivalent). cadgen doctor <skill-dir> verifies the installed cadgen matches this skill's pin — docs drift silently on a mismatched install. Validation itself needs nothing beyond the Python standard library; only snapshots need the browser. Use cadgen <verb> --help for the complete current interface.
The validator shape is:
cadgen urdf validate path/to/robot.urdf
cadgen urdf validate path/to/robot.urdf --strict
cadgen urdf validate path/to/robot.urdf --json
cadgen urdf validate path/to/robot.urdf --packages robot_description=/path/to/pkg
cadgen urdf snapshot path/to/robot.urdf review.png
The validator collects all findings in one pass (severity, code, XML path) across XML structure, tree topology, joint semantics (limits, mimic, dynamics), geometry, mesh references, materials, inertial physics, and misspelled elements, and prints a summary. One run validates ONE file: --strict treats warnings as failures; --json prints one line of {"ok", "path", "issues": [{"severity", "code", "message", "element", "hint"}], "summary"}, where element is the XML path; --packages NAME=PATH resolves package:// mesh URIs and repeats for several roots. It exits nonzero if the target fails. Relative targets resolve from the current working directory; run from the workspace that owns the files.
Validation is a guardrail, not spatial proof: a URDF can pass every structural check while placing a joint in the wrong spot. The ledger and viewer sweep exist for that reason.
cadgen urdf snapshot renders the robot to a PNG still, using the same shared
CLI and headless browser runtime every rendering skill uses — so a snapshot matches what
the CAD Viewer shows.
cadgen urdf snapshot path/to/robot.urdf review.png
It accepts .urdf only. Pose the robot with --joint-values — {joint: degrees} JSON,
joints you do not name staying at the rest pose (the "jointValues" job field is the same
thing in a packet). Robots are authored in metres and are framed on the robot scene scale
automatically.
A normal snapshot uses deterministic light CAD lighting and hides grid and axis guides.
Pass --render light or --render dark (or photographic Render JSON or a file path)
for the shared Render scene. An envelope with no studio resolves Light in the CLI.
Set its camera inside Render JSON; top-level --camera, --display, and --joint-values
control normal snapshots and cannot be combined with Render. Robot link meshes have no CAD-edge or exploded assembly
topology, so those display combinations are rejected clearly.
Link meshes are resolved relative to the description, so they must be present: an
unhydrated Git LFS pointer fails as "No link mesh loaded for robot". Run
git lfs checkout <mesh dir> first.
The grammar is cadgen urdf snapshot TARGET [OUT] [flags], the same one every
format door uses. Use cadgen urdf snapshot --help for the complete current
interface — the flags a robot cannot act on are absent from it, not refused by it.
references/authoring-contract.mdreferences/design-ledger.mdreferences/frame-semantics.mdreferences/meshes.mdreferences/inertials.mdreferences/urdf-workflow.mdreferences/validation.md