ccg-ros2-workflow 1.4.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +128 -241
- package/bin/ccg.mjs +2 -0
- package/bin/codeagent-wrapper-darwin-amd64 +0 -0
- package/bin/codeagent-wrapper-darwin-arm64 +0 -0
- package/bin/codeagent-wrapper-linux-amd64 +0 -0
- package/bin/codeagent-wrapper-linux-arm64 +0 -0
- package/bin/codeagent-wrapper-windows-amd64.exe +0 -0
- package/bin/codeagent-wrapper-windows-arm64.exe +0 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +173 -0
- package/dist/index.d.mts +229 -0
- package/dist/index.d.ts +229 -0
- package/dist/index.mjs +12 -0
- package/dist/shared/ccg-ros2-workflow.CpLJvcLP.mjs +2274 -0
- package/package.json +85 -22
- package/templates/commands/agents/planner.md +345 -0
- package/templates/commands/agents/system-integrator.md +397 -0
- package/{src/commands/ccg → templates/commands}/analyze.md +17 -17
- package/{src/commands/ccg → templates/commands}/backend.md +25 -25
- package/{src/commands/ccg → templates/commands}/debug.md +12 -12
- package/{src/commands/ccg → templates/commands}/execute.md +24 -23
- package/{src/commands/ccg → templates/commands}/feat.md +21 -21
- package/{src/commands/ccg → templates/commands}/frontend.md +26 -26
- package/{src/commands/ccg → templates/commands}/optimize.md +24 -24
- package/{src/commands/ccg → templates/commands}/plan.md +20 -19
- package/{src/commands/ccg → templates/commands}/review.md +9 -9
- package/templates/commands/spec-impl.md +123 -0
- package/templates/commands/spec-init.md +91 -0
- package/templates/commands/spec-plan.md +109 -0
- package/templates/commands/spec-research.md +104 -0
- package/templates/commands/spec-review.md +120 -0
- package/{src/commands/ccg → templates/commands}/test.md +23 -23
- package/templates/commands/workflow.md +193 -0
- package/{src/commands/ccg → templates/commands}/worktree.md +8 -8
- package/templates/prompts/claude/analyzer.md +59 -0
- package/templates/prompts/claude/architect.md +54 -0
- package/templates/prompts/claude/debugger.md +71 -0
- package/templates/prompts/claude/optimizer.md +73 -0
- package/templates/prompts/claude/reviewer.md +63 -0
- package/templates/prompts/claude/tester.md +69 -0
- package/templates/prompts/codex/analyzer.md +50 -0
- package/templates/prompts/codex/architect.md +46 -0
- package/templates/prompts/codex/debugger.md +66 -0
- package/templates/prompts/codex/optimizer.md +74 -0
- package/templates/prompts/codex/reviewer.md +66 -0
- package/templates/prompts/codex/tester.md +55 -0
- package/templates/prompts/gemini/analyzer.md +53 -0
- package/templates/prompts/gemini/architect.md +47 -0
- package/templates/prompts/gemini/debugger.md +70 -0
- package/templates/prompts/gemini/frontend.md +56 -0
- package/templates/prompts/gemini/optimizer.md +77 -0
- package/templates/prompts/gemini/reviewer.md +73 -0
- package/templates/prompts/gemini/tester.md +61 -0
- package/bin/cli.js +0 -903
- package/src/agents/ccg/planner.md +0 -358
- package/src/agents/ccg/system-integrator.md +0 -627
- package/src/codeagent-wrapper.sh +0 -86
- package/src/commands/ccg/workflow.md +0 -212
- package/src/config.toml +0 -36
- package/src/prompts/claude/analyzer.md +0 -25
- package/src/prompts/claude/architect.md +0 -25
- package/src/prompts/claude/debugger.md +0 -24
- package/src/prompts/claude/optimizer.md +0 -25
- package/src/prompts/claude/reviewer.md +0 -26
- package/src/prompts/claude/tester.md +0 -24
- package/src/prompts/codex/analyzer.md +0 -32
- package/src/prompts/codex/architect.md +0 -42
- package/src/prompts/codex/debugger.md +0 -24
- package/src/prompts/codex/optimizer.md +0 -25
- package/src/prompts/codex/reviewer.md +0 -32
- package/src/prompts/codex/tester.md +0 -24
- package/src/prompts/gemini/analyzer.md +0 -32
- package/src/prompts/gemini/architect.md +0 -34
- package/src/prompts/gemini/debugger.md +0 -24
- package/src/prompts/gemini/frontend.md +0 -25
- package/src/prompts/gemini/optimizer.md +0 -25
- package/src/prompts/gemini/reviewer.md +0 -32
- package/src/prompts/gemini/tester.md +0 -24
- /package/{src/agents/ccg → templates/commands/agents}/get-current-datetime.md +0 -0
- /package/{src/agents/ccg → templates/commands/agents}/init-architect.md +0 -0
- /package/{src/commands/ccg → templates/commands}/clean-branches.md +0 -0
- /package/{src/commands/ccg → templates/commands}/commit.md +0 -0
- /package/{src/commands/ccg → templates/commands}/enhance.md +0 -0
- /package/{src/commands/ccg → templates/commands}/init.md +0 -0
- /package/{src/commands/ccg → templates/commands}/rollback.md +0 -0
package/package.json
CHANGED
|
@@ -1,40 +1,103 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccg-ros2-workflow",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "ROS2 Multi-
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "ROS2 Multi-Model Collaborative Development Workflow - Codex (Low-level Control) + Gemini (Upper-layer Application) + Claude (Orchestration)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.17.1",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "CCG Contributors"
|
|
8
9
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/GuYu-001/ccg-ros2-workflow.git"
|
|
11
14
|
},
|
|
12
15
|
"keywords": [
|
|
13
16
|
"ros2",
|
|
14
17
|
"humble",
|
|
15
|
-
"
|
|
18
|
+
"robotics",
|
|
19
|
+
"claude",
|
|
16
20
|
"codex",
|
|
17
21
|
"gemini",
|
|
18
22
|
"multi-model",
|
|
19
|
-
"
|
|
23
|
+
"ai",
|
|
24
|
+
"collaboration",
|
|
25
|
+
"cli",
|
|
20
26
|
"workflow"
|
|
21
27
|
],
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "https://github.com/GuYu-001/ccg-ros2-workflow.git"
|
|
27
|
-
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=16.0.0"
|
|
28
|
+
"bin": {
|
|
29
|
+
"ccg-ros2-workflow": "bin/ccg.mjs"
|
|
30
30
|
},
|
|
31
|
+
"main": "dist/index.mjs",
|
|
32
|
+
"module": "dist/index.mjs",
|
|
33
|
+
"types": "dist/index.d.mts",
|
|
31
34
|
"files": [
|
|
32
|
-
"bin
|
|
33
|
-
"
|
|
35
|
+
"bin",
|
|
36
|
+
"dist",
|
|
37
|
+
"templates/commands/analyze.md",
|
|
38
|
+
"templates/commands/backend.md",
|
|
39
|
+
"templates/commands/clean-branches.md",
|
|
40
|
+
"templates/commands/commit.md",
|
|
41
|
+
"templates/commands/debug.md",
|
|
42
|
+
"templates/commands/enhance.md",
|
|
43
|
+
"templates/commands/execute.md",
|
|
44
|
+
"templates/commands/feat.md",
|
|
45
|
+
"templates/commands/frontend.md",
|
|
46
|
+
"templates/commands/init.md",
|
|
47
|
+
"templates/commands/optimize.md",
|
|
48
|
+
"templates/commands/plan.md",
|
|
49
|
+
"templates/commands/review.md",
|
|
50
|
+
"templates/commands/rollback.md",
|
|
51
|
+
"templates/commands/test.md",
|
|
52
|
+
"templates/commands/workflow.md",
|
|
53
|
+
"templates/commands/worktree.md",
|
|
54
|
+
"templates/commands/spec-init.md",
|
|
55
|
+
"templates/commands/spec-research.md",
|
|
56
|
+
"templates/commands/spec-plan.md",
|
|
57
|
+
"templates/commands/spec-impl.md",
|
|
58
|
+
"templates/commands/spec-review.md",
|
|
59
|
+
"templates/commands/agents/",
|
|
60
|
+
"templates/prompts/codex/",
|
|
61
|
+
"templates/prompts/gemini/analyzer.md",
|
|
62
|
+
"templates/prompts/gemini/architect.md",
|
|
63
|
+
"templates/prompts/gemini/debugger.md",
|
|
64
|
+
"templates/prompts/gemini/frontend.md",
|
|
65
|
+
"templates/prompts/gemini/optimizer.md",
|
|
66
|
+
"templates/prompts/gemini/reviewer.md",
|
|
67
|
+
"templates/prompts/gemini/tester.md",
|
|
68
|
+
"templates/prompts/claude/"
|
|
34
69
|
],
|
|
70
|
+
"engines": {
|
|
71
|
+
"node": ">=20.0.0"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"dev": "tsx src/cli.ts",
|
|
75
|
+
"build": "unbuild",
|
|
76
|
+
"start": "node bin/ccg.mjs",
|
|
77
|
+
"typecheck": "tsc --noEmit",
|
|
78
|
+
"prepublishOnly": "npm run build",
|
|
79
|
+
"lint": "eslint",
|
|
80
|
+
"lint:fix": "eslint --fix"
|
|
81
|
+
},
|
|
35
82
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
83
|
+
"ansis": "^4.1.0",
|
|
84
|
+
"cac": "^6.7.14",
|
|
85
|
+
"fs-extra": "^11.3.2",
|
|
86
|
+
"i18next": "^25.5.2",
|
|
87
|
+
"i18next-fs-backend": "^2.6.0",
|
|
88
|
+
"inquirer": "^12.9.6",
|
|
89
|
+
"ora": "^9.0.0",
|
|
90
|
+
"pathe": "^2.0.3",
|
|
91
|
+
"smol-toml": "^1.4.2"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
95
|
+
"@types/fs-extra": "^11.0.4",
|
|
96
|
+
"@types/inquirer": "^9.0.9",
|
|
97
|
+
"@types/node": "^22.0.0",
|
|
98
|
+
"eslint": "^9.36.0",
|
|
99
|
+
"tsx": "^4.20.5",
|
|
100
|
+
"typescript": "^5.9.2",
|
|
101
|
+
"unbuild": "^3.6.1"
|
|
39
102
|
}
|
|
40
103
|
}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: planner
|
|
3
|
+
description: 📋 ROS2 任务规划师 - 使用 WBS 方法论分解机器人功能需求为可执行任务
|
|
4
|
+
tools: Read, Write, mcp__ace-tool__search_context
|
|
5
|
+
color: blue
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
你是一位资深的 ROS2 项目规划师,擅长使用 WBS(工作分解结构)方法论将复杂机器人功能需求分解为清晰的任务清单。
|
|
9
|
+
|
|
10
|
+
## 核心职责
|
|
11
|
+
|
|
12
|
+
1. **需求分析**:理解功能目标、范围、约束条件
|
|
13
|
+
2. **任务分解**:功能 → 模块 → 节点/包 → 具体步骤
|
|
14
|
+
3. **依赖识别**:标注任务间的前后依赖关系
|
|
15
|
+
4. **工作量估算**:使用"任务点"为单位(1点 ≈ 1-2小时)
|
|
16
|
+
|
|
17
|
+
## 工作流程
|
|
18
|
+
|
|
19
|
+
### 步骤 1:理解需求
|
|
20
|
+
|
|
21
|
+
分析用户需求,明确:
|
|
22
|
+
- 机器人功能目标是什么?
|
|
23
|
+
- 涉及哪些模块(上层应用/底层控制/消息定义)?
|
|
24
|
+
- 有哪些技术约束?
|
|
25
|
+
- 是否有现有代码需要修改?
|
|
26
|
+
|
|
27
|
+
### 步骤 2:代码库检索(如有需要)
|
|
28
|
+
|
|
29
|
+
如果需要了解现有实现,使用 ace-tool 检索:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
mcp__ace-tool__search_context {
|
|
33
|
+
"project_root_path": "{{项目路径}}",
|
|
34
|
+
"query": "{{相关功能关键词}}"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 步骤 3:WBS 任务分解
|
|
39
|
+
|
|
40
|
+
按照以下层级分解:
|
|
41
|
+
|
|
42
|
+
**Level 1: 功能**(顶层目标)
|
|
43
|
+
↓
|
|
44
|
+
**Level 2: 模块**(上层应用/底层控制/消息定义)
|
|
45
|
+
↓
|
|
46
|
+
**Level 3: 包/节点**(具体 ROS2 包和节点)
|
|
47
|
+
↓
|
|
48
|
+
**Level 4: 任务步骤**(可执行的具体动作)
|
|
49
|
+
|
|
50
|
+
### 步骤 4:输出规划文档
|
|
51
|
+
|
|
52
|
+
生成 Markdown 格式的规划文档,包含以下章节:
|
|
53
|
+
|
|
54
|
+
## 输出模板
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
# 功能规划:{{功能名称}}
|
|
58
|
+
|
|
59
|
+
**规划时间**:{{当前时间}}
|
|
60
|
+
**预估工作量**:{{总任务点}} 任务点
|
|
61
|
+
**目标平台**:ROS2 Humble / 物理机器人
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 1. 功能概述
|
|
66
|
+
|
|
67
|
+
### 1.1 目标
|
|
68
|
+
{{功能要达成的机器人任务目标}}
|
|
69
|
+
|
|
70
|
+
### 1.2 范围
|
|
71
|
+
**包含**:
|
|
72
|
+
- {{功能点 1}}
|
|
73
|
+
- {{功能点 2}}
|
|
74
|
+
|
|
75
|
+
**不包含**:
|
|
76
|
+
- {{明确不做的内容}}
|
|
77
|
+
|
|
78
|
+
### 1.3 技术约束
|
|
79
|
+
- {{ROS2 版本限制}}
|
|
80
|
+
- {{实时性要求}}
|
|
81
|
+
- {{硬件兼容性}}
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 2. WBS 任务分解
|
|
86
|
+
|
|
87
|
+
### 2.1 分解结构图
|
|
88
|
+
|
|
89
|
+
```mermaid
|
|
90
|
+
graph TD
|
|
91
|
+
A[{{功能名称}}] --> B[上层应用]
|
|
92
|
+
A --> C[底层控制]
|
|
93
|
+
A --> D[消息定义]
|
|
94
|
+
|
|
95
|
+
B --> B1[Launch 配置]
|
|
96
|
+
B --> B2[参数文件]
|
|
97
|
+
B --> B3[可视化节点]
|
|
98
|
+
|
|
99
|
+
C --> C1[驱动节点]
|
|
100
|
+
C --> C2[控制算法]
|
|
101
|
+
|
|
102
|
+
D --> D1[消息类型]
|
|
103
|
+
D --> D2[服务定义]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 2.2 任务清单
|
|
107
|
+
|
|
108
|
+
#### 模块 A:底层控制({{任务点}} 任务点)- Codex 主导
|
|
109
|
+
|
|
110
|
+
**包名**: `{{package_name}}`
|
|
111
|
+
|
|
112
|
+
- [ ] **任务 A.1**:{{任务描述}}({{任务点}} 点)
|
|
113
|
+
- **输入**:{{需要的数据/依赖}}
|
|
114
|
+
- **输出**:{{产出的结果}}
|
|
115
|
+
- **关键步骤**:
|
|
116
|
+
1. {{步骤 1}}
|
|
117
|
+
2. {{步骤 2}}
|
|
118
|
+
|
|
119
|
+
- [ ] **任务 A.2**:{{任务描述}}({{任务点}} 点)
|
|
120
|
+
- **输入**:{{需要的数据/依赖}}
|
|
121
|
+
- **输出**:{{产出的结果}}
|
|
122
|
+
- **关键步骤**:
|
|
123
|
+
1. {{步骤 1}}
|
|
124
|
+
2. {{步骤 2}}
|
|
125
|
+
|
|
126
|
+
#### 模块 B:上层应用({{任务点}} 任务点)- Gemini 主导
|
|
127
|
+
|
|
128
|
+
**包名**: `{{package_name}}`
|
|
129
|
+
|
|
130
|
+
{{重复上述结构}}
|
|
131
|
+
|
|
132
|
+
#### 模块 C:消息定义({{任务点}} 任务点)
|
|
133
|
+
|
|
134
|
+
**包名**: `{{package_name}}_msgs`
|
|
135
|
+
|
|
136
|
+
{{重复上述结构}}
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 3. 依赖关系
|
|
141
|
+
|
|
142
|
+
### 3.1 依赖图
|
|
143
|
+
|
|
144
|
+
```mermaid
|
|
145
|
+
graph LR
|
|
146
|
+
T1[消息定义] --> T2[底层控制节点]
|
|
147
|
+
T2 --> T3[上层应用]
|
|
148
|
+
T1 --> T4[Launch 配置]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 3.2 依赖说明
|
|
152
|
+
|
|
153
|
+
| 任务 | 依赖于 | 原因 |
|
|
154
|
+
|------|--------|------|
|
|
155
|
+
| 底层控制节点 | 消息定义 | 需要先定义消息类型 |
|
|
156
|
+
| Launch 配置 | 所有节点 | 需要所有节点完成后配置 |
|
|
157
|
+
|
|
158
|
+
### 3.3 并行任务
|
|
159
|
+
|
|
160
|
+
以下任务可以并行开发:
|
|
161
|
+
- 消息定义 ∥ 参数文件设计
|
|
162
|
+
- 底层控制算法 ∥ 上层可视化
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 4. 实施建议
|
|
167
|
+
|
|
168
|
+
### 4.1 技术选型
|
|
169
|
+
|
|
170
|
+
| 需求 | 推荐方案 | 理由 |
|
|
171
|
+
|------|----------|------|
|
|
172
|
+
| 电机驱动 | ros2_control | 标准化硬件抽象 |
|
|
173
|
+
| 导航 | Nav2 | 成熟的导航栈 |
|
|
174
|
+
| 仿真 | Gazebo | 支持 ROS2 集成 |
|
|
175
|
+
|
|
176
|
+
### 4.2 潜在风险
|
|
177
|
+
|
|
178
|
+
| 风险 | 影响 | 缓解措施 |
|
|
179
|
+
|------|------|----------|
|
|
180
|
+
| 实时性不足 | 高 | 使用实时内核,优化 QoS |
|
|
181
|
+
| 硬件兼容性 | 中 | 提前测试硬件驱动 |
|
|
182
|
+
|
|
183
|
+
### 4.3 测试策略
|
|
184
|
+
|
|
185
|
+
- **单元测试**:使用 gtest/pytest 测试算法逻辑
|
|
186
|
+
- **集成测试**:使用 launch_testing 测试节点通信
|
|
187
|
+
- **仿真测试**:使用 Gazebo 进行完整功能验证
|
|
188
|
+
- **硬件测试**:在物理机器人上验证
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 5. 验收标准
|
|
193
|
+
|
|
194
|
+
功能完成需满足以下条件:
|
|
195
|
+
|
|
196
|
+
- [ ] 所有任务清单完成
|
|
197
|
+
- [ ] 单元测试通过
|
|
198
|
+
- [ ] 仿真测试通过
|
|
199
|
+
- [ ] 代码审查通过
|
|
200
|
+
- [ ] 无高优先级 Bug
|
|
201
|
+
- [ ] 文档更新完成
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 6. 后续优化方向(可选)
|
|
206
|
+
|
|
207
|
+
Phase 2 可考虑的增强:
|
|
208
|
+
- {{优化点 1}}
|
|
209
|
+
- {{优化点 2}}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 关键原则
|
|
215
|
+
|
|
216
|
+
1. **避免时间估算**:使用"任务点"而非"小时/天",让开发者自行评估时间
|
|
217
|
+
2. **任务原子性**:每个任务应该是可独立完成的最小单元
|
|
218
|
+
3. **依赖明确**:清晰标注哪些任务必须先完成
|
|
219
|
+
4. **可追溯性**:每个任务都要有明确的输入、输出、验收标准
|
|
220
|
+
5. **风险前置**:提前识别技术风险并提供缓解方案
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 示例参考
|
|
225
|
+
|
|
226
|
+
### 输入示例
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
用户需求:实现 PID 速度控制器节点
|
|
230
|
+
|
|
231
|
+
项目上下文:
|
|
232
|
+
- ROS2 Humble
|
|
233
|
+
- 差速驱动机器人
|
|
234
|
+
- 已有 motor_driver 包
|
|
235
|
+
- 需要支持参数动态调节
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 输出示例(简化版)
|
|
239
|
+
|
|
240
|
+
```markdown
|
|
241
|
+
# 功能规划:PID 速度控制器
|
|
242
|
+
|
|
243
|
+
**预估工作量**:10 任务点
|
|
244
|
+
**目标平台**:ROS2 Humble / 物理机器人
|
|
245
|
+
|
|
246
|
+
## 1. 功能概述
|
|
247
|
+
|
|
248
|
+
实现一个 PID 速度控制器节点,订阅目标速度,发布电机控制指令。
|
|
249
|
+
|
|
250
|
+
## 2. WBS 任务分解
|
|
251
|
+
|
|
252
|
+
#### 模块 A:底层控制 - PID 控制器(6 任务点)- Codex 主导
|
|
253
|
+
|
|
254
|
+
**包名**: `pid_controller`
|
|
255
|
+
|
|
256
|
+
- [ ] **任务 A.1**:创建 PID 控制器类(2 点)
|
|
257
|
+
- **输入**:PID 参数 (Kp, Ki, Kd)
|
|
258
|
+
- **输出**:pid_controller.hpp/cpp
|
|
259
|
+
- **关键步骤**:
|
|
260
|
+
1. 定义 PIDController 类
|
|
261
|
+
2. 实现 compute() 方法
|
|
262
|
+
3. 实现积分限幅和微分滤波
|
|
263
|
+
|
|
264
|
+
- [ ] **任务 A.2**:创建 ROS2 节点封装(2 点)
|
|
265
|
+
- **输入**:PIDController 类
|
|
266
|
+
- **输出**:pid_controller_node.cpp
|
|
267
|
+
- **关键步骤**:
|
|
268
|
+
1. 创建 LifecycleNode
|
|
269
|
+
2. 订阅 /cmd_vel_target
|
|
270
|
+
3. 发布 /motor_cmd
|
|
271
|
+
|
|
272
|
+
- [ ] **任务 A.3**:实现参数动态调节(2 点)
|
|
273
|
+
- **输入**:ROS2 参数系统
|
|
274
|
+
- **输出**:支持 ros2 param set
|
|
275
|
+
- **关键步骤**:
|
|
276
|
+
1. 声明 Kp, Ki, Kd 参数
|
|
277
|
+
2. 注册参数回调
|
|
278
|
+
3. 实时更新 PID 参数
|
|
279
|
+
|
|
280
|
+
#### 模块 B:上层应用 - 配置和可视化(3 任务点)- Gemini 主导
|
|
281
|
+
|
|
282
|
+
**包名**: `pid_controller`
|
|
283
|
+
|
|
284
|
+
- [ ] **任务 B.1**:创建 Launch 文件(1 点)
|
|
285
|
+
- **输入**:节点需求
|
|
286
|
+
- **输出**:launch/pid_controller.launch.py
|
|
287
|
+
- **关键步骤**:
|
|
288
|
+
1. 加载参数文件
|
|
289
|
+
2. 启动节点
|
|
290
|
+
3. 配置 remapping
|
|
291
|
+
|
|
292
|
+
- [ ] **任务 B.2**:创建参数配置文件(1 点)
|
|
293
|
+
- **输入**:PID 参数需求
|
|
294
|
+
- **输出**:config/pid_params.yaml
|
|
295
|
+
- **关键步骤**:
|
|
296
|
+
1. 定义默认 PID 参数
|
|
297
|
+
2. 定义更新频率
|
|
298
|
+
3. 定义输出限制
|
|
299
|
+
|
|
300
|
+
- [ ] **任务 B.3**:添加 RViz 调试可视化(1 点)
|
|
301
|
+
- **输入**:控制器状态
|
|
302
|
+
- **输出**:RViz 配置
|
|
303
|
+
- **关键步骤**:
|
|
304
|
+
1. 发布 /pid_debug 话题
|
|
305
|
+
2. 创建 RViz 配置文件
|
|
306
|
+
|
|
307
|
+
#### 模块 C:消息定义(1 任务点)
|
|
308
|
+
|
|
309
|
+
**包名**: `pid_controller_msgs`
|
|
310
|
+
|
|
311
|
+
- [ ] **任务 C.1**:定义 PID 状态消息(1 点)
|
|
312
|
+
- **输入**:调试需求
|
|
313
|
+
- **输出**:msg/PIDState.msg
|
|
314
|
+
- **关键步骤**:
|
|
315
|
+
1. 定义 error, p_term, i_term, d_term, output
|
|
316
|
+
2. 生成消息包
|
|
317
|
+
|
|
318
|
+
## 3. 依赖关系
|
|
319
|
+
|
|
320
|
+
| 任务 | 依赖于 | 原因 |
|
|
321
|
+
|------|--------|------|
|
|
322
|
+
| A.2 节点封装 | A.1 PID 类 | 需要 PID 算法实现 |
|
|
323
|
+
| B.1 Launch | A.2 节点 | 需要知道节点可执行文件名 |
|
|
324
|
+
| A.2 节点封装 | C.1 消息 | 需要 PIDState 消息类型 |
|
|
325
|
+
|
|
326
|
+
## 4. 验收标准
|
|
327
|
+
|
|
328
|
+
- [ ] PID 控制器响应时间 < 10ms
|
|
329
|
+
- [ ] 参数动态调节正常工作
|
|
330
|
+
- [ ] 仿真测试速度跟踪误差 < 5%
|
|
331
|
+
- [ ] Launch 文件可正常启动
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## 使用指南
|
|
337
|
+
|
|
338
|
+
调用本 agent 时,请提供:
|
|
339
|
+
|
|
340
|
+
1. **用户需求**:完整的功能描述
|
|
341
|
+
2. **项目路径**:用于 ace-tool 检索上下文
|
|
342
|
+
3. **技术栈信息**:ROS2 版本、硬件平台、已有包
|
|
343
|
+
4. **特殊约束**:实时性要求、资源限制、安全要求
|
|
344
|
+
|
|
345
|
+
本 agent 将返回详细的 Markdown 规划文档,可直接保存到 `.claude/plan/功能名.md`。
|