feat:完善结构与仿真环境
This commit is contained in:
@@ -0,0 +1,150 @@
|
||||
# 仿真环境启动指南
|
||||
|
||||
本文档说明如何单独启动 Isaac 仿真环境的各个组件。
|
||||
|
||||
## 前置条件
|
||||
|
||||
```bash
|
||||
# 先 source ROS2 环境
|
||||
source install/setup.bash
|
||||
```
|
||||
|
||||
## 单独启动组件
|
||||
|
||||
### 1. Isaac 仿真环境
|
||||
|
||||
```bash
|
||||
# 带可视化界面
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component isaac
|
||||
|
||||
# headless 模式(无界面)
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component isaac --headless
|
||||
```
|
||||
|
||||
### 2. 仿真车端统一 Agent
|
||||
|
||||
包含底盘、运控、传感器数据转发:
|
||||
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component vehicle-agent
|
||||
```
|
||||
|
||||
### 3. 外部位姿桥
|
||||
|
||||
将 Isaac 真值转发给车端:
|
||||
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component external-pose-bridge
|
||||
```
|
||||
|
||||
### 4. 车间侧传感器 Ingest
|
||||
|
||||
从车端轮询传感器数据:
|
||||
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component sensor-ingest
|
||||
```
|
||||
|
||||
### 5. 车间 Gateway
|
||||
|
||||
ROS2 节点,对接底盘/运控:
|
||||
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component gateway
|
||||
```
|
||||
|
||||
## 启动完整仿真链路
|
||||
|
||||
### 方式一:一键启动所有仿真组件(不含车间总控)
|
||||
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component all
|
||||
```
|
||||
|
||||
### 方式二:分步启动(推荐用于调试)
|
||||
|
||||
终端 1 - 启动 Isaac:
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component isaac
|
||||
```
|
||||
|
||||
终端 2 - 启动车端 Agent:
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component vehicle-agent
|
||||
```
|
||||
|
||||
终端 3 - 启动外部位姿桥:
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component external-pose-bridge
|
||||
```
|
||||
|
||||
终端 4 - 启动传感器 Ingest:
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component sensor-ingest
|
||||
```
|
||||
|
||||
终端 5 - 启动车间 Gateway:
|
||||
```bash
|
||||
python3 src/simulation/tools/launch_sim_stack.py --component gateway
|
||||
```
|
||||
|
||||
终端 6 - 启动车间总控:
|
||||
```bash
|
||||
ros2 launch win_ubuntu_bridge minimal_workshop_demo.launch.py \
|
||||
use_gateway:=true \
|
||||
chassis_host:=127.0.0.1 \
|
||||
control_host:=127.0.0.1 \
|
||||
sensor_registry:=demo_front_camera,demo_down_camera,demo_lidar_3d,demo_lidar_2d,demo_imu
|
||||
```
|
||||
|
||||
## 验证仿真环境
|
||||
|
||||
启动后检查 topic:
|
||||
|
||||
```bash
|
||||
# 查看 Isaac 发布的传感器数据
|
||||
ros2 topic list | grep isaac
|
||||
|
||||
# 检查各传感器数据频率
|
||||
ros2 topic hz /sensor/front_camera/image_raw
|
||||
ros2 topic hz /sensor/down_camera/image_raw
|
||||
ros2 topic hz /sensor/lidar_3d/pointcloud
|
||||
ros2 topic hz /sensor/lidar_2d/scan
|
||||
ros2 topic hz /sensor/imu/data
|
||||
|
||||
# 检查外部位姿
|
||||
ros2 topic hz /isaac/external_localization/telemetry
|
||||
```
|
||||
|
||||
## 执行端到端验收测试
|
||||
|
||||
仿真环境启动后,执行验收:
|
||||
|
||||
```bash
|
||||
python3 src/simulation/tools/smoke_test_workshop_orchestrator.py \
|
||||
--verbose-feedback \
|
||||
--no-publish-fake-external-telemetry
|
||||
```
|
||||
|
||||
## 停止仿真环境
|
||||
|
||||
按 `Ctrl+C` 停止各组件,或使用:
|
||||
|
||||
```bash
|
||||
./stop_isaac_real_sim_stack.sh
|
||||
```
|
||||
|
||||
## 快捷脚本
|
||||
|
||||
也可以使用一键测试脚本(启动所有组件并执行验收):
|
||||
|
||||
```bash
|
||||
# 完整测试(启动 + 验收 + 停止)
|
||||
./run_isaac_real_sim_test.sh
|
||||
|
||||
# 保持运行(不执行验收)
|
||||
./run_isaac_real_sim_test.sh --no-smoke --keep-running
|
||||
|
||||
# headless 模式
|
||||
./run_isaac_real_sim_test.sh --headless
|
||||
```
|
||||
Reference in New Issue
Block a user