算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
srdf【设计与创意】MoveIt2 SRDF authoring, validation, and planning-semantics workflow. Use when creating, editing, inspecting, or validating `.srdf` files, MoveIt planning groups, virtual joints, passive joints, end effectors, group states, disabled collisions, URDF-paired planning semantics, or SRDF handoff for live review. Use the URDF skill for robot structure and …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
.srdf files, MoveIt planning groups, virtual joints, passive joints, end effectors, group states, disabled collisions, URDF-paired planning semantics, or SRDF handoff for live review. Use the URDF skill for robot structure and the SDF skill for simulator descriptions. Open and visually review existing SRDF files in CAD Viewer.
license: MITProvenance: 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.
Run cadgen through uv, so this skill's commands share one installation, and its warm build daemon, with the CAD app's server:
cadgen below means uvx --no-config --managed-python --python 3.13 --from cadgen==0.7.21 cadgenpython below means uvx --no-config --managed-python --python 3.13 --from cadgen==0.7.21 pythonThe first run downloads that installation and the first snapshot its headless browser; later runs reuse both.
Do not place geometry, inertials, joint origins, link poses, mesh references, physical joint limits, transmissions, or ros2_control interfaces in SRDF.
Show the user each file you create or change, and any they ask to see. Snapshots and validation don't replace this.
If your tools include cad_show (your host may prefix it), use it with the file's
absolute path, and follow its description for when to call it again. cad_view reads
what the user selected; cad_screenshot shows you what they see. Neither is a review
of your own work.
Otherwise run the CAD Viewer, from any folder:
cadgen viewer --host 127.0.0.1 --json --detach
--detach returns once the viewer answers requests and leaves it running in the
background: always pass it, since a foreground viewer never exits (and piping its
output through tail can hide the URL for good). It starts this machine's one viewer,
or reuses it. Read url from its one JSON line (never guess the port), and for each
file return url?file=<its URL-encoded absolute path>. If it fails to launch, say so.
Keep the SRDF beside its uniquely matching URDF (same robot name). Review planning groups, named states and joints; visual review does not prove planning correctness.
$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 as Setup defines it. cadgen doctor <skill-dir> reports the installation in use and checks that it is the one this skill pins — docs drift silently on another. 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 — the same-folder .urdf whose <robot name> matches, exactly as cadgen srdf validate pairs them. No match, or more than one, is refused before anything renders, naming the robot name it looked for and the .urdf files it found. Pose the robot with --joint-values — {joint: degrees} JSON,
joints you do not name staying where the CAD Viewer opens the robot: each at its default, then
this SRDF's home group state if it declares one (the "jointValues" job field is the same
thing in a packet). The snapshot draws the robot with the viewer's own scene, so it shows what
the viewer shows, and a link mesh that cannot be loaded fails it rather than leaving the link
out. Robots are authored in metres and are framed on the robot scene scale automatically.
A normal snapshot uses the Solid preset and Light appearance; omitted groups inherit preset defaults.
Pass --display render for the shared photographic scene. Inline display JSON and
JSON files use grouped settings such as lighting, background, and floor;
appearance is light (default) or dark. Projection and focal length belong
in display.camera. Top-level --camera and --joint-values remain active in every display
mode. The display modes are solid and render: edges, clip, exploded, the
xray, hidden-line and wireframe modes and the hidden/off surface styles
describe a STEP model's CAD edges, parts and solids, and are refused by name here.
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 its paired URDF, 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