AI不追问,组件新增旋转轴字段

This commit is contained in:
lxp
2026-10-14 20:05:22 +08:00
parent abf819eed6
commit dca5a8799f
42 changed files with 1089 additions and 711 deletions
+8 -4
View File
@@ -2,7 +2,7 @@
本文说明前端如何提交拼装需求、展示匹配结果、切换替代组件及加载模型。示例编码和模型域名仅用于说明,实际结果取决于组件库。
文字、图片需求的解析、追问、用户确认和匹配流程见 [需求解析与匹配联调文档](robot-demand-api.md),包含完整入参、SSE、确认和返回示例。本文中的 `POST /api/robot-matches` 保留为直接提交结构化需求的接口,不调用模型;新确认流程使用保存的完整分析,单独返回逐项校验及 `assembly.ready/blocked` 状态。
文字、图片需求的自动理解、选件及装配流程见 [自动生成机器人联调文档](robot-demand-api.md),消息完成事件直接返回 `match`,无需追问或确认。本文中的 `POST /api/robot-matches` 保留为直接提交结构化需求的接口,不调用模型;对话流程使用保存的完整分析,自动返回逐项校验及 `assembly.ready/blocked` 状态。
## 1. 接口总览
@@ -16,6 +16,8 @@
组件匹配和详情无需登录凭证;需求会话使用后端 HttpOnly Cookie 校验访客归属,前端需携带 Cookie。组件使用 `componentCode` 标识,不返回数据库 ID。模型通过响应中的公开 OSS/CDN 地址加载。
新增组件编码格式为 `CW-` 加 16 位随机数字或大写字母(排除 `I/L/O/U`),总长 19,例如 `CW-7K3M9Q2R6V8X4T5N`。旧版 35 字符编码继续有效,以下部分示例保留旧编码。前端将编码视为不透明字符串,直接使用返回值查询和加载,不按固定长度截取或重组。
## 2. 请求与通用返回
POST 请求头:
@@ -207,6 +209,7 @@ X-Request-Id: frontend-match-001
| `material` | string | 材质 |
| `massKg` | number | 组件质量,单位 kg;0 表示未填写 |
| `degreesOfFreedom` | integer | 组件标称自由度 |
| `rotationAxis` | string / null | 组件旋转轴,仅为 `X`、`Y`、`Z`;未设置时为 null,不替代 URDF 关节的 axis |
| `functionDescription` | string | 功能描述 |
| `shape` | string | 形状描述 |
| `size` | string | 大小描述 |
@@ -232,7 +235,7 @@ X-Request-Id: frontend-match-001
{
"componentCode": "CW-00000000000000000000000000000001",
"componentName": "铝合金躯干", "category": "torso_0", "description": "机器人躯干",
"material": "铝合金", "massKg": 2, "degreesOfFreedom": 0,
"material": "铝合金", "massKg": 2, "degreesOfFreedom": 0, "rotationAxis": null,
"functionDescription": "支撑", "shape": "宽躯干", "size": "中型", "torqueNm": 0,
"bomList": {"items": [{"code": "BOLT-M4", "quantity": 4}]},
"urdfInfo": {
@@ -251,7 +254,7 @@ X-Request-Id: frontend-match-001
{
"componentCode": "CW-00000000000000000000000000000002",
"componentName": "右臂", "category": "arm_r", "description": "机器人右臂",
"material": "铝合金", "massKg": 1, "degreesOfFreedom": 4,
"material": "铝合金", "massKg": 1, "degreesOfFreedom": 4, "rotationAxis": null,
"functionDescription": "摆臂", "shape": "", "size": "", "torqueNm": 20,
"bomList": [{"code": "ACTUATOR", "quantity": 4}],
"urdfInfo": {"robotName": "arm", "rootLink": "ARM_BASE", "frames": []},
@@ -275,7 +278,7 @@ X-Request-Id: frontend-match-001
"component": {
"componentCode": "CW-00000000000000000000000000000003",
"componentName": "高扭矩右臂", "category": "arm_r", "description": "机器人右臂",
"material": "铝合金", "massKg": 1.2, "degreesOfFreedom": 4,
"material": "铝合金", "massKg": 1.2, "degreesOfFreedom": 4, "rotationAxis": null,
"functionDescription": "摆臂", "shape": "", "size": "", "torqueNm": 25,
"bomList": [{"code": "ACTUATOR-25", "quantity": 4, "spec": {"torqueNm": 25}}],
"urdfInfo": {"robotName": "arm_v2", "rootLink": "ARM_V2_BASE", "frames": []},
@@ -519,6 +522,7 @@ HTTP 200,完整响应示例:
"material": "铝合金",
"massKg": 2,
"degreesOfFreedom": 0,
"rotationAxis": null,
"functionDescription": "支撑",
"shape": "宽躯干",
"size": "中型",