diff --git a/.codex/skills/commit/SKILL.md b/.codex/skills/commit/SKILL.md new file mode 100644 index 0000000..e78e37b --- /dev/null +++ b/.codex/skills/commit/SKILL.md @@ -0,0 +1,77 @@ +--- +name: commit +description: 自动生成中文 git commit 信息并提交推送。读取当前改动,用简洁的中文一句话概括改动内容,然后自动执行 git add、commit、push。当用户说"提交""commit""提交代码""推送"时使用。 +allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(git log:*), Bash(git branch:*) +--- + +# 自动 commit 并 push + +读取当前 git 改动,生成简洁的中文 commit 信息,然后自动提交并推送。 + +## 执行步骤 + +### 1. 查看当前状态 + +先了解仓库当前情况: + +```bash +git status +git diff --stat # 看改动了哪些文件、改动量 +git diff # 看未暂存的具体改动 +git diff --staged # 看已暂存的具体改动 +git log --oneline -5 # 看最近几次提交风格,保持一致 +``` + +### 2. 分析改动 + +基于 diff 内容,理解这次改动**实际做了什么**: + +- 新增了什么功能/文件 +- 修改/修复了什么 +- 删除/重构了什么 +- 是文档、配置还是代码改动 + +**不要凭文件名猜测,要看实际 diff 内容。** + +### 3. 生成 commit 信息 + +要求: + +- **中文**,简洁,**一句话**概括这次改动的核心内容 +- **不要前缀**(不用 feat/fix/docs 这种 Conventional Commits 前缀) +- 直接描述做了什么,动词开头,如"添加 ALNS 自适应大邻域搜索算法"、"修复 POX 交叉中的索引越界问题"、"重构 FJSP 解码逻辑去掉 AGV 部分" +- 如果一次改动包含多个不相关的事情,提示用户是否要分开提交(但默认仍按一条处理) +- 长度控制在一行能看完,不写冗长描述 + +### 4. 自动提交并推送 + +确认 commit 信息后,依次执行: + +```bash +git add -A # 暂存所有改动 +git commit -m "生成的中文commit信息" +git push # 推送到当前分支的远程 +``` + +### 5. 处理常见情况 + +- **没有改动**:如果 `git status` 显示没有改动,告知用户无需提交,停止 +- **push 失败**: + - 如果是因为远程有新提交(需要先 pull),告知用户,建议先 `git pull` 或 `git pull --rebase`,**不要自动强推** + - 如果是没有配置远程或没有 upstream 分支,提示用户,给出 `git push -u origin <分支名>` 的建议命令 + - 如果是认证问题,告知用户检查凭证 +- **当前在重要分支**(如 main/master):正常执行,但在输出里提示一下当前分支名,让用户心里有数 + +### 6. 输出 + +完成后简要报告: + +- 生成的 commit 信息 +- 提交到了哪个分支 +- push 是否成功 + +## 注意事项 + +- commit 信息必须如实反映 diff 内容,不编造 +- push 失败时不要用 `--force` 强推,交给用户决定 +- 如果改动很大很杂,主动提示用户考虑拆分提交,但不强制 diff --git a/.codex/skills/readme/SKILL.md b/.codex/skills/readme/SKILL.md new file mode 100644 index 0000000..917b6c1 --- /dev/null +++ b/.codex/skills/readme/SKILL.md @@ -0,0 +1,92 @@ +--- +name: readme +description: 为当前项目生成适配 Gitee / 公司内部代码仓库的中英文双语 README。默认生成 README.md(中文,Gitee 默认展示)和 README_en.md(英文)两个文件,顶部互相链接切换语言。适用于公司项目、算法项目、机器人项目、工程代码仓库。当用户说“写个README”“生成项目介绍”“生成Gitee README”“make a readme”时使用。 +--- + +# Gitee 双语 README 生成 + +为当前项目生成两个互相链接的 README 文件: + +- `README.md`:简体中文,作为 Gitee 默认展示文件 +- `README_en.md`:英文版,供中英文切换使用 + +如果项目中已经存在 `README_zh.md`、`Readme_zh.md`、`Readme_en.md` 等命名,先读取已有文件,并尽量沿用当前仓库已有命名规范;如果没有明确规范,默认使用 `README.md` + `README_en.md`。 + +## 执行目标 + +生成符合公司内部 Gitee 仓库风格的 README,不写成 GitHub 开源宣传页。 + +README 应该让新同事或项目参与者快速知道: + +- 项目是什么 +- 面向什么设备 / 平台 / 场景 +- 软件架构大概是什么 +- 如何安装依赖 +- 如何编译 / 运行 / 启动 +- 代码目录怎么组织 +- 如何按公司流程参与开发 + +## 执行步骤 + +### 1. 调研项目 + +先充分了解项目,不要凭空编造内容。 + +必须优先读取和分析: + +- 项目根目录结构 +- 已有 README / 文档 +- 主入口脚本 +- 启动脚本 +- `CMakeLists.txt` +- `package.xml` +- `requirements.txt` +- `pyproject.toml` +- `package.json` +- `docker-compose.yml` +- `Dockerfile` +- 配置文件 +- launch 文件 +- ROS / ROS2 相关目录 +- 核心源码目录 +- 设备通信、底盘控制、导航、感知、驱动相关代码 + +需要识别: + +- 项目名称 +- 项目用途 +- 运行平台 +- 技术栈 +- 编程语言 +- ROS / ROS2 版本(如果存在) +- 构建方式 +- 启动方式 +- 主要模块 +- 依赖项 +- 是否有实际设备、仿真环境、域控一体机、阿克曼底盘、CAN、串口、网络通信等内容 + +**重要:只写代码和文档中真实存在的内容。** + +不要编造: + +- 未确认的算法 +- 未确认的性能指标 +- 未确认的硬件型号 +- 未确认的 ROS 版本 +- 未确认的启动命令 +- 未确认的部署流程 +- 未确认的许可证 + +如果信息不足,用“待补充”明确标注,不要用通用模板假装完整。 + +--- + +## 2. 文件命名与语言切换 + +### 默认文件 + +生成: + +```text +README.md +README_en.md \ No newline at end of file diff --git a/.cursor/rules/karpathy-guidelines.mdc b/.cursor/rules/karpathy-guidelines.mdc new file mode 100644 index 0000000..edd317f --- /dev/null +++ b/.cursor/rules/karpathy-guidelines.mdc @@ -0,0 +1,70 @@ +--- +description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria. +alwaysApply: true +--- + +# Karpathy behavioral guidelines + +Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed. + +**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment. + +## 1. Think Before Coding + +**Don't assume. Don't hide confusion. Surface tradeoffs.** + +Before implementing: +- State your assumptions explicitly. If uncertain, ask. +- If multiple interpretations exist, present them - don't pick silently. +- If a simpler approach exists, say so. Push back when warranted. +- If something is unclear, stop. Name what's confusing. Ask. + +## 2. Simplicity First + +**Minimum code that solves the problem. Nothing speculative.** + +- No features beyond what was asked. +- No abstractions for single-use code. +- No "flexibility" or "configurability" that wasn't requested. +- No error handling for impossible scenarios. +- If you write 200 lines and it could be 50, rewrite it. + +Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify. + +## 3. Surgical Changes + +**Touch only what you must. Clean up only your own mess.** + +When editing existing code: +- Don't "improve" adjacent code, comments, or formatting. +- Don't refactor things that aren't broken. +- Match existing style, even if you'd do it differently. +- If you notice unrelated dead code, mention it - don't delete it. + +When your changes create orphans: +- Remove imports/variables/functions that YOUR changes made unused. +- Don't remove pre-existing dead code unless asked. + +The test: Every changed line should trace directly to the user's request. + +## 4. Goal-Driven Execution + +**Define success criteria. Loop until verified.** + +Transform tasks into verifiable goals: +- "Add validation" → "Write tests for invalid inputs, then make them pass" +- "Fix the bug" → "Write a test that reproduces it, then make it pass" +- "Refactor X" → "Ensure tests pass before and after" + +For multi-step tasks, state a brief plan: +``` +1. [Step] → verify: [check] +2. [Step] → verify: [check] +3. [Step] → verify: [check] +``` + +Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification. + +--- + +**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a34ae9b --- /dev/null +++ b/README.md @@ -0,0 +1,169 @@ +# MyParking 停车机器人 + +[简体中文](README.md) | [English](README_en.md) + +## 重写说明 + +本仓库是停车机器人控制软件的重写版本。当前不以一次性恢复全部旧功能为目标,而是按以下顺序重新建立可验证、可维护的能力: + +1. 先实现单台停车机器人小车的基本功能; +2. 在单车闭环稳定后逐步增加停车作业功能; +3. 再优化轨迹跟踪方法及其稳定性; +4. 最后评估并实现多车通信、编队与协同控制。 + +**当前处于第 1 阶段,开发重点是单车基本功能。** `PilotConfig.cs` 中由 `#if false` 包围的钻车、夹抱和多车参数仅作为历史代码或设计参考,不参与当前编译,也不表示相关功能已经可用。 + +## 项目简介 + +MyParking 是一个面向多轮停车机器人底盘的 C# 控制工程。仓库包含上层运动控制插件 `ClumsyPilot` 和下层硬件适配插件 `MedullaAdapter`,用于建立从单车运动指令到 MCU 串口桥、CAN/串口端口的基础链路。 + +当前代码已经包含单车终点直线跟踪、前进/后退测试、PID 原地旋转、停止保护,以及 MCU 串口桥的托管封装和初始化流程。完整停车作业所需的驱动器协议、反馈解析、安全报警、夹抱执行和感知流程仍待实现或接入。 + +## 当前范围 + +| 范围 | 状态 | 说明 | +| --- | --- | --- | +| 单车几何控制器 | 已接入 | 根据公共配置创建 `MultiWheelGeometricController` | +| 单车终点跟踪 | 已实现基础版本 | 使用直线路径,可测试前进和后退,到达或退出时发送零速度 | +| 单车原地旋转 | 已实现基础版本 | 读取定位朝向并通过 PID 输出角速度,到位后停车 | +| MCU 串口桥 | 已封装 | 支持打开、复位、状态/版本查询、端口配置、IO、串口与 CAN 收发/回调 | +| MCU 初始化 | 已实现基础流程 | 默认使用 `COM4`、1 路 CAN 和 3 路串口配置 | +| 驱动反馈与安全链路 | 待实现 | 驱动协议、轮速/舵角反馈、电池、急停和报警例程目前没有实际逻辑 | +| 停车作业功能 | 待实现 | 钻车、轮胎识别、夹抱等旧参数当前被条件编译禁用 | +| 多车能力 | 暂不实施 | 多车参数当前被条件编译禁用,待单车及跟踪能力稳定后再设计 | + +## 软件结构 + +```text +上层 Clumsy 运行环境 + │ + ▼ +ClumsyPilot:单车动作、轨迹跟踪、测试入口 + │ 底盘速度指令 + ▼ +Medulla 运行环境 / MedullaAdapter + │ P/Invoke + ▼ +mcu_serial_bridge.dll → MCU → CAN / Serial / Digital IO +``` + +两个工程均生成类库,仓库中没有独立的可执行入口: + +- `ClumsyPilot`:上层单车运动控制,目标框架为 .NET Standard 2.0; +- `MedullaAdapter`:下层 MCU 和底盘适配,目标框架为 .NET 8.0。 + +## 目录说明 + +```text +MyParking/ +├── ParkingRobot.sln # Visual Studio 解决方案 +├── ClumsyPilot/ +│ ├── AGV.cs # 上层 AGV 接口 +│ ├── ChassisController.cs # 单车几何控制器配置 +│ ├── Movements.cs # 终点跟踪、等待、原地旋转动作 +│ ├── MovementTests.cs # Clumsy 环境中的人工动作测试 +│ ├── PilotConfig.cs # 当前单车配置及禁用的历史/预研配置 +│ ├── PilotDefinition.cs # 车型尺寸和车号定义 +│ └── ref/ # 上层框架引用程序集 +└── MedullaAdapter/ + ├── DiverCartDefinition.cs # 车型 IO、监控字段及 MCU 初始化 + ├── MCUSerialBridgeCLR.cs # 原生 MCU 串口桥的 C# 封装 + ├── MCUSerialBridgeError.cs # 错误码与诊断说明 + ├── AlarmRoutine.cs # 安全报警例程占位 + ├── MCURoutine.cs # MCU IO/反馈例程占位 + ├── MotorRoutine.cs # 电机控制例程占位 + ├── Remote.cs # 遥控例程占位 + └── ref/ # 下层框架引用程序集 +``` + +## 开发环境与依赖 + +- Windows 开发/运行环境;当前硬件接入使用 COM 端口和原生 DLL; +- Visual Studio 2022,或能够构建 .NET 8.0 与 .NET Standard 2.0 项目的 .NET SDK; +- NuGet 包:`Newtonsoft.Json 13.0.3`、`System.Numerics.Vectors 4.6.1`; +- `ClumsyPilot/ref` 和 `MedullaAdapter/ref` 中的内部框架程序集; +- 实机运行所需的 `mcu_serial_bridge.dll`;该文件当前未包含在仓库中; +- 能够加载 `ClumsyPilot.dll` 与 `MedullaAdapter.dll` 的 Clumsy/Medulla 宿主环境;宿主程序和部署配置当前未包含在仓库中。 + +仓库中未发现 ROS/ROS 2、Docker 或独立仿真启动配置。 + +## 编译 + +在仓库根目录执行: + +```powershell +dotnet restore ParkingRobot.sln +dotnet build ParkingRobot.sln -c Debug +``` + +主要输出位置: + +```text +ClumsyPilot/build/Clumsy/ClumsyPilot.dll +MedullaAdapter/build/Medulla/plugins/MedullaAdapter.dll +``` + +当前源码已通过解决方案编译。现有警告为 `DiverCartDefinition.TransmitterLastTime` 尚未赋值,不影响程序集生成。 + +## 运行与配置 + +本仓库只生成插件类库,不能通过 `dotnet run` 独立启动。需要由匹配版本的 Clumsy/Medulla 宿主加载上述程序集。具体宿主版本、目录复制方式、配置文件位置和启动命令尚未随仓库提供,待补充。 + +当前能够从代码确认的 MCU 默认初始化参数如下: + +| 参数 | 默认值 | +| --- | --- | +| MCU 端口 | `COM4` | +| MCU 连接波特率 | `1000000` | +| CAN 通道 | 1 路,`500000 bit/s`,重试时间 `10 ms` | +| 串口通道 | 3 路,`9600 bit/s`,接收帧时间 `10 ms` | + +实机启动前应在宿主参数界面或对应配置中确认端口和硬件参数。首次调试建议架空驱动轮或使用安全测试区域,并准备可靠的急停手段;当前安全报警与急停反馈逻辑尚未完成,不能将软件停车作为唯一安全措施。 + +## 单车功能验证 + +`MovementTests.cs` 向 Clumsy 测试界面注册了以下人工测试: + +- `测试终点跟踪动作-前进`:选取起点和终点后执行前向直线跟踪; +- `测试终点跟踪动作-后退`:以 180° 车身方向偏置执行后退跟踪; +- `底盘旋转测试`:输入世界坐标系目标角度后执行 PID 原地旋转。 + +这些是宿主环境内的动作测试,并非 `dotnet test` 自动化测试。实机验证前需要先确认定位数据、底盘速度接口、舵轮方向、速度单位和急停链路。 + +## 开发路线 + +### 阶段 1:单车基本功能(当前) + +- 打通上层动作、底盘控制、Medulla 适配和 MCU 通信链路; +- 完成单车启停、直线前进/后退、原地旋转和停止保护; +- 补齐驱动器命令、轮速与舵角反馈、IO、电池、急停和报警处理; +- 建立可重复的仿真/台架/实车验证方法。 + +### 阶段 2:增加停车作业功能 + +- 在单车基础控制稳定后,逐项接入遥控、感知、钻车、夹抱和退出车辆等功能; +- 每项功能分别完成参数定义、异常处理和实车验证,不直接启用旧的禁用代码。 + +### 阶段 3:优化跟踪方法 + +- 根据单车测试数据改进路径跟踪、速度规划、转向控制和到位判定; +- 完善曲线、倒车、低速近目标等工况,并补充可复现的回归测试; +- 在安全性、稳定性和可诊断性达到要求后冻结单车接口。 + +### 阶段 4:考虑多车场景 + +- 在单车接口稳定的前提下设计车辆身份、通信、心跳、超时和失联降级; +- 再实现编队、同步动作、车间位姿校正和多车安全策略; +- 多车预研参数需要重新评审,不以当前 `#if false` 代码作为完成依据。 + +## 参与开发 + +1. 修改前确认所属阶段,当前提交优先服务于单车基本功能; +2. 保持 `ClumsyPilot` 与 `MedullaAdapter` 的职责边界,避免在上层动作中直接实现硬件协议; +3. 新增硬件参数时注明单位、默认值、适用车型和安全范围; +4. 提交前至少执行 `dotnet build ParkingRobot.sln`,并记录宿主测试或实车测试条件; +5. 分支、代码评审和发布流程待项目团队补充。 + +## 许可证 + +仓库中暂未提供许可证文件。使用和分发范围请遵循公司内部规定。 diff --git a/README_en.md b/README_en.md new file mode 100644 index 0000000..fb63642 --- /dev/null +++ b/README_en.md @@ -0,0 +1,169 @@ +# MyParking Parking Robot + +[简体中文](README.md) | [English](README_en.md) + +## Rewrite Notice + +This repository is a rewrite of the parking-robot control software. The goal is not to restore every legacy feature at once. Development follows this sequence: + +1. Implement the basic functions of one parking robot first; +2. Add parking-operation features after the single-robot loop is stable; +3. Improve the tracking method and its robustness; +4. Evaluate and implement multi-robot communication, formation, and coordination last. + +**The project is currently in Stage 1 and focuses on basic single-robot functions.** The vehicle-entry, clamping, and multi-robot parameters enclosed by `#if false` in `PilotConfig.cs` are retained only as legacy or design references. They are excluded from the current build and do not indicate available features. + +## Overview + +MyParking is a C# control project for a multi-wheel parking-robot chassis. It contains an upper-layer motion-control plugin, `ClumsyPilot`, and a lower-layer hardware adapter, `MedullaAdapter`. Together, they establish the basic path from single-robot motion commands to an MCU serial bridge and its CAN, serial, and digital-I/O ports. + +The current code includes basic straight-line destination tracking, forward and reverse tests, PID-based in-place rotation, stop-on-exit handling, a managed wrapper for the MCU bridge, and its initialization sequence. Driver protocols, feedback parsing, safety alarms, clamping actuators, perception, and the complete parking workflow still need to be implemented or integrated. + +## Current Scope + +| Area | Status | Notes | +| --- | --- | --- | +| Single-robot geometric controller | Integrated | Creates a `MultiWheelGeometricController` from shared configuration | +| Destination tracking | Basic version implemented | Tracks a straight path forward or backward and sends zero speed when finished or interrupted | +| In-place rotation | Basic version implemented | Reads the localization heading and produces angular speed through a PID controller | +| MCU serial bridge | Wrapped | Supports open/reset, state/version queries, port configuration, I/O, serial, CAN, and callbacks | +| MCU initialization | Basic flow implemented | Defaults to `COM4`, one CAN channel, and three serial channels | +| Driver feedback and safety chain | To be implemented | Driver protocol, wheel/steering feedback, battery, emergency-stop, and alarm routines contain no operational logic yet | +| Parking-operation features | To be implemented | Vehicle entry, tire recognition, and clamping parameters are currently excluded by conditional compilation | +| Multi-robot features | Deferred | Multi-robot parameters are excluded and will be reconsidered after single-robot tracking is stable | + +## Software Structure + +```text +Upper-layer Clumsy runtime + │ + ▼ +ClumsyPilot: single-robot actions, tracking, and test entries + │ chassis velocity commands + ▼ +Medulla runtime / MedullaAdapter + │ P/Invoke + ▼ +mcu_serial_bridge.dll → MCU → CAN / Serial / Digital IO +``` + +Both projects build as libraries; this repository contains no standalone executable entry point: + +- `ClumsyPilot`: upper-layer single-robot motion control targeting .NET Standard 2.0; +- `MedullaAdapter`: lower-layer MCU and chassis adapter targeting .NET 8.0. + +## Repository Layout + +```text +MyParking/ +├── ParkingRobot.sln # Visual Studio solution +├── ClumsyPilot/ +│ ├── AGV.cs # Upper-layer AGV interface +│ ├── ChassisController.cs # Single-robot geometric-controller setup +│ ├── Movements.cs # Destination tracking, delay, and rotation actions +│ ├── MovementTests.cs # Manual action tests in the Clumsy runtime +│ ├── PilotConfig.cs # Active single-robot and disabled legacy/R&D settings +│ ├── PilotDefinition.cs # Vehicle dimensions and vehicle-number definition +│ └── ref/ # Upper-layer framework assemblies +└── MedullaAdapter/ + ├── DiverCartDefinition.cs # Vehicle I/O, monitoring fields, and MCU initialization + ├── MCUSerialBridgeCLR.cs # C# wrapper for the native MCU serial bridge + ├── MCUSerialBridgeError.cs # Error codes and diagnostic descriptions + ├── AlarmRoutine.cs # Placeholder for safety and alarm routines + ├── MCURoutine.cs # Placeholder for MCU I/O and feedback routines + ├── MotorRoutine.cs # Placeholder for motor-control routines + ├── Remote.cs # Placeholder for remote-control routines + └── ref/ # Lower-layer framework assemblies +``` + +## Development Environment and Dependencies + +- Windows development/runtime environment; current hardware access uses a COM port and a native DLL; +- Visual Studio 2022, or a .NET SDK capable of building .NET 8.0 and .NET Standard 2.0 projects; +- NuGet packages: `Newtonsoft.Json 13.0.3` and `System.Numerics.Vectors 4.6.1`; +- Internal framework assemblies under `ClumsyPilot/ref` and `MedullaAdapter/ref`; +- `mcu_serial_bridge.dll` for physical-hardware operation; it is not currently included in this repository; +- A compatible Clumsy/Medulla host capable of loading `ClumsyPilot.dll` and `MedullaAdapter.dll`. The host application and deployment configuration are not included. + +No ROS/ROS 2, Docker, or standalone simulation launch configuration was found in the repository. + +## Build + +Run from the repository root: + +```powershell +dotnet restore ParkingRobot.sln +dotnet build ParkingRobot.sln -c Debug +``` + +Primary output locations: + +```text +ClumsyPilot/build/Clumsy/ClumsyPilot.dll +MedullaAdapter/build/Medulla/plugins/MedullaAdapter.dll +``` + +The current source builds successfully. The remaining warning reports that `DiverCartDefinition.TransmitterLastTime` is never assigned; it does not prevent assembly generation. + +## Runtime and Configuration + +This repository produces plugin libraries and cannot be started independently with `dotnet run`. A compatible Clumsy/Medulla host must load the assemblies above. The exact host version, copy locations, configuration-file paths, and startup command have not been provided and remain to be documented. + +MCU defaults confirmed from the current source are: + +| Setting | Default | +| --- | --- | +| MCU port | `COM4` | +| MCU connection baud rate | `1000000` | +| CAN channels | One at `500000 bit/s`, with a `10 ms` retry time | +| Serial channels | Three at `9600 bit/s`, with a `10 ms` receive-frame time | + +Confirm the port and hardware parameters in the host configuration before physical operation. For initial tests, lift the drive wheels or use a controlled safety area and provide a reliable physical emergency stop. The alarm and emergency-stop feedback logic is incomplete, so software stop commands must not be the only safety measure. + +## Single-Robot Validation + +`MovementTests.cs` registers these manual tests in the Clumsy test interface: + +- `测试终点跟踪动作-前进`: select a source and destination for forward straight-line tracking; +- `测试终点跟踪动作-后退`: track backward with a 180-degree vehicle-direction offset; +- `底盘旋转测试`: enter a target world-frame heading and run PID-based in-place rotation. + +These are host-integrated action tests, not an automated `dotnet test` suite. Before physical testing, verify localization data, the chassis velocity interface, steering direction, speed units, and the emergency-stop chain. + +## Development Roadmap + +### Stage 1: Basic Single-Robot Functions (Current) + +- Connect upper-layer actions, chassis control, the Medulla adapter, and MCU communication; +- Complete single-robot start/stop, straight forward/reverse motion, in-place rotation, and stop protection; +- Implement driver commands, wheel and steering feedback, I/O, battery, emergency-stop, and alarm handling; +- Establish repeatable simulation, bench, and physical-vehicle validation procedures. + +### Stage 2: Add Parking-Operation Features + +- After basic single-robot control is stable, integrate remote control, perception, vehicle entry, clamping, and vehicle-exit functions one at a time; +- Define parameters, exception handling, and physical validation for each feature instead of directly enabling legacy disabled code. + +### Stage 3: Improve Tracking + +- Use single-robot test data to improve path tracking, speed planning, steering control, and arrival detection; +- Cover curves, reverse motion, and low-speed near-target conditions, with reproducible regression tests; +- Freeze the single-robot interfaces only after safety, stability, and diagnostics meet project requirements. + +### Stage 4: Consider Multi-Robot Scenarios + +- Once the single-robot interfaces are stable, design vehicle identity, communication, heartbeats, timeouts, and disconnect fallback behavior; +- Then implement formation control, synchronized actions, relative-pose correction, and multi-robot safety policies; +- Re-review all legacy multi-robot parameters; the current `#if false` block is not evidence of completed functionality. + +## Contributing + +1. Confirm the applicable roadmap stage before making a change; current contributions should prioritize basic single-robot functions. +2. Preserve the boundary between `ClumsyPilot` and `MedullaAdapter`; hardware protocols should not be implemented directly in upper-layer actions. +3. Document units, defaults, applicable vehicle types, and safe ranges for new hardware parameters. +4. Run at least `dotnet build ParkingRobot.sln` before submitting and record the host or physical-test conditions used. +5. The team still needs to document its branch, code-review, and release processes. + +## License + +No license file is currently included. Use and distribution must follow internal company policy.