Files
RC2027_BR_code/sim_ws/docs/DEPLOY_SPLIT.md
T

71 lines
3.5 KiB
Markdown
Raw 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.
# Gazebo 与导航分开启动
本机两个独立 launch 进程的连线回归使用 `scan_lio_split.launch.py`。
它验证进程边界、消息接口和停车;**不等于真实两台电脑的网络验收**。
真正跨机仍需机器人电脑在线,现场验证发现、带宽、延迟和断网停车。
ROS 域设置遵循 [ROS 2 Humble 环境说明](https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html)。
两端 ROS 2 Humble、相同消息定义,ROS_DOMAIN_ID 相同;跨机时显式 ROS_LOCALHOST_ONLY=0。
当前 robot launch 尊重上述环境变量,默认仍为本机域 77 和 localhost=1,不再覆盖用户的跨机设置。
## 笔记本:物理与传感器
在仓库根目录构建后,终端执行:
```bash
source /opt/ros/humble/setup.bash
source sim_ws/install/classic/setup.bash
export ROS_DOMAIN_ID=77 ROS_LOCALHOST_ONLY=0
export GAZEBO_MASTER_URI=http://127.0.0.1:11355
ros2 launch robocon_gazebo robocon_gazebo.launch.py
# 另一个终端(相同 source/export)
ros2 launch r2027_robot_description robocon_robot.launch.py \
lidar:=true sensor_model:=mid360 drive:=contact x:=-4.5 y:=4.5 z:=0.15 yaw:=0.0
# 第三个终端(相同 source/export)
ros2 launch r2027_robot_description mid360_sensors.launch.py sensor_profile:=ideal
```
这里只运行场地、机器人、物理雷达/IMU、命令保护与真值观测接口,不运行 Point-LIO/SCAN。
## 算法电脑:原定位、规划与控制
复制同一版本源码,按 P6_LOCALIZATION.md 构建 Livox 接口和 Point-LIO,
按 P3_P4_NAVIGATION.md 构建 SCAN/step_blocker,再只构建 br_sim_bringup:
```bash
source /opt/ros/humble/setup.bash
source sim_ws/install/localization/setup.bash
source sim_ws/install/navigation/setup.bash
PATH=/usr/bin:$PATH colcon build --base-paths sim_ws/src/br_sim_bringup \
--packages-select br_sim_bringup --build-base sim_ws/build/classic \
--install-base sim_ws/install/classic --symlink-install
source sim_ws/install/classic/setup.bash
export ROS_DOMAIN_ID=77 ROS_LOCALHOST_ONLY=0
ros2 launch br_sim_bringup scan_lio_navigation.launch.py \
x:=-4.5 y:=4.5 z:=0.15 yaw:=0.0
```
该入口不查找机器人描述包、不加载 Gazebo、不创建第二个 server。
算法只需要 ROS 消息、Point-LIO、SCAN 与 br_sim_bringup 的 launch/脚本资源。
此端不需要 Gazebo master 地址,通信通过 ROS 2 DDS。
实车算法包没有新增 Gazebo 依赖,仿真与实车安装前缀应分别使用。
两端已知起点参数必须相同,且实际从该平地起点静止开始。
坡道模式分别改起点为 (3.5,±3.5125,0.15,0),算法入口换 `scan_lio_terrain.launch.py start_sim:=false`。
噪声只在物理端用 sensor_profile 选择,不能在算法端假装已经改变物理观测。
## 现场验收
- 算法端可接收 /clock、/sim/mid360/lidar、/sim/mid360/imu,时间戳持续增加。
- /planning/perception_ready 为 true 后,按已验收目标/路径测试;独立真值不能作为算法输入。
- 只允许一个 /sim/cmd_vel 发布者(物理端命令保护),不要启动真实雷达/串口桥。
- 分别检查传感器掉流和网络中断时的停车;本机暂停 Point-LIO 不代替跨机断网验收。
- 若 DDS 无法发现,检查两端域、网卡、多播和防火墙;不要为本教程自动修改系统网络。
本机复现(自动起停,不能与手动仿真同时运行):
```bash
/usr/bin/python3 sim_ws/tools/check_lio_navigation.py --split --laps 2 \
--sensor-profile mild --out sim_ws/log/split_continuous_manual
```