MoveIt2 SRDF authoring, validation, and planning-semantics workflow. Use when creating, editing, inspecting, or validating `.srdf` files, MoveIt planning groups
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-srdf-48155f195297 ,按照其中的说明把「srdf」安装到你(当前 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 MoveIt semantic robot descriptions on top of an existing valid URDF. SRDF defines planning semantics; it does not define physical robot structure. The .srdf file is the source of truth: author and edit the XML directly. There is no gen_srdf() contract.
SRDF correctness is a planning semantics problem. The common failure is not invalid XML; it is a plausible SRDF that gives MoveIt the wrong planning group, wrong tool link, wrong default state, unsafe disabled-collision matrix, or wrong joint units. Because language models are weak at spatial and kinematic reasoning, derive planning groups, end effectors, group states, and disabled collisions from the URDF topology, MoveIt Setup Assistant output, sampled collision analysis, or explicit user data. Do not infer them from visual theme alone — and do not type any link or joint name from memory: extract the URDF's link/joint table first and copy names from it.
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
Do not place geometry, inertials, joint origins, link poses, mesh references, physical joint limits, transmissions, or ros2_control interfaces in SRDF.
After completing SRDF work that creates or modifies a .srdf, 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 and validate it. The SRDF pairs with that URDF by colocation and robot name, and every name in the SRDF must exist in it.references/srdf-workflow.md.references/planning-ledger.md before writing XML; keep a compact copy as a comment block in the .srdf..srdf in the same folder as its .urdf, with the same <robot name> — that is the only linking mechanism. The validator and the viewer both resolve the pairing by scanning the folder for the URDF whose robot name matches; exactly one URDF per robot name per folder. No metadata element links the files. See references/authoring-contract.md.references/disabled-collisions.md..srdf with cadgen srdf validate; it cross-validates all names, chains, states, and pairs against the paired URDF. Fix findings and re-validate until clean.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 srdf validate path/to/robot.srdf
cadgen srdf validate path/to/robot.srdf --strict
cadgen srdf validate path/to/robot.srdf --json
The validator parses the SRDF, resolves the paired URDF (the same-folder .urdf whose robot name matches; none, several, or an invalid one is an error), and cross-validates: group/joint/link/subgroup name existence, chain path resolvability, subgroup cycles, virtual/passive joints, end-effector topology, group-state membership/limits/completeness, disabled-collision pairs (including Adjacent-reason truthfulness), and misspelled elements. Each phase collects all its findings in one pass (severity, code, XML path), but a structural error stops the cross-file phase — re-run after every fix. One run validates ONE file: --strict treats warnings as failures and --json prints one line of {"ok", "path", "issues": [{"severity", "code", "message", "element", "hint"}], "summary"}, where element is the XML path. It exits nonzero if the target fails. Relative targets resolve from the current working directory.
<robot name>; that colocation-plus-name match is the only pairing mechanism, and exactly one URDF per robot name may exist in the folder.cadgen 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 snapshot path/to/robot.srdf review.png
Hand it the .srdf; it routes by suffix and renders the paired URDF's geometry. 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.
An SRDF's geometry comes from the URDF beside it, so it has no snapshot door of its
own; the polymorphic cadgen snapshot routes one by suffix. The grammar is
cadgen snapshot TARGET [OUT] [flags], the same one every format door uses. Use
cadgen snapshot --help for the complete current interface.
references/authoring-contract.mdreferences/srdf-workflow.mdreferences/planning-ledger.mdreferences/validation.mdreferences/end-effectors.mdreferences/disabled-collisions.md