urdf
它能做什么
这个技能指导你的 AI 创建和检查 URDF 文件,它描述机器人的连杆、关节和形状。适合构建或调试机器人模型的机器人工程师。
适用场景
- ✓当你为机器人创建或编辑 URDF 文件时。
- ✓当机器人的关节或坐标系在查看器或仿真器中表现错误时。
- ✓当你需要在 URDF 中检查关节限位、惯性或碰撞几何时。
技能链接
https://github.com/earthtojake/text-to-cad/blob/main/skills/urdf/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“能为一个带有关节限位的两关节机械臂编写 URDF,并检查它是否有效吗?”
每周 5 个新技能,1 分钟读完。
工作原理
AI 直接编写 URDF XML,首先在文件顶部记录坐标系和单位的假设。然后它验证文件,以发现坐标系、轴和单位中的错误。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
URDF
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.
Setup
Run the cad command (~/.local/bin/cad where ~/.local/bin is not on your PATH, or where a
project's environment puts its own cad first; cad.cmd on Windows). If cad is not found and
the CAD app was only just added, its server may still be starting: wait five seconds and run the
command again, for up to a minute, before anything else. Otherwise install text-to-cad, outside a sandbox or with its permission:
curl -fsSL https://texttocad.dev/install.sh | sh
On Windows, in PowerShell: irm https://www.texttocad.dev/install.ps1 | iex. Any other failure
says what to do, and cad doctor explains the installation.
Core Rules
- The
.urdffile is the source of truth. Author and edit URDF XML directly; do not build a Python generation pipeline for it. - Before writing or changing URDF XML, establish the robot's frame, joint, geometry, unit, and assumption ledger and embed it as a comment block at the top of the
.urdffile. Seereferences/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.
- Never freehand numeric values that are the result of computation — inertia tensors, centers of mass, unit conversions across many links, mirrored transforms. Compute them: closed-form formulas for primitives, or a throwaway helper script for mesh-derived values. See
references/inertials.md. - For physical links, model
inertial,visual, andcollisionseparately when the target consumer needs them. Frame-only links may intentionally omit mass and geometry. - Validate every created or modified
.urdfwithcad urdf validatebefore reporting completion. Seereferences/validation.md. - Helper scripts are allowed and encouraged for computation, but they are scaffolding, not the artifact's source of truth. For complex or genuinely parametric models it is reasonable to keep a model-local helper script on disk next to related source code (for example STEP generator sources) and note it in the ledger; this is optional, and the checked-in
.urdfremains canonical.
Show the model
Show the user each model you create or change, and any model or file they ask to see.
A file you export is a download: give its path, do not open it.
Snapshots and validation don't replace this. Never screenshot the viewer to confirm your
own work; review with cad snapshot.
If your tools include
cad_show(your host may prefix it), call it with the model's id or the file's absolute path, and follow its description for when to call it again. The other tools depend on the host. A host that draws CAD cards or tabs (Claude Desktop, the Codex app) also hascad_view, which reads what the user selected, andcad_screenshot, which shows you what they see, both of a card or tab that is open, for when they ask about it. A text host (Claude Code in a terminal,codex exec) draws nothing: itscad_showopens the model's page in the user's browser and answers with the URL to give them, and it has no view to read.cad_inspect,cad_snapshotandcad_exportare on every host. Call only the tools you have, and never say a card shows a model when your host drew none.Otherwise give the user the page's link once: a model's page is the
view:line its run prints. For a file, run the CAD Viewer, from any folder:cad viewer --json FILE [FILE ...]The command ensures this installation's server, registers each file and prints its page,
/<id>, then exits. Read each file'surlfromdocumentsin its one JSON line (never guess the port); the URL carries its token query. A page follows every later run of its model and every rewrite of its file, so share it once. Return that link to the user. If it fails to launch, say so.
A .urdf you write is the robot's model, not an export: show it. Review mesh scale
and placement, then sweep every movable joint against
常见问题
什么是 URDF?
它是一种 XML 格式,用于描述机器人的各个部件以及它们如何连接。
它涵盖规划设置吗?
不涵盖。MoveIt 的规划设置在 SRDF 技能中。
它涵盖 CAD 文件本身吗?
不涵盖。它涵盖机器人描述,而它引用的网格文件是单独的。
详情
作者的原始描述
URDF robot description authoring and validation. Use when creating, editing, inspecting, validating, or debugging `.urdf` files, robot links, joints, limits, inertials, visual/collision geometry, mesh references, frame conventions, or robot-description artifacts. Covers the robot's structure, not MoveIt2 semantic groups or IK/path-planning semantics (SRDF), and not the STEP/STL/3MF/DXF/GLB files its meshes come from. Open and visually review existing URDF files in CAD Viewer.
repo: earthtojake/text-to-cad
热度
- GitHub 星标
- 25k
- 排名
- #10077
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …