unity2moveit2/README.md
ayuan9957 fe15edcbd5 Initial commit: Unity-MoveIt2 integrated robotic arm simulation system
- Unity frontend with ROS-TCP-Connector for ROS2 communication
- Docker-based ROS2 Jazzy backend with MoveIt2 integration
- Support for 1-9 DOF manipulators
- UR5 robot configuration and URDF files
- Assembly task feasibility analysis tools
- Comprehensive documentation and deployment guides

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 12:08:34 +08:00

200 lines
5.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Unity-MoveIt2 通用机械臂仿真系统
## 🎯 项目概述
本项目是一个支持1-9自由度机械臂的Unity-MoveIt2交互式仿真系统专为有限空间内的装配任务可行性分析而设计。系统结合了Unity的强大可视化能力和MoveIt2的智能路径规划功能为机器人装配任务提供完整的仿真验证解决方案。
## ✨ 核心特性
- **🔧 通用性**支持1-9自由度任意机械臂配置
- **🎮 交互性**Unity 6DOF拖拽操作实时末端控制
- **🧠 智能性**MoveIt2路径规划碰撞检测与避障
- **📊 可视化**:实时轨迹显示,碰撞热图,状态监控
- **🏭 装配仿真**:有限空间装配可行性分析与环境影响评估
## 🏗️ 系统架构
```
┌─────────────────┐ ROS2 TCP Bridge ┌─────────────────┐
│ Unity 前端 │ ◄─────────────────► │ MoveIt2 后端 │
│ │ │ │
│ • 3D可视化 │ │ • 路径规划 │
│ • 交互控制 │ │ • 碰撞检测 │
│ • 任务标注 │ │ • 运动学解算 │
│ • 环境编辑 │ │ • 可行性分析 │
└─────────────────┘ └─────────────────┘
```
## 🚀 快速开始
### 环境要求
- **Unity**: 2022.3 LTS 或更高版本 (推荐 2022.3.57f1c2)
- **ROS2**: Jazzy (推荐) 或 Humble
- **Docker**: 20.10+ (推荐)
- **操作系统**: Windows 10/11, Ubuntu 20.04/22.04
### 安装步骤
1. **克隆项目**
```bash
git clone <repository-url>
cd DockerRos2Arm-niryo_arm
```
2. **启动ROS2后端**
```bash
cd ros2-workspace
docker-compose up -d
```
3. **配置Unity项目**
```bash
# 打开Unity Hub导入unity-project目录
# 安装ROS TCP Connector包
```
4. **运行系统**
- 启动ROS2服务`roslaunch niryo_moveit demo.launch`
- 运行Unity场景打开MainScene并点击Play
## 📁 项目结构
```
DockerRos2Arm-niryo_arm/
├── docs/ # 📚 项目文档
│ ├── architecture/ # 架构设计文档
│ ├── api/ # API接口文档
│ ├── deployment/ # 部署指南
│ ├── user-guide/ # 用户指南
│ └── developer-guide/ # 开发者指南
├── configs/ # ⚙️ 配置文件
│ ├── robots/ # 机器人配置
│ ├── unity/ # Unity配置
│ ├── ros2/ # ROS2配置
│ └── docker/ # Docker配置
├── scripts/ # 🔧 脚本工具
├── examples/ # 📋 示例代码
├── tests/ # 🧪 测试文件
├── assets/ # 🎨 资源文件
├── unity-project/ # 🎮 Unity项目
├── ros2-workspace/ # 🤖 ROS2工作空间
└── README.md # 📖 项目说明
```
## 🎯 主要功能
### 1. 通用机械臂适配
- 动态URDF加载与解析
- 1-9自由度关节配置
- 自动运动学参数计算
- 多品牌机器人支持
### 2. 交互式控制
- Unity 6DOF末端拖拽
- 实时逆运动学求解
- 关节空间/笛卡尔空间切换
- 速度与加速度限制
### 3. 智能路径规划
- MoveIt2 OMPL规划器集成
- 多种规划算法支持
- 碰撞检测与避障
- 轨迹优化与平滑
### 4. 装配仿真分析
- 有限空间可行性评估
- 环境约束建模
- 装配序列优化
- 碰撞风险分析
## 🔧 配置说明
### 机器人配置
`configs/robots/` 目录下创建机器人配置文件:
```yaml
# example_robot.yaml
robot_name: "example_7dof"
dof: 7
urdf_path: "robots/example_7dof.urdf"
srdf_path: "robots/example_7dof.srdf"
joint_limits:
- {name: "joint1", min: -3.14, max: 3.14, velocity: 1.0}
# ... 更多关节配置
```
### Unity配置
`configs/unity/` 目录下配置Unity参数
```json
{
"ros_bridge": {
"ip": "127.0.0.1",
"port": 10000
},
"visualization": {
"show_trajectory": true,
"show_collision": true,
"update_rate": 30
}
}
```
## 📊 性能指标
- **延迟**: < 50ms (Unity ROS2)
- **更新频率**: 30Hz (可视化)
- **规划时间**: < 2s (7DOF复杂场景)
- **内存占用**: < 2GB (完整系统)
## 🧪 测试与验证
```bash
# 运行单元测试
cd tests
python -m pytest test_kinematics.py
# 运行集成测试
./scripts/run_integration_tests.sh
# 性能基准测试
./scripts/benchmark.sh
```
## 📖 文档导航
- [架构设计](docs/architecture/ARCHITECTURE.md) - 系统架构详细说明
- [API文档](docs/api/API.md) - 接口定义与使用说明
- [部署指南](docs/deployment/DEPLOYMENT.md) - 详细部署步骤
- [用户指南](docs/user-guide/USER_GUIDE.md) - 操作使用手册
- [开发者指南](docs/developer-guide/DEVELOPER_GUIDE.md) - 开发扩展指南
## 🤝 贡献指南
1. Fork 项目
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 打开 Pull Request
## 📄 许可证
本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情
## 🆘 支持与反馈
- **问题报告**: [GitHub Issues](https://github.com/your-repo/issues)
- **功能请求**: [GitHub Discussions](https://github.com/your-repo/discussions)
- **技术支持**: support@your-domain.com
## 🏷️ 版本历史
- **v1.0.0** - 初始版本支持基础机械臂仿真
- **v1.1.0** - 添加装配仿真功能
- **v1.2.0** - 支持1-9自由度通用配置
---
** 如果这个项目对您有帮助请给我们一个星标**